Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/linker_set.h
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
#define DATA_WSET(set, sym) __MAKE_SET_QV(set, sym, ) | #define DATA_WSET(set, sym) __MAKE_SET_QV(set, sym, ) | ||||
#define BSS_SET(set, sym) __MAKE_SET(set, sym) | #define BSS_SET(set, sym) __MAKE_SET(set, sym) | ||||
#define ABS_SET(set, sym) __MAKE_SET(set, sym) | #define ABS_SET(set, sym) __MAKE_SET(set, sym) | ||||
#define SET_ENTRY(set, sym) __MAKE_SET(set, sym) | #define SET_ENTRY(set, sym) __MAKE_SET(set, sym) | ||||
/* | /* | ||||
* Initialize before referring to a given linker set. | * Initialize before referring to a given linker set. | ||||
*/ | */ | ||||
#define SET_DECLARE(set, ptype) \ | #define SET_DECLARE(set, ptype) \ | ||||
extern ptype *__CONCAT(__start_set_,set); \ | |||||
extern ptype *__CONCAT(__stop_set_,set) | |||||
/* Like SET_DECLARE() but also marks the symbols weak to support empty sets. */ | |||||
#define SET_DECLARE_WEAK(set, ptype) \ | |||||
extern ptype __weak_symbol *__CONCAT(__start_set_,set); \ | extern ptype __weak_symbol *__CONCAT(__start_set_,set); \ | ||||
extern ptype __weak_symbol *__CONCAT(__stop_set_,set) | extern ptype __weak_symbol *__CONCAT(__stop_set_,set) | ||||
#define SET_BEGIN(set) \ | #define SET_BEGIN(set) \ | ||||
jrtc27: Maybe makes more sense to flip these around so SET_DECLARE comes first and is the primary one? | |||||
Done Inline ActionsYes sounds good, will switch them. arichardson: Yes sounds good, will switch them. | |||||
Not Done Inline ActionsThe alternative is to abuse ptype and just make the callers who want a weak symbol use SET_DECLARE(foo, struct bar __weak_symbol)... :) jrtc27: The alternative is to abuse ptype and just make the callers who want a weak symbol use… | |||||
(&__CONCAT(__start_set_,set)) | (&__CONCAT(__start_set_,set)) | ||||
#define SET_LIMIT(set) \ | #define SET_LIMIT(set) \ | ||||
(&__CONCAT(__stop_set_,set)) | (&__CONCAT(__stop_set_,set)) | ||||
/* | /* | ||||
* Iterate over all the elements of a set. | * Iterate over all the elements of a set. | ||||
* | * | ||||
* Sets always contain addresses of things, and "pvar" points to words | * Sets always contain addresses of things, and "pvar" points to words | ||||
Show All 16 Lines |
Maybe makes more sense to flip these around so SET_DECLARE comes first and is the primary one?