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 )[0]; \ 32 extern type const RTEMS_LINKER_SET_END( set )[0] 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_DECLARE( set, type, item ) \ 41 extern type const _Linker_set_##set##_##item 43 #define RTEMS_LINKER_ROSET_ITEM_REFERENCE( set, type, item ) \ 44 static type const * const _Set_reference_##set##_##item \ 45 RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \ 46 &_Linker_set_##set##_##item 48 #define RTEMS_LINKER_ROSET_ITEM_ORDERED( set, type, item, order ) \ 49 type const _Linker_set_##set##_##item \ 50 RTEMS_SECTION( ".rtemsroset." #set ".content.0." RTEMS_XSTRING( order ) ) \ 53 #define RTEMS_LINKER_ROSET_ITEM( set, type, item ) \ 54 type const _Linker_set_##set##_##item \ 55 RTEMS_SECTION( ".rtemsroset." #set ".content.1" ) RTEMS_USED 57 #define RTEMS_LINKER_ROSET_CONTENT( set, decl ) \ 59 RTEMS_SECTION( ".rtemsroset." #set ".content" ) 61 #define RTEMS_LINKER_RWSET_DECLARE( set, type ) \ 62 extern type RTEMS_LINKER_SET_BEGIN( set )[0]; \ 63 extern type RTEMS_LINKER_SET_END( set )[0] 65 #define RTEMS_LINKER_RWSET( set, type ) \ 66 type RTEMS_LINKER_SET_BEGIN( set )[0] \ 67 RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \ 68 type RTEMS_LINKER_SET_END( set )[0] \ 69 RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED 71 #define RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item ) \ 72 extern type _Linker_set_##set##_##item 79 #define RTEMS_LINKER_RWSET_ITEM_REFERENCE( set, type, item ) \ 80 static type * const _Set_reference_##set##_##item \ 81 RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \ 82 &_Linker_set_##set##_##item 84 #define RTEMS_LINKER_RWSET_ITEM_ORDERED( set, type, item, order ) \ 85 type _Linker_set_##set##_##item \ 86 RTEMS_SECTION( ".rtemsrwset." #set ".content.0." RTEMS_XSTRING( order ) ) \ 89 #define RTEMS_LINKER_RWSET_ITEM( set, type, item ) \ 90 type _Linker_set_##set##_##item \ 91 RTEMS_SECTION( ".rtemsrwset." #set ".content.1" ) RTEMS_USED 93 #define RTEMS_LINKER_RWSET_CONTENT( set, decl ) \ 95 RTEMS_SECTION( ".rtemsrwset." #set ".content" ) 101 addr = (uintptr_t) ptr;
107 #define RTEMS_LINKER_SET_SIZE( set ) \ 108 ( _Linker_set_Obfuscate( RTEMS_LINKER_SET_END( set ) ) \ 109 - _Linker_set_Obfuscate( RTEMS_LINKER_SET_BEGIN( set ) ) ) 111 #define RTEMS_LINKER_SET_ITEM_COUNT( set ) \ 112 ( RTEMS_LINKER_SET_SIZE( set ) \ 113 / sizeof( RTEMS_LINKER_SET_BEGIN( set )[ 0 ] ) ) 115 #define RTEMS_LINKER_SET_IS_EMPTY( set ) \ 116 ( RTEMS_LINKER_SET_SIZE( set ) == 0 ) 118 #define RTEMS_LINKER_SET_FOREACH( set, item ) \ 120 item = (void *) _Linker_set_Obfuscate( RTEMS_LINKER_SET_BEGIN( set ) ) ; \ 121 item != RTEMS_LINKER_SET_END( set ) ; \ #define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
#define RTEMS_OBFUSCATE_VARIABLE(_var)
Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value...
Definition: basedefs.h:299