linker: allocate devices in ROM

Pull request https://github.com/zephyrproject-rtos/zephyr/pull/24873
marked all the struct devices const.

However, the linker scripts were never updated to actually allocate
the struct devices in ROM. They're still in RAM, so the main benefit
of this work has not been realized.

Fix it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-06-07 16:09:43 -07:00 committed by Carles Cufí
commit 88eda6f77d
2 changed files with 15 additions and 15 deletions

View file

@ -22,21 +22,6 @@
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif
SECTION_DATA_PROLOGUE(devices,,)
{
/* link in devices objects, which are tied to the init ones;
* the objects are thus sorted the same way as their init
* object parent see include/device.h
*/
__device_start = .;
CREATE_OBJ_LEVEL(device, PRE_KERNEL_1)
CREATE_OBJ_LEVEL(device, PRE_KERNEL_2)
CREATE_OBJ_LEVEL(device, POST_KERNEL)
CREATE_OBJ_LEVEL(device, APPLICATION)
CREATE_OBJ_LEVEL(device, SMP)
__device_end = .;
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#if CONFIG_PM_DEVICE
SECTION_DATA_PROLOGUE(pm_device_slots, (NOLOAD),)
{

View file

@ -17,6 +17,21 @@
__init_end = .;
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
SECTION_PROLOGUE(devices,,)
{
/* Link in devices objects, which are tied to the init ones;
* the objects are thus sorted the same way as their init
* object parent. See above and include/device.h.
*/
__device_start = .;
CREATE_OBJ_LEVEL(device, PRE_KERNEL_1)
CREATE_OBJ_LEVEL(device, PRE_KERNEL_2)
CREATE_OBJ_LEVEL(device, POST_KERNEL)
CREATE_OBJ_LEVEL(device, APPLICATION)
CREATE_OBJ_LEVEL(device, SMP)
__device_end = .;
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
SECTION_PROLOGUE(sw_isr_table,,)
{