treewide: update usage of zephyr_code_relocate

Update usage of zephyr_code_relocate to follow new API. The old method
of relocating a file was the following directive:

zephyr_code_relocate(file location)

The new API for zephyr_code_relocate uses the following directive:

zephyr_code_relocate(FILES file LOCATION location)

update in tree usage to follow this model. Also, update the NXP HAL SHA,
as NXP's HAL uses this macro as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2022-10-04 18:44:56 -05:00 committed by Carles Cufí
commit 47271ce8be
9 changed files with 28 additions and 27 deletions

View file

@ -9,24 +9,25 @@ FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
if (CONFIG_BOARD_QEMU_XTENSA)
set(RAM_PHDR :sram0_phdr)
set(SRAM2_PHDR :sram2_phdr)
set(RAM_PHDR PHDR sram0_phdr)
set(SRAM2_PHDR PHDR sram2_phdr)
endif()
# Code relocation feature
zephyr_code_relocate(src/test_file1.c "SRAM2 ${SRAM2_PHDR}")
zephyr_code_relocate(FILES src/test_file1.c ${SRAM2_PHDR} LOCATION SRAM2)
zephyr_code_relocate(src/test_file2.c "RAM ${RAM_PHDR}")
zephyr_code_relocate(FILES src/test_file2.c ${RAM_PHDR} LOCATION RAM)
zephyr_code_relocate(src/test_file3.c SRAM2_LITERAL)
zephyr_code_relocate(src/test_file3.c SRAM2_TEXT)
zephyr_code_relocate(src/test_file3.c RAM_DATA)
zephyr_code_relocate(src/test_file3.c SRAM2_BSS)
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_LITERAL)
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_TEXT)
zephyr_code_relocate(FILES src/test_file3.c LOCATION RAM_DATA)
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_BSS)
zephyr_code_relocate(../../../kernel/sem.c "RAM ${RAM_PHDR}")
zephyr_code_relocate(FILES ../../../kernel/sem.c ${RAM_PHDR} LOCATION RAM)
if (CONFIG_RELOCATE_TO_ITCM)
zephyr_code_relocate(../../../lib/libc/minimal/source/string/string.c ITCM_TEXT)
zephyr_code_relocate(FILES ../../../lib/libc/minimal/source/string/string.c
LOCATION ITCM_TEXT)
endif()
zephyr_linker_sources(SECTIONS custom-sections.ld)