15 #ifndef _RTEMS_LINKERSET_H 16 #define _RTEMS_LINKERSET_H 24 #define RTEMS_LINKER_SET_BEGIN( set ) \ 25 _Linker_set_##set##_begin 27 #define RTEMS_LINKER_SET_END( set ) \ 28 _Linker_set_##set##_end 30 #define RTEMS_LINKER_ROSET_DECLARE( set, type ) \ 31 extern type const RTEMS_LINKER_SET_BEGIN( set )[]; \ 32 extern type const RTEMS_LINKER_SET_END( set )[] 34 #define RTEMS_LINKER_ROSET( set, type ) \ 35 type const RTEMS_LINKER_SET_BEGIN( set )[ 0 ] \ 36 RTEMS_SECTION( ".rtemsroset." #set ".begin" ) RTEMS_USED; \ 37 type const RTEMS_LINKER_SET_END( set )[ 0 ] \ 38 RTEMS_SECTION( ".rtemsroset." #set ".end" ) RTEMS_USED 40 #define RTEMS_LINKER_ROSET_ITEM_ORDERED_DECLARE( set, type, item, order ) \ 41 type const _Linker_set_##set##_##item \ 42 RTEMS_SECTION( ".rtemsroset." #set ".content.0." RTEMS_XSTRING( order ) ) 44 #define RTEMS_LINKER_ROSET_ITEM_DECLARE( set, type, item ) \ 45 extern type const _Linker_set_##set##_##item \ 46 RTEMS_SECTION( ".rtemsroset." #set ".content.1" ) 48 #define RTEMS_LINKER_ROSET_ITEM_REFERENCE( set, type, item ) \ 49 static type const * const _Set_reference_##set##_##item \ 50 RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \ 51 &_Linker_set_##set##_##item 53 #define RTEMS_LINKER_ROSET_ITEM_ORDERED( set, type, item, order ) \ 54 type const _Linker_set_##set##_##item \ 55 RTEMS_SECTION( ".rtemsroset." #set ".content.0." RTEMS_XSTRING( order ) ) \ 58 #define RTEMS_LINKER_ROSET_ITEM( set, type, item ) \ 59 type const _Linker_set_##set##_##item \ 60 RTEMS_SECTION( ".rtemsroset." #set ".content.1" ) RTEMS_USED 62 #define RTEMS_LINKER_ROSET_CONTENT( set, decl ) \ 64 RTEMS_SECTION( ".rtemsroset." #set ".content" ) 66 #define RTEMS_LINKER_RWSET_DECLARE( set, type ) \ 67 extern type RTEMS_LINKER_SET_BEGIN( set )[]; \ 68 extern type RTEMS_LINKER_SET_END( set )[] 70 #define RTEMS_LINKER_RWSET( set, type ) \ 71 type RTEMS_LINKER_SET_BEGIN( set )[ 0 ] \ 72 RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \ 73 type RTEMS_LINKER_SET_END( set )[ 0 ] \ 74 RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED 76 #define RTEMS_LINKER_RWSET_ITEM_ORDERED_DECLARE( set, type, item, order ) \ 77 extern type _Linker_set_##set##_##item \ 78 RTEMS_SECTION( ".rtemsrwset." #set ".content.0." RTEMS_XSTRING( order ) ) 80 #define RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item ) \ 81 extern type _Linker_set_##set##_##item \ 82 RTEMS_SECTION( ".rtemsrwset." #set ".content.1" ) 89 #define RTEMS_LINKER_RWSET_ITEM_REFERENCE( set, type, item ) \ 90 static type * const _Set_reference_##set##_##item \ 91 RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \ 92 &_Linker_set_##set##_##item 94 #define RTEMS_LINKER_RWSET_ITEM_ORDERED( set, type, item, order ) \ 95 type _Linker_set_##set##_##item \ 96 RTEMS_SECTION( ".rtemsrwset." #set ".content.0." RTEMS_XSTRING( order ) ) \ 99 #define RTEMS_LINKER_RWSET_ITEM( set, type, item ) \ 100 type _Linker_set_##set##_##item \ 101 RTEMS_SECTION( ".rtemsrwset." #set ".content.1" ) RTEMS_USED 103 #define RTEMS_LINKER_RWSET_CONTENT( set, decl ) \ 105 RTEMS_SECTION( ".rtemsrwset." #set ".content" ) 111 addr = (uintptr_t) ptr;
117 #define RTEMS_LINKER_SET_SIZE( set ) \ 118 ( _Linker_set_Obfuscate( RTEMS_LINKER_SET_END( set ) ) \ 119 - _Linker_set_Obfuscate( RTEMS_LINKER_SET_BEGIN( set ) ) ) 121 #define RTEMS_LINKER_SET_ITEM_COUNT( set ) \ 122 ( RTEMS_LINKER_SET_SIZE( set ) \ 123 / sizeof( RTEMS_LINKER_SET_BEGIN( set )[ 0 ] ) ) 125 #define RTEMS_LINKER_SET_IS_EMPTY( set ) \ 126 ( RTEMS_LINKER_SET_SIZE( set ) == 0 ) 128 #define RTEMS_LINKER_SET_FOREACH( set, item ) \ 130 item = (void *) _Linker_set_Obfuscate( RTEMS_LINKER_SET_BEGIN( set ) ) ; \ 131 item != RTEMS_LINKER_SET_END( set ) ; \ #define RTEMS_OBFUSCATE_VARIABLE(_var)
Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value...
This header file provides basic definitions used by the API and the implementation.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.