RTEMS  5.0.0
Macros | Typedefs
Basic Definitions

Macros

#define TRUE   1
 
#define FALSE   0
 
#define RTEMS_INLINE_ROUTINE   static inline
 
#define RTEMS_COMPILER_MEMORY_BARRIER()
 
#define RTEMS_NO_INLINE
 
#define RTEMS_NO_RETURN
 
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE   RTEMS_NO_RETURN
 
#define RTEMS_PURE
 
#define RTEMS_COMPILER_PURE_ATTRIBUTE   RTEMS_PURE
 
#define RTEMS_DEPRECATED
 Public name for task floating point context area. More...
 
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE   RTEMS_DEPRECATED
 
#define RTEMS_SECTION(_section)
 Instructs the compiler to place a specific variable or function in the specified section.
 
#define RTEMS_USED
 Instructs the compiler that a specific variable or function is used.
 
#define RTEMS_UNUSED
 
#define RTEMS_COMPILER_UNUSED_ATTRIBUTE   RTEMS_UNUSED
 
#define RTEMS_PACKED
 
#define RTEMS_ALIAS(_target)
 Instructs the compiler to generate an alias to the specified target function.
 
#define RTEMS_WEAK_ALIAS(_target)
 Instructs the compiler to generate a weak alias to the specified target function.
 
#define RTEMS_ALIGNED(_alignment)
 Instructs the compiler to enforce the specified alignment.
 
#define RTEMS_COMPILER_PACKED_ATTRIBUTE   RTEMS_PACKED
 
#define _Assert_Unreachable()   do { } while ( 0 )
 
#define RTEMS_UNREACHABLE()   _Assert_Unreachable()
 Tells the compiler that this program point is unreachable.
 
#define RTEMS_PRINTFLIKE(_format_pos, _ap_pos)
 Tells the compiler that this function expects printf()-like arguments.
 
#define RTEMS_MALLOCLIKE
 Tells the compiler that this function is a memory allocation function similar to malloc().
 
#define RTEMS_ALLOC_SIZE(_index)
 Tells the compiler the memory allocation size parameter of this function similar to malloc().
 
#define RTEMS_ALLOC_SIZE_2(_count_index, _size_index)
 Tells the compiler the memory allocation item count and item size parameter of this function similar to calloc().
 
#define RTEMS_ALLOC_ALIGN(_index)
 Tells the compiler the memory allocation alignment parameter of this function similar to aligned_alloc().
 
#define RTEMS_WARN_UNUSED_RESULT
 Tells the compiler that the result of this function should be used.
 
#define RTEMS_OBFUSCATE_VARIABLE(_var)   (void) (_var)
 Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value. More...
 
#define RTEMS_DECLARE_GLOBAL_SYMBOL(_name)   extern char _name[]
 Declares a global symbol with the specified name. More...
 
#define RTEMS_DEFINE_GLOBAL_SYMBOL(_name, _value)
 Defines a global symbol with the specified name and value. More...
 
#define RTEMS_PREDICT_TRUE(_exp)   ( _exp )
 Returns the value of the specified integral expression and tells the compiler that the predicted value is true (1). More...
 
#define RTEMS_PREDICT_FALSE(_exp)   ( _exp )
 Returns the value of the specified integral expression and tells the compiler that the predicted value is false (0). More...
 
#define RTEMS_STATIC_ASSERT(cond, msg)
 
#define RTEMS_ARRAY_SIZE(array)   (sizeof(array) / sizeof((array)[0]))
 
#define RTEMS_ZERO_LENGTH_ARRAY   0
 
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)   ( (_type *) ( (uintptr_t) ( _m ) - offsetof( _type, _member_name ) ) )
 Returns a pointer to the container of a specified member pointer. More...
 
#define RTEMS_TYPEOF_REFX(_ptr_level, _ptr_type)   __typeof__(_ptr_level(union { int z; __typeof__(_ptr_type) x; }){0}.x)
 
#define RTEMS_DECONST(_type, _var)   ((_type)(uintptr_t)(const void *) ( _var ))
 Removes the const qualifier from a type of a variable. More...
 
#define RTEMS_DEVOLATILE(_type, _var)   ((_type)(uintptr_t)(volatile void *) ( _var ))
 Removes the volatile qualifier from a type of a variable. More...
 
#define RTEMS_DEQUALIFY(_type, _var)   ((_type)(uintptr_t)(const volatile void *) ( _var ))
 Removes the all qualifiers from a type of a variable. More...
 
#define RTEMS_HAVE_MEMBER_SAME_TYPE(_t_lhs, _m_lhs, _t_rhs, _m_rhs)   true
 Evaluates to true if the members of two types have the same type. More...
 
#define RTEMS_CONCAT(_x, _y)   _x##_y
 Concatenates _x and _y without expanding.
 
#define RTEMS_XCONCAT(_x, _y)   RTEMS_CONCAT( _x, _y )
 Concatenates expansion of _x and expansion of _y.
 
#define RTEMS_STRING(_x)   #_x
 Stringifies _x without expanding.
 
#define RTEMS_XSTRING(_x)   RTEMS_STRING( _x )
 Stringifies expansion of _x.
 

Typedefs

typedef void *proc_ptr RTEMS_DEPRECATED
 

Detailed Description

Macro Definition Documentation

◆ FALSE

#define FALSE   0

This ensures that RTEMS has FALSE defined in all situations.

◆ RTEMS_COMPILER_MEMORY_BARRIER

#define RTEMS_COMPILER_MEMORY_BARRIER ( )

The following macro is a compiler specific way to ensure that memory writes are not reordered around certain points. This specifically can impact interrupt disable and thread dispatching critical sections.

