RTEMS
Macros | Functions
basedefs.h File Reference

This header file provides basic definitions used by the API and the implementation. More...

#include <rtems/score/cpuopts.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define RTEMS_CONCAT(_x, _y)   _x##_y
 Concatenates _x and _y without expanding. More...
 
#define RTEMS_TYPEOF_REFX(_level, _target)   __typeof__(_level(union { int z; __typeof__(_target) x; }){0}.x)
 Returns the type of a pointer reference of the specified level to the specified type. More...
 
#define RTEMS_STRING(_x)   #_x
 Stringifies _x without expanding. More...
 
#define RTEMS_XCONCAT(_x, _y)   RTEMS_CONCAT( _x, _y )
 Concatenates expansion of _x and expansion of _y. More...
 
#define RTEMS_EXPAND(_token)   _token
 Helper macro to perform a macro expansion on the specified token. More...
 
#define RTEMS_DEPRECATED   __attribute__((__deprecated__))
 Instructs the compiler in a declaration to issue a warning whenever a variable, function, or type using this declaration will be used.
 
#define RTEMS_NO_RETURN   __attribute__((__noreturn__))
 Tells the compiler in a function declaration that this function does not return.
 
#define RTEMS_PACKED   __attribute__((__packed__))
 Instructs the compiler in a type definition to place members of a structure or union so that the memory required is minimized.
 
#define RTEMS_PURE   __attribute__((__pure__))
 Tells the compiler in a function declaration that this function has no effect except the return value and that the return value depends only on the value of parameters and/or global variables.
 
#define RTEMS_USED   __attribute__((__used__))
 Tells the compiler that a specific variable or function is used.
 
#define RTEMS_DEQUALIFY_DEPTHX(_ptr_level, _type, _var)
 Performs a type cast which removes qualifiers without warnings to the specified type for the specified variable. More...
 
#define RTEMS_XSTRING(_x)   RTEMS_STRING( _x )
 Stringifies the expansion of _x. More...
 
#define RTEMS_SYMBOL_NAME(_name)   RTEMS_EXPAND(_name)
 Constructs a symbol name. More...
 
#define _Assert_Unreachable()   do { } while ( 0 )
 Asserts that this program point is unreachable.
 
#define RTEMS_ALIAS(_target)   __attribute__((__alias__(#_target)))
 Instructs the compiler to generate an alias to the specified target function. More...
 
#define RTEMS_ALIGN_DOWN(_value, _alignment)   ( ( _value ) & ~( ( _alignment ) - 1 ) )
 Returns the specified value aligned down to the specified alignment. More...
 
#define RTEMS_ALIGN_UP(_value, _alignment)   ( ( ( _value ) + ( _alignment ) - 1 ) & ~( ( _alignment ) - 1 ) )
 Returns the specified value aligned up to the specified alignment. More...
 
#define RTEMS_ALIGNED(_alignment)   __attribute__((__aligned__(_alignment)))
 Instructs the compiler in a declaration or definition to enforce the specified alignment. More...
 
#define RTEMS_ALLOC_ALIGN(_index)   __attribute__((__alloc_align__(_index)))
 Tells the compiler in a declaration that the memory allocation alignment parameter of this function is similar to aligned_alloc(). More...
 
#define RTEMS_ALLOC_SIZE(_index)   __attribute__((__alloc_size__(_index)))
 Tells the compiler in a declaration that the memory allocation size parameter of this function is similar to malloc(). More...
 
#define RTEMS_ALLOC_SIZE_2(_count_index, _size_index)   __attribute__((__alloc_size__(_count_index, _size_index)))
 Tells the compiler in a declaration that the memory allocation item count and item size parameter of this function is similar to calloc(). More...
 
#define RTEMS_ARRAY_SIZE(_array)   (sizeof(_array) / sizeof((_array)[0]))
 Returns the element count of the specified array. More...
 
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE   RTEMS_DEPRECATED
 Provided for backward compatibility.
 
#define RTEMS_COMPILER_MEMORY_BARRIER()   __asm__ volatile( "" ::: "memory" )
 This macro forbids the compiler to reorder read and write commands around it.
 
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE   RTEMS_NO_RETURN
 Provided for backward compatibility.
 
#define RTEMS_COMPILER_PACKED_ATTRIBUTE   RTEMS_PACKED
 Provided for backward compatibility.
 
#define RTEMS_COMPILER_PURE_ATTRIBUTE   RTEMS_PURE
 Provided for backward compatibility.
 
#define RTEMS_COMPILER_USED_ATTRIBUTE   RTEMS_USED
 Provided for backward compatibility.
 
#define RTEMS_CONST   __attribute__((__const__))
 Tells the compiler in a function declaration that this function has no effect except the return value and that the return value depends only on the value of parameters.
 
