[rtems commit] Using the generic atomic ops to implement UP mode atomic for all architectures . SMP atomic port will be later.
Ralf Corsepius
ralf.corsepius at rtems.org
Wed May 1 14:44:10 UTC 2013
On 05/01/2013 04:23 PM, Gedare Bloom wrote:
> Module: rtems
> Branch: master
> Commit: 9b605b28b497f398682a8ffd673f6860340957f8
> Changeset: http://git.rtems.org/rtems/commit/?id=9b605b28b497f398682a8ffd673f6860340957f8
>
> Author: WeiY <wei.a.yang at gmail.com>
> Date: Wed Apr 24 00:34:16 2013 +0800
>
> Using the generic atomic ops to implement UP mode atomic for all architectures. SMP atomic port will be later.
> +++ b/cpukit/score/cpu/arm/rtems/score/cpuatomic.h
> @@ -0,0 +1,40 @@
> +/**
> + * @file rtems/score/cpuatomic.h
> + *
> + * This include file implements the atomic operations for arm and defines
> + * atomic data types which are used by the atomic operations API file. This
> + * file should use fixed name cpuatomic.h and should be included in atomic
> + * operations API file atomic.h. If the architecture works at the UP mode it
> + * will use a generic atomic ops using disable/enable-IRQ simulated. If the
> + * the architecture works at SMP mode, most of the parts of implementations
> + * are imported from FreeBSD kernel.
> + */
> +
> +#ifndef _RTEMS_SCORE_ATOMIC_CPU_H
> +#define _RTEMS_SCORE_ATOMIC_CPU_H
> +
> +#include <rtems/score/genericcpuatomic.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/**
> + * @defgroup RTEMS atomic implementation
> + *
> + */
> +
> +/**@{*/
> +
> +#if !defined(RTEMS_SMP)
> +#include <rtems/score/genericatomicops.h>
> +#else
> +#endif
> +
> +#ifdef __cplusplus
> +}
> +#endif
> +
> +/**@}*/
> +#endif
> +/* end of include file */
Would somebody please explain the code above?
The #ifdef __cplusplus as well as the #if !defined(RTEMS_SMP)
should be completely superflous. If not, they'd indicate bugs elsewhere.
Ralf
More information about the devel
mailing list