Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/linker_set.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
#define __MAKE_SET_CONST const | #define __MAKE_SET_CONST const | ||||
#endif | #endif | ||||
/* | /* | ||||
* Private macros, not to be used outside this header file. | * Private macros, not to be used outside this header file. | ||||
*/ | */ | ||||
#ifdef __GNUCLIKE___SECTION | #ifdef __GNUCLIKE___SECTION | ||||
#define __MAKE_SET_QV(set, sym, qv) \ | #define __MAKE_SET_QV(set, sym, qv) \ | ||||
__GLOBL(__CONCAT(__start_set_,set)); \ | __WEAK(__CONCAT(__start_set_,set)); \ | ||||
__GLOBL(__CONCAT(__stop_set_,set)); \ | __WEAK(__CONCAT(__stop_set_,set)); \ | ||||
val_packett.cool: I just went with the most similar-to-existing-code solution, but maybe it should just do the… | |||||
static void const * qv \ | static void const * qv \ | ||||
__set_##set##_sym_##sym __section("set_" #set) \ | __set_##set##_sym_##sym __section("set_" #set) \ | ||||
__nosanitizeaddress \ | __nosanitizeaddress \ | ||||
__used = &(sym) | __used = &(sym) | ||||
#define __MAKE_SET(set, sym) __MAKE_SET_QV(set, sym, __MAKE_SET_CONST) | #define __MAKE_SET(set, sym) __MAKE_SET_QV(set, sym, __MAKE_SET_CONST) | ||||
#else /* !__GNUCLIKE___SECTION */ | #else /* !__GNUCLIKE___SECTION */ | ||||
#error this file needs to be ported to your compiler | #error this file needs to be ported to your compiler | ||||
#endif /* __GNUCLIKE___SECTION */ | #endif /* __GNUCLIKE___SECTION */ | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |
I just went with the most similar-to-existing-code solution, but maybe it should just do the same C decls as SET_DECLARE here? Or something else?