linker: un-abstract some definitions
These made sense before we had the common-rom/common-ram files, as the same boilerplate was repeated for every arch's linker script, but this is no longer necessary. Move these inline for simplicity. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
bed6b6891d
commit
02df2a4f96
3 changed files with 55 additions and 75 deletions
|
@ -13,14 +13,52 @@
|
|||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Space for storing per device busy bitmap. Since we do not know beforehand
|
||||
* the number of devices, we go through the below mechanism to allocate the
|
||||
* required space.
|
||||
*/
|
||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
||||
#define DEVICE_COUNT \
|
||||
((__device_end - __device_start) / _DEVICE_STRUCT_SIZEOF)
|
||||
#define DEV_BUSY_SZ (((DEVICE_COUNT + 31) / 32) * 4)
|
||||
#define DEVICE_BUSY_BITFIELD() \
|
||||
FILL(0x00) ; \
|
||||
__device_busy_start = .; \
|
||||
. = . + DEV_BUSY_SZ; \
|
||||
__device_busy_end = .;
|
||||
#else
|
||||
#define DEVICE_BUSY_BITFIELD()
|
||||
#endif
|
||||
|
||||
SECTION_DATA_PROLOGUE(devices,,)
|
||||
{
|
||||
DEVICE_SECTIONS()
|
||||
/* 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 = .;
|
||||
DEVICE_BUSY_BITFIELD()
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
SECTION_DATA_PROLOGUE(initshell,,)
|
||||
{
|
||||
SHELL_INIT_SECTIONS()
|
||||
/* link in shell initialization objects for all modules that
|
||||
* use shell and their shell commands are automatically
|
||||
* initialized by the kernel.
|
||||
*/
|
||||
__shell_module_start = .;
|
||||
KEEP(*(".shell_module_*"));
|
||||
__shell_module_end = .;
|
||||
__shell_cmd_start = .;
|
||||
KEEP(*(".shell_cmd_*"));
|
||||
__shell_cmd_end = .;
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
SECTION_DATA_PROLOGUE(log_dynamic_sections,,)
|
||||
|
|
|
@ -2,7 +2,19 @@
|
|||
|
||||
SECTION_PROLOGUE(initlevel,,)
|
||||
{
|
||||
INIT_SECTIONS()
|
||||
/*
|
||||
* link in initialization objects for all objects that are
|
||||
* automatically initialized by the kernel; the objects are
|
||||
* sorted in the order they will be initialized (i.e. ordered
|
||||
* by level, sorted by priority within a level)
|
||||
*/
|
||||
__init_start = .;
|
||||
CREATE_OBJ_LEVEL(init, PRE_KERNEL_1)
|
||||
CREATE_OBJ_LEVEL(init, PRE_KERNEL_2)
|
||||
CREATE_OBJ_LEVEL(init, POST_KERNEL)
|
||||
CREATE_OBJ_LEVEL(init, APPLICATION)
|
||||
CREATE_OBJ_LEVEL(init, SMP)
|
||||
__init_end = .;
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
|
||||
#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
|
||||
|
@ -21,7 +33,7 @@
|
|||
/* verify we don't have rogue .init_<something> initlevel sections */
|
||||
SECTION_PROLOGUE(initlevel_error,,)
|
||||
{
|
||||
INIT_UNDEFINED_SECTION()
|
||||
KEEP(*(SORT(.init_[_A-Z0-9]*)))
|
||||
}
|
||||
ASSERT(SIZEOF(initlevel_error) == 0, "Undefined initialization levels used.")
|
||||
|
||||
|
|
|
@ -36,26 +36,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef _LINKER
|
||||
|
||||
|
||||
/*
|
||||
* Space for storing per device busy bitmap. Since we do not know beforehand
|
||||
* the number of devices, we go through the below mechanism to allocate the
|
||||
* required space.
|
||||
*/
|
||||
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
|
||||
#define DEVICE_COUNT \
|
||||
((__device_end - __device_start) / _DEVICE_STRUCT_SIZEOF)
|
||||
#define DEV_BUSY_SZ (((DEVICE_COUNT + 31) / 32) * 4)
|
||||
#define DEVICE_BUSY_BITFIELD() \
|
||||
FILL(0x00) ; \
|
||||
__device_busy_start = .; \
|
||||
. = . + DEV_BUSY_SZ; \
|
||||
__device_busy_end = .;
|
||||
#else
|
||||
#define DEVICE_BUSY_BITFIELD()
|
||||
#endif
|
||||
|
||||
/*
|
||||
* generate a symbol to mark the start of the objects array for
|
||||
* the specified object and level, then link all of those objects
|
||||
|
@ -65,57 +45,7 @@
|
|||
#define CREATE_OBJ_LEVEL(object, level) \
|
||||
__##object##_##level##_start = .; \
|
||||
KEEP(*(SORT(.##object##_##level[0-9]))); \
|
||||
KEEP(*(SORT(.##object##_##level[1-9][0-9]))); \
|
||||
|
||||
/*
|
||||
* link in initialization objects for all objects that are automatically
|
||||
* initialized by the kernel; the objects are sorted in the order they will be
|
||||
* initialized (i.e. ordered by level, sorted by priority within a level)
|
||||
*/
|
||||
|
||||
#define INIT_SECTIONS() \
|
||||
__init_start = .; \
|
||||
CREATE_OBJ_LEVEL(init, PRE_KERNEL_1) \
|
||||
CREATE_OBJ_LEVEL(init, PRE_KERNEL_2) \
|
||||
CREATE_OBJ_LEVEL(init, POST_KERNEL) \
|
||||
CREATE_OBJ_LEVEL(init, APPLICATION) \
|
||||
CREATE_OBJ_LEVEL(init, SMP) \
|
||||
__init_end = .; \
|
||||
|
||||
|
||||
/* define a section for undefined device initialization levels */
|
||||
#define INIT_UNDEFINED_SECTION() \
|
||||
KEEP(*(SORT(.init_[_A-Z0-9]*))) \
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
#define DEVICE_SECTIONS() \
|
||||
__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 = .; \
|
||||
DEVICE_BUSY_BITFIELD() \
|
||||
|
||||
|
||||
/*
|
||||
* link in shell initialization objects for all modules that use shell and
|
||||
* their shell commands are automatically initialized by the kernel.
|
||||
*/
|
||||
|
||||
#define SHELL_INIT_SECTIONS() \
|
||||
__shell_module_start = .; \
|
||||
KEEP(*(".shell_module_*")); \
|
||||
__shell_module_end = .; \
|
||||
__shell_cmd_start = .; \
|
||||
KEEP(*(".shell_cmd_*")); \
|
||||
__shell_cmd_end = .; \
|
||||
KEEP(*(SORT(.##object##_##level[1-9][0-9])));
|
||||
|
||||
/*
|
||||
* link in shell initialization objects for all modules that use shell and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue