diff --git a/arch/arm/src/armv6-m/arm_ramvec_initialize.c b/arch/arm/src/armv6-m/arm_ramvec_initialize.c index d694255797d67..1abdffc9f4046 100644 --- a/arch/arm/src/armv6-m/arm_ramvec_initialize.c +++ b/arch/arm/src/armv6-m/arm_ramvec_initialize.c @@ -71,7 +71,7 @@ */ up_vector_t g_ram_vectors[ARMV6M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(RAMVEC_ALIGN); + locate_data(".ram_vectors") aligned_data(RAMVEC_ALIGN); /**************************************************************************** * Public Functions diff --git a/arch/arm/src/armv6-m/arm_vectors.c b/arch/arm/src/armv6-m/arm_vectors.c index b30cd346a5b6d..760c1fca89d96 100644 --- a/arch/arm/src/armv6-m/arm_vectors.c +++ b/arch/arm/src/armv6-m/arm_vectors.c @@ -81,7 +81,7 @@ extern void exception_common(void); * Note that the [ ... ] desginated initialiser is a GCC extension. */ -unsigned _vectors[] __attribute__((section(".vectors"))) = +unsigned _vectors[] locate_data(".vectors") = { /* Initial stack */ diff --git a/arch/arm/src/armv6-m/ram_vectors.h b/arch/arm/src/armv6-m/ram_vectors.h index 28cfc6d0217a1..9bf132b34c677 100644 --- a/arch/arm/src/armv6-m/ram_vectors.h +++ b/arch/arm/src/armv6-m/ram_vectors.h @@ -57,7 +57,7 @@ */ extern up_vector_t g_ram_vectors[ARMV6M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(128); + locate_data(".ram_vectors") aligned_data(128); /**************************************************************************** * Public Function Prototypes diff --git a/arch/arm/src/armv7-m/arm_ramvec_initialize.c b/arch/arm/src/armv7-m/arm_ramvec_initialize.c index a255d26ceada5..d4ba3fcb7f125 100644 --- a/arch/arm/src/armv7-m/arm_ramvec_initialize.c +++ b/arch/arm/src/armv7-m/arm_ramvec_initialize.c @@ -100,7 +100,7 @@ */ up_vector_t g_ram_vectors[ARMV7M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(RAMVEC_ALIGN); + locate_data(".ram_vectors") aligned_data(RAMVEC_ALIGN); /**************************************************************************** * Public Functions diff --git a/arch/arm/src/armv7-m/arm_vectors.c b/arch/arm/src/armv7-m/arm_vectors.c index 248285a5f782c..36bdfb8075efe 100644 --- a/arch/arm/src/armv7-m/arm_vectors.c +++ b/arch/arm/src/armv7-m/arm_vectors.c @@ -76,7 +76,7 @@ extern void exception_common(void); * Note that the [ ... ] designated initializer is a GCC extension. */ -unsigned _vectors[] __attribute__((section(".vectors"))) = +unsigned _vectors[] locate_data(".vectors") = { /* Initial stack */ diff --git a/arch/arm/src/armv7-m/ram_vectors.h b/arch/arm/src/armv7-m/ram_vectors.h index 5031cab5fc5ca..9ed7ae63bcb83 100644 --- a/arch/arm/src/armv7-m/ram_vectors.h +++ b/arch/arm/src/armv7-m/ram_vectors.h @@ -62,7 +62,7 @@ */ extern up_vector_t g_ram_vectors[ARMV7M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(128); + locate_data(".ram_vectors") aligned_data(128); /**************************************************************************** * Public Function Prototypes diff --git a/arch/arm/src/armv8-m/arm_ramvec_initialize.c b/arch/arm/src/armv8-m/arm_ramvec_initialize.c index ab85e769977ee..9d00e9f13fc9b 100644 --- a/arch/arm/src/armv8-m/arm_ramvec_initialize.c +++ b/arch/arm/src/armv8-m/arm_ramvec_initialize.c @@ -99,7 +99,7 @@ */ up_vector_t g_ram_vectors[ARMV8M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(RAMVEC_ALIGN); + locate_data(".ram_vectors") aligned_data(RAMVEC_ALIGN); /**************************************************************************** * Public Functions diff --git a/arch/arm/src/armv8-m/arm_vectors.c b/arch/arm/src/armv8-m/arm_vectors.c index a2fbb1d968d73..4ca24420ee8bb 100644 --- a/arch/arm/src/armv8-m/arm_vectors.c +++ b/arch/arm/src/armv8-m/arm_vectors.c @@ -76,7 +76,7 @@ extern void exception_common(void); * Note that the [ ... ] designated initializer is a GCC extension. */ -unsigned _vectors[] __attribute__((section(".vectors"))) = +unsigned _vectors[] locate_data(".vectors") = { /* Initial stack */ diff --git a/arch/arm/src/armv8-m/ram_vectors.h b/arch/arm/src/armv8-m/ram_vectors.h index 8856567d7d05a..cd61140773613 100644 --- a/arch/arm/src/armv8-m/ram_vectors.h +++ b/arch/arm/src/armv8-m/ram_vectors.h @@ -62,7 +62,7 @@ */ extern up_vector_t g_ram_vectors[ARMV8M_VECTAB_SIZE] - __attribute__ ((section (".ram_vectors"))) aligned_data(128); + locate_data(".ram_vectors") aligned_data(128); /**************************************************************************** * Public Function Prototypes diff --git a/arch/arm/src/kinetis/kinetis_cfmconfig.c b/arch/arm/src/kinetis/kinetis_cfmconfig.c index 0bac66e5da726..402b42b339c59 100644 --- a/arch/arm/src/kinetis/kinetis_cfmconfig.c +++ b/arch/arm/src/kinetis/kinetis_cfmconfig.c @@ -37,7 +37,7 @@ * Public Data ****************************************************************************/ -__attribute__ ((section(".cfmconfig"))) +locate_data(".cfmconfig") const uint8_t __flashconfigbytes[16] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, diff --git a/arch/arm/src/kl/kl_cfmconfig.c b/arch/arm/src/kl/kl_cfmconfig.c index 5fc1f30f50985..5890b358caa5a 100644 --- a/arch/arm/src/kl/kl_cfmconfig.c +++ b/arch/arm/src/kl/kl_cfmconfig.c @@ -32,7 +32,7 @@ * Public Data ****************************************************************************/ -const uint8_t _cfmconfig[16] __attribute__((section(".cfmconfig"))) = +const uint8_t _cfmconfig[16] locate_data(".cfmconfig") = { 0xff, /* NV_BACKKEY3: KEY=0xff */ 0xff, /* NV_BACKKEY2: KEY=0xff */ diff --git a/arch/arm/src/rtl8720c/ameba_vectors.c b/arch/arm/src/rtl8720c/ameba_vectors.c index a68859c38a883..d7d548dfb24ae 100644 --- a/arch/arm/src/rtl8720c/ameba_vectors.c +++ b/arch/arm/src/rtl8720c/ameba_vectors.c @@ -63,7 +63,7 @@ extern void exception_common(void); * Note that the [ ... ] designated initialiser is a GCC extension. */ -unsigned _vectors[] __attribute__((section(".vectors"))) \ +unsigned _vectors[] locate_data(".vectors") \ aligned_data(0x100) = { /* Initial stack */ diff --git a/arch/arm/src/s32k1xx/s32k1xx_flashcfg.c b/arch/arm/src/s32k1xx/s32k1xx_flashcfg.c index a77f4d8e7d360..3d4dd332e9168 100644 --- a/arch/arm/src/s32k1xx/s32k1xx_flashcfg.c +++ b/arch/arm/src/s32k1xx/s32k1xx_flashcfg.c @@ -34,7 +34,7 @@ /* Configured FLASH configuration bytes. NOTE: Little endian assumed. */ -const uint8_t g_flashcfg[16] __attribute__((section(".flashcfg"))) = +const uint8_t g_flashcfg[16] locate_data(".flashcfg") = { (uint8_t)(CONFIG_S32K1XX_FLASHCFG_BACKDOOR1 & 0xff), /* 0x0400 */ (uint8_t)((CONFIG_S32K1XX_FLASHCFG_BACKDOOR1 >> 8) & 0xff), /* 0x0401 */ diff --git a/arch/arm/src/samd2l2/sam_dmac.c b/arch/arm/src/samd2l2/sam_dmac.c index 6569135f57bc1..1fec09bf25568 100644 --- a/arch/arm/src/samd2l2/sam_dmac.c +++ b/arch/arm/src/samd2l2/sam_dmac.c @@ -143,9 +143,9 @@ static struct sam_dmach_s g_dmach[SAMD2L2_NDMACHAN]; */ static struct dma_desc_s g_base_desc[SAMD2L2_NDMACHAN] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); static struct dma_desc_s g_writeback_desc[SAMD2L2_NDMACHAN] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); #if CONFIG_SAMD2L2_DMAC_NDESC > 0 /* Additional DMA descriptors for (optional) multi-block transfer support. @@ -153,7 +153,7 @@ static struct dma_desc_s g_writeback_desc[SAMD2L2_NDMACHAN] */ static struct dma_desc_s g_dma_desc[CONFIG_SAMD2L2_DMAC_NDESC] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); #endif /**************************************************************************** diff --git a/arch/arm/src/samd5e5/sam_dmac.c b/arch/arm/src/samd5e5/sam_dmac.c index 8f156a3de7463..63d6f57da87be 100644 --- a/arch/arm/src/samd5e5/sam_dmac.c +++ b/arch/arm/src/samd5e5/sam_dmac.c @@ -142,9 +142,9 @@ static struct sam_dmach_s g_dmach[SAMD5E5_NDMACHAN]; */ static struct dma_desc_s g_base_desc[SAMD5E5_NDMACHAN] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); static struct dma_desc_s g_writeback_desc[SAMD5E5_NDMACHAN] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); #if CONFIG_SAMD5E5_DMAC_NDESC > 0 /* Additional DMA descriptors for (optional) multi-block transfer support. @@ -152,7 +152,7 @@ static struct dma_desc_s g_writeback_desc[SAMD5E5_NDMACHAN] */ static struct dma_desc_s g_dma_desc[CONFIG_SAMD5E5_DMAC_NDESC] - __attribute__ ((section(".lpram"), aligned(16))); + locate_data(".lpram"), aligned(16); #endif /**************************************************************************** diff --git a/arch/renesas/src/rx65n/rx65n_vector_table.c b/arch/renesas/src/rx65n/rx65n_vector_table.c index 0ce24009068fc..f2b6cc63e2a2e 100644 --- a/arch/renesas/src/rx65n/rx65n_vector_table.c +++ b/arch/renesas/src/rx65n/rx65n_vector_table.c @@ -30,13 +30,13 @@ * Pre-processor Definitions ****************************************************************************/ -#define OFS_REG __attribute__ ((section (".ofs1"))) /* 0xfe7f5d00 */ -#define OFS_TMINF __attribute__ ((section (".ofs2"))) /* 0xfe7f5d10 */ -#define OFS_SPCC __attribute__ ((section (".ofs3"))) /* 0xfe7f5d40 */ -#define OFS_TMEF __attribute__ ((section (".ofs4"))) /* 0xfe7f5d48 */ -#define OFS_OSIS __attribute__ ((section (".ofs5"))) /* 0xfe7f5d50 */ -#define OFS_FAW __attribute__ ((section (".ofs6"))) /* 0xfe7f5d64 */ -#define OFS_ROMCODE __attribute__ ((section (".ofs7"))) /* 0xfe7f5d70 */ +#define OFS_REG locate_data(".ofs1") /* 0xfe7f5d00 */ +#define OFS_TMINF locate_data(".ofs2") /* 0xfe7f5d10 */ +#define OFS_SPCC locate_data(".ofs3") /* 0xfe7f5d40 */ +#define OFS_TMEF locate_data(".ofs4") /* 0xfe7f5d48 */ +#define OFS_OSIS locate_data(".ofs5") /* 0xfe7f5d50 */ +#define OFS_FAW locate_data(".ofs6") /* 0xfe7f5d64 */ +#define OFS_ROMCODE locate_data(".ofs7") /* 0xfe7f5d70 */ /* SPCC register */ @@ -181,7 +181,7 @@ void r_floatingpoint_exception(void) #endif } -#define EXVECT_SECT __attribute__ ((section (".exvectors"))) +#define EXVECT_SECT locate_data(".exvectors") const void *except_vectors[] EXVECT_SECT = { @@ -218,7 +218,7 @@ const void *except_vectors[] EXVECT_SECT = r_nmi_exception /* 0xfffffff8 NMI */ }; -#define FVECT_SECT __attribute__ ((section (".fvectors"))) +#define FVECT_SECT locate_data(".fvectors") extern void _start(void); /* defined in rx65n_head.S */ const void *hardware_vectors[] FVECT_SECT = { @@ -227,7 +227,7 @@ const void *hardware_vectors[] FVECT_SECT = _start /* Power On Reset PC */ }; -#define RVECT_SECT __attribute__ ((section (".rvectors"))) +#define RVECT_SECT locate_data(".rvectors") const void *relocatable_vectors[256] RVECT_SECT = { 0 diff --git a/arch/risc-v/src/bl602/bl602_netdev.c b/arch/risc-v/src/bl602/bl602_netdev.c index 014aae6ffe89f..21ca392c0fe21 100644 --- a/arch/risc-v/src/bl602/bl602_netdev.c +++ b/arch/risc-v/src/bl602/bl602_netdev.c @@ -207,7 +207,7 @@ struct bl602_net_driver_s g_bl602_net[BL602_NET_NINTERFACES]; static struct tx_buf_ind_s g_tx_buf_indicator = BITSET_T_INITIALIZER((1 << BL602_NET_TXBUFF_NUM) - 1); -static uint8_t __attribute__((section(".wifi_ram.txbuff"))) +static uint8_t locate_data(".wifi_ram.txbuff") g_tx_buff[BL602_NET_TXBUFF_NUM][BL602_NET_TXBUFF_SIZE]; static sem_t g_wifi_scan_sem; /* wifi scan complete semaphore */ diff --git a/arch/risc-v/src/bl602/bl602_start.c b/arch/risc-v/src/bl602/bl602_start.c index f037832c2e07f..10288833e5631 100644 --- a/arch/risc-v/src/bl602/bl602_start.c +++ b/arch/risc-v/src/bl602/bl602_start.c @@ -70,7 +70,7 @@ */ uint8_t g_idle_stack[BL602_IDLESTACK_SIZE] - __attribute__((section(".noinit_idle_stack"))); + locate_data(".noinit_idle_stack"); /* Dont change the name of variable, since we refer this * g_boot2_partition_table in linker script @@ -107,7 +107,7 @@ uint32_t __attribute__((no_instrument_function)) boot2_get_flash_addr(void) } #ifdef CONFIG_STACK_OVERFLOW_CHECK -void __attribute__((no_instrument_function, section(".tcm_code"))) +void __attribute__(((no_instrument_function))) locate_code(".tcm_code") __cyg_profile_func_enter(void *this_fn, void *call_site) { register uintptr_t *sp; @@ -149,7 +149,7 @@ __cyg_profile_func_enter(void *this_fn, void *call_site) return; } -void __attribute__((no_instrument_function, section(".tcm_code"))) +void __attribute__((no_instrument_function)) locate_code(".tcm_code") __cyg_profile_func_exit(void *this_fn, void *call_site) { return; diff --git a/arch/risc-v/src/esp32c3/esp32c3_attr.h b/arch/risc-v/src/esp32c3/esp32c3_attr.h index 93122d60fffb4..e0c9818d07aec 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_attr.h +++ b/arch/risc-v/src/esp32c3/esp32c3_attr.h @@ -27,27 +27,27 @@ /* Forces code into IRAM instead of flash */ -#define IRAM_ATTR __attribute__((section(".iram1"))) +#define IRAM_ATTR locate_data(".iram1") /* Forces data into DRAM instead of flash */ -#define DRAM_ATTR __attribute__((section(".dram1"))) +#define DRAM_ATTR locate_data(".dram1") /* Forces code into RTC fast memory */ -#define RTC_IRAM_ATTR __attribute__((section(".rtc.text"))) +#define RTC_IRAM_ATTR locate_data(".rtc.text") /* Forces data into RTC slow memory * Any variable marked with this attribute will keep its value * during a deep sleep / wake cycle. */ -#define RTC_DATA_ATTR __attribute__((section(".rtc.data"))) +#define RTC_DATA_ATTR locate_data(".rtc.data") /* Forces read-only data into RTC slow memory * Makes constant data available to RTC wake stubs. */ -#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata"))) +#define RTC_RODATA_ATTR locate_data(".rtc.rodata") #endif /* __ARCH_RISCV_SRC_ESP32C3_ESP32C3_ATTR_H */ diff --git a/arch/risc-v/src/esp32c3/esp32c3_start.c b/arch/risc-v/src/esp32c3/esp32c3_start.c index 40819f056a949..d83cf82dcfd1a 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_start.c +++ b/arch/risc-v/src/esp32c3/esp32c3_start.c @@ -53,7 +53,7 @@ /* Address of the IDLE thread */ uint8_t g_idlestack[CONFIG_IDLETHREAD_STACKSIZE] - aligned_data(16) __attribute__((section(".noinit"))); + aligned_data(16) locate_data(".noinit"); uint32_t g_idle_topstack = ESP32C3_IDLESTACK_TOP; /**************************************************************************** diff --git a/arch/xtensa/src/common/xtensa_attr.h b/arch/xtensa/src/common/xtensa_attr.h index b44f49c685bd6..473f498b2d97b 100644 --- a/arch/xtensa/src/common/xtensa_attr.h +++ b/arch/xtensa/src/common/xtensa_attr.h @@ -40,33 +40,33 @@ /* Forces code into IRAM instead of flash */ -#define IRAM_ATTR __attribute__((section(".iram1"))) +#define IRAM_ATTR locate_data(".iram1") /* Forces data into DRAM instead of flash */ -#define DRAM_ATTR __attribute__((section(".dram1"))) +#define DRAM_ATTR locate_data(".dram1") /* Forces code into RTC fast memory */ -#define RTC_IRAM_ATTR __attribute__((section(".rtc.text"))) +#define RTC_IRAM_ATTR locate_data(".rtc.text") /* Forces data into RTC slow memory * Any variable marked with this attribute will keep its value * during a deep sleep / wake cycle. */ -#define RTC_DATA_ATTR __attribute__((section(".rtc.data"))) +#define RTC_DATA_ATTR locate_data(".rtc.data") /* Forces read-only data into RTC slow memory * Makes constant data available to RTC wake stubs. */ -#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata"))) +#define RTC_RODATA_ATTR locate_data(".rtc.rodata") /* Allow bss variables into external memory. */ #ifdef CONFIG_XTENSA_EXTMEM_BSS -# define EXT_RAM_ATTR __attribute__((section(".extmem.bss"))) +# define EXT_RAM_ATTR locate_data(".extmem.bss") #else # define EXT_RAM_ATTR #endif diff --git a/arch/xtensa/src/esp32/esp32_cpuidlestack.c b/arch/xtensa/src/esp32/esp32_cpuidlestack.c index d63af81661e95..bd2646ff11e71 100644 --- a/arch/xtensa/src/esp32/esp32_cpuidlestack.c +++ b/arch/xtensa/src/esp32/esp32_cpuidlestack.c @@ -37,7 +37,7 @@ /* Address of the CPU0 IDLE thread */ uint32_t g_cpu1_idlestack[CPU1_IDLETHREAD_STACKWORDS] - aligned_data(16) __attribute__((section(".noinit"))); + aligned_data(16) locate_data(".noinit"); /**************************************************************************** * Public Functions diff --git a/arch/xtensa/src/esp32/esp32_start.c b/arch/xtensa/src/esp32/esp32_start.c index cdef8f122c630..8dcfb3b7f18ea 100644 --- a/arch/xtensa/src/esp32/esp32_start.c +++ b/arch/xtensa/src/esp32/esp32_start.c @@ -59,7 +59,7 @@ /* Address of the CPU0 IDLE thread */ uint32_t g_idlestack[IDLETHREAD_STACKWORDS] - aligned_data(16) __attribute__((section(".noinit"))); + aligned_data(16) locate_data(".noinit"); /**************************************************************************** * Public Functions diff --git a/arch/xtensa/src/esp32s2/esp32s2_start.c b/arch/xtensa/src/esp32s2/esp32s2_start.c index 6d03c2ca8bb26..a6a883a65ab5c 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_start.c +++ b/arch/xtensa/src/esp32s2/esp32s2_start.c @@ -57,7 +57,7 @@ /* Address of the CPU0 IDLE thread */ uint32_t g_idlestack[IDLETHREAD_STACKWORDS] - aligned_data(16) __attribute__((section(".noinit"))); + aligned_data(16) locate_data(".noinit"); /**************************************************************************** * Public Functions diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_boot.c index 9a4c0fc386571..1c0f2e0c7665c 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_boot.c @@ -28,7 +28,7 @@ * Public Data ****************************************************************************/ -__attribute__((section(".boot_hdr.ivt"))) +locate_data(".boot_hdr.ivt") const struct ivt_s g_image_vector_table = { IVT_HEADER, /* IVT Header */ @@ -41,7 +41,7 @@ const struct ivt_s g_image_vector_table = IVT_RSVD /* Reserved = 0 */ }; -__attribute__((section(".boot_hdr.boot_data"))) +locate_data(".boot_hdr.boot_data") const struct boot_data_s g_boot_data = { FLASH_BASE, /* boot start location */ diff --git a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_flash.c index e19673d15049a..21676a9bb85f4 100644 --- a/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1020-evk/src/imxrt_flexspi_nor_flash.c @@ -58,7 +58,7 @@ */ #if defined (CONFIG_IMXRT1020_EVK_HYPER_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = @@ -115,7 +115,7 @@ const struct flexspi_nor_config_s g_flash_config = .is_uniform_blocksize = 1, }; #elif defined (CONFIG_IMXRT1020_EVK_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = diff --git a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c index 0f0ee11130826..3c16652cb5846 100644 --- a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c index d624a849fe3c8..847f5720011dd 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c @@ -28,7 +28,7 @@ * Public Data ****************************************************************************/ -__attribute__((section(".boot_hdr.ivt"))) +locate_data(".boot_hdr.ivt") const struct ivt_s g_image_vector_table = { IVT_HEADER, /* IVT Header */ @@ -41,7 +41,7 @@ const struct ivt_s g_image_vector_table = IVT_RSVD /* Reserved = 0 */ }; -__attribute__((section(".boot_hdr.boot_data"))) +locate_data(".boot_hdr.boot_data") const struct boot_data_s g_boot_data = { FLASH_BASE, /* boot start location */ diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c index 08513589dc8a7..194bc219a2399 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c @@ -29,7 +29,7 @@ ****************************************************************************/ #if defined (CONFIG_IMXRT1050_EVK_HYPER_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = @@ -76,7 +76,7 @@ const struct flexspi_nor_config_s g_flash_config = }; #elif defined (CONFIG_IMXRT1050_EVK_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_sdram_ini_dcd.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_sdram_ini_dcd.c index 12566433ed453..bcffc91d60911 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_sdram_ini_dcd.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_sdram_ini_dcd.c @@ -37,7 +37,7 @@ #include "imxrt_flexspi_nor_boot.h" -__attribute__((section(".boot_hdr.dcd_data"))) +locate_data(".boot_hdr.dcd_data") /**************************************************************************** * Public Data diff --git a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c index e2557c7b35828..501c5d11ea10c 100644 --- a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c index d80573c6772a9..09cec412cbba6 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c @@ -28,7 +28,7 @@ * Public Data ****************************************************************************/ -__attribute__((section(".boot_hdr.ivt"))) +locate_data(".boot_hdr.ivt") const struct ivt_s g_image_vector_table = { IVT_HEADER, /* IVT Header */ @@ -41,7 +41,7 @@ const struct ivt_s g_image_vector_table = IVT_RSVD /* Reserved = 0 */ }; -__attribute__((section(".boot_hdr.boot_data"))) +locate_data(".boot_hdr.boot_data") const struct boot_data_s g_boot_data = { IMAGE_DEST, /* boot start location */ diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c index 801c131b96a51..635b82aff0e65 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c @@ -29,7 +29,7 @@ ****************************************************************************/ #if defined (CONFIG_IMXRT1060_EVK_HYPER_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = @@ -75,7 +75,7 @@ const struct flexspi_nor_config_s g_flash_config = }; #elif defined (CONFIG_IMXRT1060_EVK_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = diff --git a/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c index 9ef183fe029dc..98e6644500a7d 100644 --- a/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/imxrt1064-evk/kernel/imxrt_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c index dfaf0051aafe4..018994d9e46cc 100644 --- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c @@ -28,7 +28,7 @@ * Public Data ****************************************************************************/ -__attribute__((section(".boot_hdr.ivt"))) +locate_data(".boot_hdr.ivt") const struct ivt_s g_image_vector_table = { IVT_HEADER, /* IVT Header */ @@ -41,7 +41,7 @@ const struct ivt_s g_image_vector_table = IVT_RSVD /* Reserved = 0 */ }; -__attribute__((section(".boot_hdr.boot_data"))) +locate_data(".boot_hdr.boot_data") const struct boot_data_s g_boot_data = { IMAGE_DEST, /* boot start location */ diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_flash.c index a72ff4d0cbd23..da1081dfd5272 100644 --- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_flash.c @@ -29,7 +29,7 @@ ****************************************************************************/ #if defined (CONFIG_IMXRT1060_EVK_HYPER_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = @@ -76,7 +76,7 @@ const struct flexspi_nor_config_s g_flash_config = }; #elif defined (CONFIG_IMXRT1064_EVK_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_sdram_ini_dcd.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_sdram_ini_dcd.c index 2aa831a6e8cca..2d0c4114bcfdb 100644 --- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_sdram_ini_dcd.c +++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_sdram_ini_dcd.c @@ -24,7 +24,7 @@ #include "imxrt_flexspi_nor_boot.h" -__attribute__((section(".boot_hdr.dcd_data"))) +locate_data(".boot_hdr.dcd_data") /**************************************************************************** * Public Data diff --git a/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c b/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c index 557da3d9342c5..33682576e990c 100644 --- a/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/teensy-4.x/kernel/imxrt_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c index 8bcf262866b8a..b962e4bf783c0 100644 --- a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c @@ -28,7 +28,7 @@ * Public Data ****************************************************************************/ -__attribute__((section(".boot_hdr.ivt"))) +locate_data(".boot_hdr.ivt") const struct ivt_s g_image_vector_table = { IVT_HEADER, /* IVT Header */ @@ -44,7 +44,7 @@ __attribute__((section(".boot_hdr.ivt"))) IVT_RSVD /* Reserved = 0 */ }; -__attribute__((section(".boot_hdr.boot_data"))) +locate_data(".boot_hdr.boot_data") const struct boot_data_s g_boot_data = { IMAGE_DEST, /* boot start location */ diff --git a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.c index c15367649f2a6..29b32d7ee47c5 100644 --- a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_flash.c @@ -29,7 +29,7 @@ ****************************************************************************/ #if defined (CONFIG_TEENSY4_QSPI_FLASH) -__attribute__((section(".boot_hdr.conf"))) +locate_data(".boot_hdr.conf") const struct flexspi_nor_config_s g_flash_config = { .mem_config = diff --git a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c index 7eedb98bd30d7..007096e52f45a 100644 --- a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c +++ b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c index 2af4c85cfb4df..9e89dedc612eb 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c index 4f5c33cd10457..ee945a8edd27b 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c index 09450eca6b17b..aba01b249c8af 100644 --- a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c index 8a8451c4a34ca..a3f1737789fc2 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c index e59fd01c6f87b..f97def756bdd2 100644 --- a/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c +++ b/boards/arm/lpc43xx/bambino-200e/kernel/lpc43_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c b/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c index da2e8d808abb7..7c61451e5a54e 100644 --- a/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c +++ b/boards/arm/sam34/sam3u-ek/kernel/sam_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c index 2cd40031bc205..f17c3d91d4004 100644 --- a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c +++ b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c index 01be17d1fc163..0fb501658a5e0 100644 --- a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c +++ b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c b/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c index 2a2521c68ac4f..487019395d95f 100644 --- a/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c +++ b/boards/arm/stm32/clicker2-stm32/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c b/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c index 25af38e677b0c..42544c28f95b6 100644 --- a/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c +++ b/boards/arm/stm32/mikroe-stm32f4/kernel/stm32_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c b/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c index efe32d850828d..17974fc4a4314 100644 --- a/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c +++ b/boards/arm/stm32/olimex-stm32-p407/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c b/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c index 08c02ae1a8e01..926bebb0ec472 100644 --- a/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c +++ b/boards/arm/stm32/omnibusf4/kernel/stm32_userspace.c @@ -92,7 +92,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/photon/src/dfu_signature.c b/boards/arm/stm32/photon/src/dfu_signature.c index 83e4786fabb2e..a5bd7d011efd1 100644 --- a/boards/arm/stm32/photon/src/dfu_signature.c +++ b/boards/arm/stm32/photon/src/dfu_signature.c @@ -65,8 +65,8 @@ extern uint32_t _firmware_end; * Private Data ****************************************************************************/ -__attribute__((externally_visible, section(".dfu_signature"))) - const struct dfu_signature dfu_sign = +__attribute__((externally_visible)) locate_data(".dfu_signature") +const struct dfu_signature dfu_sign = { (uint32_t)&_firmware_start, /* Flash image start address */ (uint32_t)&_firmware_end, /* Flash image end address */ diff --git a/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c b/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c index 4eafb03e4ec97..17577128e9a07 100644 --- a/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c +++ b/boards/arm/stm32/stm3240g-eval/kernel/stm32_userspace.c @@ -74,7 +74,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c b/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c index ff60953b5f00d..6fb0dd3a18d48 100644 --- a/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c +++ b/boards/arm/stm32/stm32f4discovery/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c b/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c index 0ee9fa1495809..fe14aa508200d 100644 --- a/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c +++ b/boards/arm/stm32f7/stm32f746g-disco/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c b/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c index f85466e5b5f41..43d54e7de12d7 100644 --- a/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c +++ b/boards/arm/stm32f7/stm32f769i-disco/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c b/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c index 54fb39e051015..a2d81e27985b5 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c +++ b/boards/arm/stm32h7/nucleo-h743zi/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld b/boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld index 59cdb4389b45d..7bf424656da32 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld +++ b/boards/arm/stm32h7/nucleo-h743zi/scripts/flash.ld @@ -172,7 +172,7 @@ SECTIONS /* Emit the the D3 power domain section for locating BDMA data * - * Static data with __attribute__ ((section (".sram4"))) will be located + * Static data with locate_data(".sram4") will be located * at start of SRAM4; the rest of SRAM4 will be added to the heap. */ diff --git a/boards/arm/stm32h7/nucleo-h743zi/scripts/kernel.space.ld b/boards/arm/stm32h7/nucleo-h743zi/scripts/kernel.space.ld index f3437a16f305a..5b39d1139662f 100644 --- a/boards/arm/stm32h7/nucleo-h743zi/scripts/kernel.space.ld +++ b/boards/arm/stm32h7/nucleo-h743zi/scripts/kernel.space.ld @@ -81,7 +81,7 @@ SECTIONS /* Emit the the D3 power domain section for locating BDMA data * - * Static data with __attribute__ ((section (".sram4"))) will be located + * Static data with locate_data(".sram4") will be located * at start of SRAM4; the rest of SRAM4 will be added to the heap. */ diff --git a/boards/arm/stm32h7/nucleo-h743zi2/scripts/flash.ld b/boards/arm/stm32h7/nucleo-h743zi2/scripts/flash.ld index 339cc43ecb1a0..276482189bfa4 100644 --- a/boards/arm/stm32h7/nucleo-h743zi2/scripts/flash.ld +++ b/boards/arm/stm32h7/nucleo-h743zi2/scripts/flash.ld @@ -172,7 +172,7 @@ SECTIONS /* Emit the the D3 power domain section for locating BDMA data * - * Static data with __attribute__ ((section (".sram4"))) will be located + * Static data with locate_data(".sram4") will be located * at start of SRAM4; the rest of SRAM4 will be added to the heap. */ diff --git a/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c b/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c index 4dfafe8a4214e..30a23b8cef2f5 100644 --- a/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c +++ b/boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld b/boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld index 824f6b63a38e5..1bf9a2ce8c2f0 100644 --- a/boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld +++ b/boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld @@ -170,7 +170,7 @@ SECTIONS /* Emit the the D3 power domain section for locating BDMA data * - * Static data with __attribute__ ((section (".sram4"))) will be located + * Static data with locate_data(".sram4") will be located * at start of SRAM4; the rest of SRAM4 will be added to the heap. */ diff --git a/boards/arm/stm32h7/stm32h747i-disco/scripts/kernel.space.ld b/boards/arm/stm32h7/stm32h747i-disco/scripts/kernel.space.ld index 45509b67683f6..e1db7b6727c2b 100644 --- a/boards/arm/stm32h7/stm32h747i-disco/scripts/kernel.space.ld +++ b/boards/arm/stm32h7/stm32h747i-disco/scripts/kernel.space.ld @@ -81,7 +81,7 @@ SECTIONS /* Emit the the D3 power domain section for locating BDMA data * - * Static data with __attribute__ ((section (".sram4"))) will be located + * Static data with locate_data(".sram4") will be located * at start of SRAM4; the rest of SRAM4 will be added to the heap. */ diff --git a/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c b/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c index 548d619a62394..3a29e615872f0 100644 --- a/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c +++ b/boards/arm/stm32l4/stm32l476vg-disco/kernel/stm32l4_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c b/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c index ae474c689f472..a2314de4db62f 100644 --- a/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c +++ b/boards/arm/stm32l4/stm32l4r9ai-disco/kernel/stm32l4_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c b/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c index 1e6ae7bced8bb..32ed0f19ed0b3 100644 --- a/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c +++ b/boards/arm/tiva/lm3s6965-ek/kernel/lm_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c b/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c index 9f24ab1a9d761..ce97d84cd47af 100644 --- a/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c +++ b/boards/risc-v/c906/smartl-c906/kernel/c906_userspace.c @@ -77,7 +77,7 @@ extern uintptr_t *__ld_usram_end; /* End+1 of user ram section */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c b/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c index f7ff8e5dfd6a1..2fd757b0d49af 100644 --- a/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c +++ b/boards/risc-v/k210/maix-bit/kernel/k210_userspace.c @@ -75,7 +75,7 @@ extern uint32_t _ebss; /* End+1 of .bss */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/boards/risc-v/mpfs/icicle/kernel/mpfs_userspace.c b/boards/risc-v/mpfs/icicle/kernel/mpfs_userspace.c index 6fda7b7c8fb0a..106fe32c59957 100755 --- a/boards/risc-v/mpfs/icicle/kernel/mpfs_userspace.c +++ b/boards/risc-v/mpfs/icicle/kernel/mpfs_userspace.c @@ -77,7 +77,7 @@ extern uintptr_t *__ld_usram_end; /* End+1 of user ram section */ int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]); -const struct userspace_s userspace __attribute__ ((section (".userspace"))) = +const struct userspace_s userspace locate_data(".userspace") = { /* General memory map */ diff --git a/include/nuttx/mm/gran.h b/include/nuttx/mm/gran.h index 9528b2870f918..d515a1c3ca056 100644 --- a/include/nuttx/mm/gran.h +++ b/include/nuttx/mm/gran.h @@ -96,7 +96,7 @@ extern "C" * attribute to position a DMA heap in memory (logic in the linker script * would assign the section .dmaheap to the DMA memory. * - * FAR uint32_t g_dmaheap[DMAHEAP_SIZE] __attribute__((section(.dmaheap))); + * FAR uint32_t g_dmaheap[DMAHEAP_SIZE] locate_data(.dmaheap); * * The heap is created by calling gran_initialize. Here the granule size * is set to 64 bytes and the alignment to 16 bytes: diff --git a/mm/README.txt b/mm/README.txt index 5607cbbaa950b..9f70f9747fe4a 100644 --- a/mm/README.txt +++ b/mm/README.txt @@ -144,7 +144,7 @@ This directory contains the NuttX memory management logic. This include: heap in memory (logic in the linker script would assign the section .dmaheap to the DMA memory. - FAR uint32_t g_dmaheap[DMAHEAP_SIZE] __attribute__((section(.dmaheap))); + FAR uint32_t g_dmaheap[DMAHEAP_SIZE] locate_data(.dmaheap); The heap is created by calling gran_initialize. Here the granule size is set to 64 bytes and the alignment to 16 bytes: diff --git a/mm/mm_gran/mm_graninit.c b/mm/mm_gran/mm_graninit.c index a3acb93ccde35..1dd50ae318dc2 100644 --- a/mm/mm_gran/mm_graninit.c +++ b/mm/mm_gran/mm_graninit.c @@ -55,7 +55,7 @@ * attribute to position a DMA heap in memory (logic in the linker script * would assign the section .dmaheap to the DMA memory. * - * FAR uint32_t g_dmaheap[DMAHEAP_SIZE] __attribute__((section(.dmaheap))); + * FAR uint32_t g_dmaheap[DMAHEAP_SIZE] locate_data(.dmaheap); * * The heap is created by calling gran_initialize(). Here the granule size * is set to 64 bytes (2**6) and the alignment to 16 bytes (2**4):