◆ RTEMS_CONTAINER_OF

#define RTEMS_CONTAINER_OF (   _m,
  _type,
  _member_name 
)    ( (_type *) ( (uintptr_t) ( _m ) - offsetof( _type, _member_name ) ) )

Returns a pointer to the container of a specified member pointer.

Parameters
[in]_mThe pointer to a member of the container.
[in]_typeThe type of the container.
[in]_member_nameThe designator name of the container member.

◆ RTEMS_DECLARE_GLOBAL_SYMBOL

#define RTEMS_DECLARE_GLOBAL_SYMBOL (   _name)    extern char _name[]

Declares a global symbol with the specified name.

This macro must be placed at file scope.

The name must be a valid designator.

◆ RTEMS_DECONST

#define RTEMS_DECONST (   _type,
  _var 
)    ((_type)(uintptr_t)(const void *) ( _var ))

Removes the const qualifier from a type of a variable.

Parameters
[in]_typeThe target type for the variable.
[in]_varThe variable.

◆ RTEMS_DEFINE_GLOBAL_SYMBOL

#define RTEMS_DEFINE_GLOBAL_SYMBOL (   _name,
  _value 
)

Defines a global symbol with the specified name and value.

This macro must be placed at file scope.

The name must be a valid designator.

On the value parameters macro expansion is performed and afterwards it is stringified. It must expand to an integer literal understood by the assembler.

◆ RTEMS_DEPRECATED

typedef struct timespec rtems_thread_cpu_usage_t RTEMS_DEPRECATED

Public name for task floating point context area.

Represents the CPU usage per thread.

Information structure returned by the Heap Handler via the Region Manager.

Instructs the compiler to issue a warning whenever a variable or function with this attribute will be used.

When using nanoseconds granularity timing, RTEMS may internally use a variety of representations.

◆ RTEMS_DEQUALIFY

#define RTEMS_DEQUALIFY (   _type,
  _var 
)    ((_type)(uintptr_t)(const volatile void *) ( _var ))

Removes the all qualifiers from a type of a variable.

Parameters
[in]_typeThe target type for the variable.
[in]_varThe variable.

◆ RTEMS_DEVOLATILE

#define RTEMS_DEVOLATILE (   _type,
  _var 
)    ((_type)(uintptr_t)(volatile void *) ( _var ))

Removes the volatile qualifier from a type of a variable.

Parameters
[in]_typeThe target type for the variable.
[in]_varThe variable.

◆ RTEMS_HAVE_MEMBER_SAME_TYPE

#define RTEMS_HAVE_MEMBER_SAME_TYPE (   _t_lhs,
  _m_lhs,
  _t_rhs,
  _m_rhs 
)    true

Evaluates to true if the members of two types have the same type.

Parameters
[in]_t_lhsLeft hand side type.
[in]_m_lhsLeft hand side member.
[in]_t_rhsRight hand side type.
[in]_m_rhsRight hand side member.

◆ RTEMS_INLINE_ROUTINE

#define RTEMS_INLINE_ROUTINE   static inline

The following (in conjunction with compiler arguments) are used to choose between the use of static inline functions and macro functions. The static inline implementation allows better type checking with no cost in code size or execution speed.

◆ RTEMS_NO_INLINE

#define RTEMS_NO_INLINE

The following defines a compiler specific attribute which informs the compiler that the method must not be inlined.

◆ RTEMS_NO_RETURN

#define RTEMS_NO_RETURN

The following macro is a compiler specific way to indicate that the method will NOT return to the caller. This can assist the compiler in code generation and avoid unreachable paths. This can impact the code generated following calls to rtems_fatal_error_occurred and _Terminate.

◆ RTEMS_OBFUSCATE_VARIABLE

#define RTEMS_OBFUSCATE_VARIABLE (   _var)    (void) (_var)

Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value.

The variable must be simple enough to fit into a register.

◆ RTEMS_PACKED

#define RTEMS_PACKED

Instructs the compiler that a specific structure or union members will be placed so that the least memory is used.

◆ RTEMS_PREDICT_FALSE

#define RTEMS_PREDICT_FALSE (   _exp)    ( _exp )

Returns the value of the specified integral expression and tells the compiler that the predicted value is false (0).

Parameters
[in]_expThe expression.
Returns
The value of the expression.

◆ RTEMS_PREDICT_TRUE

#define RTEMS_PREDICT_TRUE (   _exp)    ( _exp )

Returns the value of the specified integral expression and tells the compiler that the predicted value is true (1).

Parameters
[in]_expThe expression.
Returns
The value of the expression.

◆ RTEMS_PURE

#define RTEMS_PURE

The following defines a compiler specific attribute which informs the compiler that the method has no effect except the return value and that the return value depends only on parameters and/or global variables.

◆ RTEMS_STATIC_ASSERT

#define RTEMS_STATIC_ASSERT (   cond,
  msg 
)
Value:
struct rtems_static_assert_ ## msg \
{ int rtems_static_assert_ ## msg : (cond) ? 1 : -1; }
Definition: b1553brm.c:75

◆ RTEMS_UNUSED

#define RTEMS_UNUSED

Instructs the compiler that a specific variable is deliberately unused. This can occur when reading volatile device memory or skipping arguments in a variable argument method.

◆ TRUE

#define TRUE   1

This ensures that RTEMS has TRUE defined in all situations.

Typedef Documentation

◆ RTEMS_DEPRECATED

typedef void* proc_ptr RTEMS_DEPRECATED

XXX: Eventually proc_ptr needs to disappear!!!