common-ram.ld 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* SPDX-License-Identifier: Apache-2.0 */
  2. #if defined(CONFIG_NETWORKING)
  3. #ifndef NETWORK_RAM_SECTIONS
  4. #define NETWORK_RAM_SECTIONS \
  5. ITERABLE_SECTION_RAM(net_if, 4) \
  6. ITERABLE_SECTION_RAM(net_if_dev, 4) \
  7. ITERABLE_SECTION_RAM(net_l2, 4) \
  8. ITERABLE_SECTION_RAM(eth_bridge, 4)
  9. #endif
  10. #endif /* NETWORKING */
  11. #if defined(CONFIG_GEN_SW_ISR_TABLE) && defined(CONFIG_DYNAMIC_INTERRUPTS)
  12. SECTION_DATA_PROLOGUE(sw_isr_table,,)
  13. {
  14. /*
  15. * Some arch requires an entry to be aligned to arch
  16. * specific boundary for using double word load
  17. * instruction. See include/sw_isr_table.h.
  18. */
  19. . = ALIGN(CONFIG_ARCH_SW_ISR_TABLE_ALIGN);
  20. *(_SW_ISR_TABLE_SECTION_SYMS)
  21. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  22. #endif
  23. SECTION_DATA_PROLOGUE(device_states,,)
  24. {
  25. /* Device states used by the device objects. */
  26. __device_states_start = .;
  27. KEEP(*(".z_devstate"));
  28. KEEP(*(".z_devstate.*"));
  29. __device_states_end = .;
  30. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  31. #if CONFIG_PM_DEVICE
  32. SECTION_DATA_PROLOGUE(pm_device_slots, (NOLOAD),)
  33. {
  34. __pm_device_slots_start = .;
  35. KEEP(*(".z_pm_device_slots"));
  36. __pm_device_slots_end = .;
  37. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  38. #endif
  39. SECTION_DATA_PROLOGUE(initshell,,)
  40. {
  41. /* link in shell initialization objects for all modules that
  42. * use shell and their shell commands are automatically
  43. * initialized by the kernel.
  44. */
  45. __shell_module_start = .;
  46. KEEP(*(".shell_module_*"));
  47. __shell_module_end = .;
  48. __shell_cmd_start = .;
  49. KEEP(*(".shell_cmd_*"));
  50. __shell_cmd_end = .;
  51. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  52. SECTION_DATA_PROLOGUE(log_dynamic_sections,,)
  53. {
  54. __log_dynamic_start = .;
  55. KEEP(*(SORT(.log_dynamic_*)));
  56. __log_dynamic_end = .;
  57. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  58. ITERABLE_SECTION_RAM(_static_thread_data, 4)
  59. #ifdef CONFIG_USERSPACE
  60. /* All kernel objects within are assumed to be either completely
  61. * initialized at build time, or initialized automatically at runtime
  62. * via iteration before the POST_KERNEL phase.
  63. *
  64. * These two symbols only used by gen_kobject_list.py
  65. */
  66. _static_kernel_objects_begin = .;
  67. #endif /* CONFIG_USERSPACE */
  68. ITERABLE_SECTION_RAM_GC_ALLOWED(k_timer, 4)
  69. ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_slab, 4)
  70. ITERABLE_SECTION_RAM_GC_ALLOWED(k_mem_pool, 4)
  71. ITERABLE_SECTION_RAM_GC_ALLOWED(k_heap, 4)
  72. ITERABLE_SECTION_RAM_GC_ALLOWED(k_mutex, 4)
  73. ITERABLE_SECTION_RAM_GC_ALLOWED(k_stack, 4)
  74. ITERABLE_SECTION_RAM_GC_ALLOWED(k_msgq, 4)
  75. ITERABLE_SECTION_RAM_GC_ALLOWED(k_mbox, 4)
  76. ITERABLE_SECTION_RAM_GC_ALLOWED(k_pipe, 4)
  77. ITERABLE_SECTION_RAM_GC_ALLOWED(k_sem, 4)
  78. ITERABLE_SECTION_RAM_GC_ALLOWED(k_queue, 4)
  79. ITERABLE_SECTION_RAM_GC_ALLOWED(k_condvar, 4)
  80. SECTION_DATA_PROLOGUE(_net_buf_pool_area,,SUBALIGN(4))
  81. {
  82. _net_buf_pool_list = .;
  83. KEEP(*(SORT_BY_NAME("._net_buf_pool.static.*")))
  84. _net_buf_pool_list_end = .;
  85. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  86. #if defined(CONFIG_NETWORKING)
  87. NETWORK_RAM_SECTIONS
  88. #endif /* NETWORKING */
  89. #if defined(CONFIG_UART_MUX)
  90. SECTION_DATA_PROLOGUE(uart_mux,,SUBALIGN(4))
  91. {
  92. __uart_mux_start = .;
  93. *(".uart_mux.*")
  94. KEEP(*(SORT_BY_NAME(".uart_mux.*")))
  95. __uart_mux_end = .;
  96. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  97. #endif
  98. #if defined(CONFIG_USB_DEVICE_STACK)
  99. SECTION_DATA_PROLOGUE(usb_descriptor,,SUBALIGN(1))
  100. {
  101. __usb_descriptor_start = .;
  102. *(".usb.descriptor")
  103. KEEP(*(SORT_BY_NAME(".usb.descriptor*")))
  104. __usb_descriptor_end = .;
  105. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  106. SECTION_DATA_PROLOGUE(usb_data,,SUBALIGN(1))
  107. {
  108. __usb_data_start = .;
  109. *(".usb.data")
  110. KEEP(*(SORT_BY_NAME(".usb.data*")))
  111. __usb_data_end = .;
  112. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  113. #endif /* CONFIG_USB_DEVICE_STACK */
  114. #if defined(CONFIG_USB_DEVICE_BOS)
  115. SECTION_DATA_PROLOGUE(usb_bos_desc,,SUBALIGN(1))
  116. {
  117. __usb_bos_desc_start = .;
  118. *(".usb.bos_desc")
  119. KEEP(*(SORT_BY_NAME(".usb.bos_desc*")))
  120. __usb_bos_desc_end = .;
  121. } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
  122. #endif /* CONFIG_USB_DEVICE_BOS */
  123. #ifdef CONFIG_USERSPACE
  124. _static_kernel_objects_end = .;
  125. #endif