#define RTEMS_CONTAINER_OF(_m, _type, _member_name)   ( (_type *) ( (uintptr_t) ( _m ) - offsetof( _type, _member_name ) ) )
 Returns the pointer to the container of a specified member pointer. More...
 
#define RTEMS_DECLARE_GLOBAL_SYMBOL(_name)   extern char _name[]
 Declares a global symbol with the specified name. More...
 
#define RTEMS_DECONST(_type, _var)   RTEMS_DEQUALIFY_DEPTHX(*, _type, _var)
 Performs a type cast which removes const qualifiers without warnings to the specified type for the specified pointer variable. More...
 
#define RTEMS_DEFINE_GLOBAL_SYMBOL(_name, _value)
 Defines a global symbol with the specified name and value. More...
 
#define RTEMS_DEQUALIFY(_type, _var)   RTEMS_DEQUALIFY_DEPTHX(*, _type, _var)
 Performs a type cast which removes all qualifiers without warnings to the specified type for the specified pointer variable. More...
 
#define RTEMS_DEVOLATILE(_type, _var)   RTEMS_DEQUALIFY_DEPTHX(*, _type, _var)
 Performs a type cast which removes volatile qualifiers without warnings to the specified type for the specified pointer variable. More...
 
#define FALSE   0
 If FALSE is undefined, then FALSE is defined to 0.
 
#define RTEMS_HAVE_MEMBER_SAME_TYPE(_t_lhs, _m_lhs, _t_rhs, _m_rhs)
 Evaluates to true if the specified members of two types have compatible types, otherwise to false. More...
 
#define RTEMS_INLINE_ROUTINE   static __inline__
 Gives a hint to the compiler in a function declaration to inline this function.
 
#define RTEMS_MALLOCLIKE   __attribute__((__malloc__))
 Tells the compiler in a declaration that this function is a memory allocation function similar to malloc().
 
#define RTEMS_NO_INLINE   __attribute__((__noinline__))
 Instructs the compiler in a function declaration to not inline this function.
 
#define RTEMS_OBFUSCATE_VARIABLE(_var)   __asm__( "" : "+r" ( _var ) )
 Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value. More...
 
#define RTEMS_PREDICT_FALSE(_exp)   __builtin_expect( ( _exp ), 0 )
 Returns the value of the specified integral expression and tells the compiler that the predicted value is false (1). More...
 
#define RTEMS_PREDICT_TRUE(_exp)   __builtin_expect( ( _exp ), 1 )
 Returns the value of the specified integral expression and tells the compiler that the predicted value is true (1). More...
 
#define RTEMS_PRINTFLIKE(_format_pos, _ap_pos)   __attribute__((__format__(__printf__, _format_pos, _ap_pos)))
 Tells the compiler in a declaration that this function expects printf()-like arguments. More...
 
#define RTEMS_RETURN_ADDRESS()   __builtin_return_address(0)
 Returns the return address of the current function. More...
 
#define RTEMS_SECTION(_section)   __attribute__((__section__(_section)))
 Instructs the compiler to place a specific variable or function in the specified section. More...
 
#define RTEMS_STATIC_ASSERT(_cond, _msg)
 Asserts at compile time that the specified condition is satisfied. More...
 
#define TRUE   1
 If TRUE is undefined, then TRUE is defined to 1.
 
#define RTEMS_UNREACHABLE()
 Tells the compiler that this program point is unreachable. More...
 
#define RTEMS_UNUSED   __attribute__((__unused__))
 Tells the compiler that a specific variable or function is deliberately unused.
 
#define RTEMS_WARN_UNUSED_RESULT   __attribute__((__warn_unused_result__))
 Tells the compiler in a declaration that the result of this function should be used.
 
#define RTEMS_WEAK   __attribute__((__weak__))
 Tells the compiler in a function definition that this function should be weak. More...
 
#define RTEMS_WEAK_ALIAS(_target)   __attribute__((__weak__, __alias__(#_target)))
 Instructs the compiler to generate a weak alias to the specified target function. More...
 
#define RTEMS_ZERO_LENGTH_ARRAY   0
 This is a constant to declare zero-length arrays. More...
 

Functions

void * RTEMS_DEQUALIFY_types_not_compatible (void)
 A not implemented function to trigger compile time errors with an error message.
 

Detailed Description

This header file provides basic definitions used by the API and the implementation.

Definition in file basedefs.h.

Macro Definition Documentation

◆ RTEMS_UNREACHABLE

#define RTEMS_UNREACHABLE ( )
Value:
do { \
__builtin_unreachable(); \
_Assert_Unreachable(); \
} while ( 0 )

Tells the compiler that this program point is unreachable.

Definition at line 860 of file basedefs.h.