Changes between Version 8 and Version 9 of BuildSystemDev
- Timestamp:
- Oct 11, 2012, 4:19:51 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BuildSystemDev
v8 v9 137 137 138 138 Initialization order of different software components at system start needs close attention. 139 Having all modules and features initialized in proper order is challenging in modular and configurable projectslike MutekH.140 141 The configuration tool soffers a way to specify initialization code ordering constraints and to optionally associate them to configuration tokens.139 Having all modules and features initialized in proper order is challenging in a modular and configurable project like MutekH. 140 141 The configuration tool offers a way to specify initialization code ordering constraints and to optionally associate them to configuration tokens. 142 142 This has several advantages: 143 143 * It allows inserting external modules initialization code in the right place without patching the main tree. 144 144 * It avoids the burdensome work of maintaining initialization function calls and associated `#ifdef` directives. 145 * It ensures initialization function invocations do not get badly reordered to satisfy a new constraint, while ignoring an older one.145 * It ensures initialization function invocations do not get badly reordered to satisfy a new constraint, while ignoring an older constraint. 146 146 147 147 Initialization tokens can be declared for that purpose, each specifying a different stage in the MutekH initialization process. 148 These tokens live in a separate name space from configuration tokens and are not exported in configuration output. 149 150 A C source file will be automatically generated with initialization code from active tokens, respecting ordering constraints and current configuration. 148 These tokens live in a separate name space from configuration tokens and are not exported in the configuration output. 149 Instead a set of function prototypes and properly ordered function calls code are written as C macros which can then be invoked at the right place in the kernel code. 151 150 An error will be emitted if constraints can not be satisfied. 152 151 … … 161 160 This tag imposes the requirement that the code from current token be executed '''before''' the code associated with INIT_TOKEN. 162 161 `during INIT_TOKEN`:: 163 This tag makes the current token inherits from constraints expressed for the given INIT_TOKEN. The given token must be a place holder token and can not have associated code. 164 `code C code here`:: 165 This tag associates some initialization C code to the token. This tag may be used multiple times to add more code lines. 162 This tag makes the current token inherits from constraints expressed for the given INIT_TOKEN. This token must be a place holder token and can not have associated functions. 163 `functions init_function_name cleanup_function_name`:: 164 This tag associates some initialization and cleanup C function names to the token. The cleanup function is optional. 165 `prototype type arg0, type *arg1`:: 166 This tag sets a list of arguments used in init and cleanup functions prototypes. It must be used on the root place holder tokens so that the prototype is valid for all functions of children tokens. 166 167 167 168 === Example === … … 179 180 during INIT_LIBRARIES 180 181 after INIT_LIBC_STDIO # an explanation why this is needed 181 code great_feature_init();182 functions great_feature_init great_feature_cleanup 182 183 %init end 184 }}} 185 186 This will generate the following macros for use in MutekH source code, provided that the CONFIG_FEATURE token is defined in build configuration: 187 188 {{{ 189 #define INIT_LIBRARIES_PROTOTYPES \ 190 void great_feature_init(); \ 191 void great_feature_cleanup(); 192 193 #define INIT_LIBRARIES_INIT(...) \ 194 great_feature_init(__VA_ARGS__); \ 195 196 #define INIT_LIBRARIES_CLEANUP(...) \ 197 great_feature_claenup(__VA_ARGS__); \ 183 198 }}} 184 199