device: add post-process of elf file to manage device handles
Following the idiom used for system calls, add script support to read the initial application binary to identify which devices are defined, and to use their offset in the device array as their unique handle rather than the externally-defined ordinal from devicetree. The device dependency arrays are updated to use these handles. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
b61515320e
commit
40d3653758
7 changed files with 367 additions and 5 deletions
|
@ -748,6 +748,19 @@ if(CONFIG_GEN_ISR_TABLES)
|
|||
set_property(GLOBAL APPEND PROPERTY GENERATED_KERNEL_SOURCE_FILES isr_tables.c)
|
||||
endif()
|
||||
|
||||
# dev_handles.c is generated from ${ZEPHYR_PREBUILT_EXECUTABLE} by
|
||||
# gen_handles.py
|
||||
add_custom_command(
|
||||
OUTPUT dev_handles.c
|
||||
COMMAND
|
||||
${PYTHON_EXECUTABLE}
|
||||
${ZEPHYR_BASE}/scripts/gen_handles.py
|
||||
--output-source dev_handles.c
|
||||
--kernel $<TARGET_FILE:${ZEPHYR_PREBUILT_EXECUTABLE}>
|
||||
DEPENDS ${ZEPHYR_PREBUILT_EXECUTABLE}
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY GENERATED_KERNEL_SOURCE_FILES dev_handles.c)
|
||||
|
||||
if(CONFIG_CODE_DATA_RELOCATION)
|
||||
# @Intent: Linker script to relocate .text, data and .bss sections
|
||||
toolchain_ld_relocation()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue