1/* SPDX-License-Identifier: Apache-2.0 */
2
3#include <zephyr/linker/iterable_sections.h>
4
5	SECTION_PROLOGUE(initlevel,,)
6	{
7		/*
8		 * link in initialization objects for all objects that are
9		 * automatically initialized by the kernel; the objects are
10		 * sorted in the order they will be initialized (i.e. ordered
11		 * by level, sorted by priority within a level)
12		 */
13		__init_start = .;
14		CREATE_OBJ_LEVEL(init, EARLY)
15		CREATE_OBJ_LEVEL(init, PRE_KERNEL_1)
16		CREATE_OBJ_LEVEL(init, PRE_KERNEL_2)
17		CREATE_OBJ_LEVEL(init, POST_KERNEL)
18		CREATE_OBJ_LEVEL(init, APPLICATION)
19		CREATE_OBJ_LEVEL(init, SMP)
20		__init_end = .;
21	} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
22
23	ITERABLE_SECTION_ROM_NUMERIC(device, 4)
24
25#if defined(CONFIG_GEN_SW_ISR_TABLE) && !defined(CONFIG_DYNAMIC_INTERRUPTS)
26	SECTION_PROLOGUE(sw_isr_table,,)
27	{
28		/*
29		 * Some arch requires an entry to be aligned to arch
30		 * specific boundary for using double word load
31		 * instruction.  See include/sw_isr_table.h.
32		 */
33		. = ALIGN(CONFIG_ARCH_SW_ISR_TABLE_ALIGN);
34		*(_SW_ISR_TABLE_SECTION_SYMS)
35	} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
36
37#if defined(CONFIG_SHARED_INTERRUPTS)
38	SECTION_PROLOGUE(shared_sw_isr_table,,)
39	{
40		/* TODO: does this section require alignment? */
41		KEEP(*(_SHARED_SW_ISR_TABLE_SECTION_SYMS))
42	} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
43#endif
44
45#endif
46
47	/* verify we don't have rogue .z_init_<something> initlevel sections */
48	SECTION_PROLOGUE(initlevel_error,,)
49	{
50		KEEP(*(SORT(.z_init_[_A-Z0-9]*)))
51	}
52	ASSERT(SIZEOF(initlevel_error) == 0, "Undefined initialization levels used.")
53
54#ifdef CONFIG_USERSPACE
55	/* Build-time assignment of permissions to kernel objects to
56	 * threads declared with K_THREAD_DEFINE()
57	 */
58	ITERABLE_SECTION_ROM(z_object_assignment, 4)
59#endif
60
61	SECTION_DATA_PROLOGUE(app_shmem_regions,,)
62	{
63		__app_shmem_regions_start = .;
64		KEEP(*(SORT(.app_regions.*)));
65		__app_shmem_regions_end = .;
66	} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
67
68	ITERABLE_SECTION_ROM(k_p4wq_initparam, 4)
69
70	ITERABLE_SECTION_ROM(_static_thread_data, 4)
71
72#if defined(CONFIG_PCIE)
73	ITERABLE_SECTION_ROM(irq_alloc, 4)
74#endif /* CONFIG_PCIE */
75
76#if !defined(CONFIG_DEVICE_DEPS_DYNAMIC)
77	SECTION_DATA_PROLOGUE(device_deps,,)
78	{
79#include <zephyr/linker/device-deps.ld>
80	} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
81#endif /* !CONFIG_DEVICE_DEPS_DYNAMIC */
82