* Initialization must run fairly early, as soon as malloc(9) is available, and * definitely before witness, which uses stack(9). We synthesize a module_info * entry for the kernel, because unwind_module_loaded() doesn't get called for * it. Also, it is unlike other modules in that the elf metadata for locating * the unwind tables might be stripped, so instead we have to use the * _exidx_sta
| 281 | * _exidx_start/end symbols created by ldscript.arm. |
| 282 | */ |
| 283 | static int |
| 284 | module_info_init(void *arg __unused) |
| 285 | { |
| 286 | struct linker_file thekernel; |
| 287 | |
| 288 | STAILQ_INIT(&module_list); |
| 289 | |
| 290 | thekernel.filename = "kernel"; |
| 291 | thekernel.address = CADDR(&_start); |
| 292 | thekernel.size = UADDR(&_end) - UADDR(&_start); |
| 293 | thekernel.exidx_addr = CADDR(&_exidx_start); |
| 294 | thekernel.exidx_size = UADDR(&_exidx_end) - UADDR(&_exidx_start); |
| 295 | populate_module_info(create_module_info(), &thekernel); |
| 296 | |
| 297 | return (0); |
| 298 | } |
| 299 | SYSINIT(unwind_init, SI_SUB_KMEM, SI_ORDER_ANY, module_info_init, NULL); |
| 300 | |
| 301 | /* Expand a 31-bit signed value to a 32-bit signed value */ |
nothing calls this directly
no test coverage detected