[PATCH 1/7] score: Add RTEMS_DECONST|DEVOLATILE|DEQUALIFY()

Joel Sherrill joel.sherrill at oarcorp.com
Fri Sep 5 13:53:07 UTC 2014


Why add these?

They are only a problem with old toolsets which didn't
include a new enough newlib. The only target in this
shape was the nios2 in the transition period between
Altera's 4.1 and using FSF GCC 4.9. Since all toolset
targets are now up to date, I think this is covering
up someone needing to update their toolset.

--joel

On 9/5/2014 2:33 AM, Sebastian Huber wrote:
> ---
>  cpukit/score/include/rtems/score/basedefs.h | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
> index ec93951..361f514 100644
> --- a/cpukit/score/include/rtems/score/basedefs.h
> +++ b/cpukit/score/include/rtems/score/basedefs.h
> @@ -227,6 +227,33 @@
>  #define RTEMS_CONTAINER_OF( _m, _type, _member_name ) \
>    ( (_type *) ( (uintptr_t) ( _m ) - offsetof( _type, _member_name ) ) )
>  
> +/**
> + * @brief Removes the const qualifier from a type of a variable.
> + *
> + * @param[in] _type The target type for the variable.
> + * @param[in] _var The variable.
> + */
> +#define RTEMS_DECONST( _type, _var ) \
> +  ((_type)(uintptr_t)(const void *) ( _var ))
> +
> +/**
> + * @brief Removes the volatile qualifier from a type of a variable.
> + *
> + * @param[in] _type The target type for the variable.
> + * @param[in] _var The variable.
> + */
> +#define RTEMS_DEVOLATILE( _type, _var ) \
> +  ((_type)(uintptr_t)(volatile void *) ( _var ))
> +
> +/**
> + * @brief Removes the all qualifiers from a type of a variable.
> + *
> + * @param[in] _type The target type for the variable.
> + * @param[in] _var The variable.
> + */
> +#define RTEMS_DEQUALIFY( _type, _var ) \
> +  ((_type)(uintptr_t)(const volatile void *) ( _var ))
> +
>  #ifndef ASM
>    #ifdef RTEMS_DEPRECATED_TYPES
>      typedef bool boolean;

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the devel mailing list