diff --git a/bsp/dm365/applications/board.c b/bsp/dm365/applications/board.c index 0ed0b6ff64..53b45c875e 100644 --- a/bsp/dm365/applications/board.c +++ b/bsp/dm365/applications/board.c @@ -41,7 +41,7 @@ rt_uint8_t _fiq_stack_start[1024]; rt_uint8_t _undefined_stack_start[512]; rt_uint8_t _abort_stack_start[512]; - rt_uint8_t _svc_stack_start[1024] SECTION(".nobss"); + rt_uint8_t _svc_stack_start[1024] RT_SECTION(".nobss"); extern unsigned char __bss_start; extern unsigned char __bss_end; #endif diff --git a/bsp/fh8620/platform/fh8620/iot_cam/startup.c b/bsp/fh8620/platform/fh8620/iot_cam/startup.c index 6f5cd6defa..ebadf0677b 100644 --- a/bsp/fh8620/platform/fh8620/iot_cam/startup.c +++ b/bsp/fh8620/platform/fh8620/iot_cam/startup.c @@ -63,7 +63,7 @@ rt_uint8_t _irq_stack_start[1024]; rt_uint8_t _fiq_stack_start[1024]; rt_uint8_t _undefined_stack_start[512]; rt_uint8_t _abort_stack_start[512]; -rt_uint8_t _svc_stack_start[4096] SECTION(".nobss"); +rt_uint8_t _svc_stack_start[4096] RT_SECTION(".nobss"); extern unsigned char __bss_start; extern unsigned char __bss_end; diff --git a/bsp/imxrt/libraries/drivers/drv_lcd.c b/bsp/imxrt/libraries/drivers/drv_lcd.c index 4766eb9534..3d2ca8a055 100644 --- a/bsp/imxrt/libraries/drivers/drv_lcd.c +++ b/bsp/imxrt/libraries/drivers/drv_lcd.c @@ -46,7 +46,7 @@ struct imxrt_lcd }; static struct imxrt_lcd lcd; -ALIGN(64) static uint16_t frame_buffer[LCD_HEIGHT][LCD_WIDTH] SECTION("NonCacheable"); +ALIGN(64) static uint16_t frame_buffer[LCD_HEIGHT][LCD_WIDTH] RT_SECTION("NonCacheable"); static rt_err_t imxrt_lcd_init(rt_device_t device) { diff --git a/bsp/imxrt/libraries/drivers/drv_sdio.c b/bsp/imxrt/libraries/drivers/drv_sdio.c index a620bf65dd..5683154410 100644 --- a/bsp/imxrt/libraries/drivers/drv_sdio.c +++ b/bsp/imxrt/libraries/drivers/drv_sdio.c @@ -61,7 +61,7 @@ static int enable_log = 1; /* Endian mode. */ #define USDHC_ENDIAN_MODE kUSDHC_EndianModeLittle -ALIGN(USDHC_ADMA2_ADDR_ALIGN) uint32_t g_usdhcAdma2Table[USDHC_ADMA_TABLE_WORDS] SECTION("NonCacheable"); +ALIGN(USDHC_ADMA2_ADDR_ALIGN) uint32_t g_usdhcAdma2Table[USDHC_ADMA_TABLE_WORDS] RT_SECTION("NonCacheable"); struct imxrt_mmcsd { diff --git a/bsp/lpc43xx/M0/applications/vbus_drv.c b/bsp/lpc43xx/M0/applications/vbus_drv.c index 88d5321b30..696535247f 100644 --- a/bsp/lpc43xx/M0/applications/vbus_drv.c +++ b/bsp/lpc43xx/M0/applications/vbus_drv.c @@ -14,7 +14,7 @@ #include #include -struct rt_vbus_ring rt_vbus_rings[2] SECTION("vbus_ring"); +struct rt_vbus_ring rt_vbus_rings[2] RT_SECTION("vbus_ring"); int rt_vbus_do_init(void) { diff --git a/bsp/lpc43xx/M4/applications/application.c b/bsp/lpc43xx/M4/applications/application.c index 1c31c9da73..8fb1a4ae83 100644 --- a/bsp/lpc43xx/M4/applications/application.c +++ b/bsp/lpc43xx/M4/applications/application.c @@ -22,7 +22,7 @@ #include #endif -static const unsigned char _M0_CODE[] SECTION("M0_CODE") = { +static const unsigned char _M0_CODE[] RT_SECTION("M0_CODE") = { #include "M0_CODE.h" }; diff --git a/bsp/lpc43xx/M4/applications/vbus_drv.c b/bsp/lpc43xx/M4/applications/vbus_drv.c index bd3ae03adb..09fd2373c4 100644 --- a/bsp/lpc43xx/M4/applications/vbus_drv.c +++ b/bsp/lpc43xx/M4/applications/vbus_drv.c @@ -14,7 +14,7 @@ #include #include -struct rt_vbus_ring rt_vbus_rings[2] SECTION("vbus_ring"); +struct rt_vbus_ring rt_vbus_rings[2] RT_SECTION("vbus_ring"); int rt_vbus_do_init(void) { diff --git a/bsp/lpc43xx/drivers/drv_emac.c b/bsp/lpc43xx/drivers/drv_emac.c index d1f02af768..b8875c340c 100644 --- a/bsp/lpc43xx/drivers/drv_emac.c +++ b/bsp/lpc43xx/drivers/drv_emac.c @@ -20,7 +20,7 @@ #define EMAC_PHY_100MBIT 2 #define MAX_ADDR_LEN 6 -static rt_uint32_t ETH_RAM_BASE[4 * 1024] SECTION("ETH_RAM"); +static rt_uint32_t ETH_RAM_BASE[4 * 1024] RT_SECTION("ETH_RAM"); /* EMAC variables located in 16K Ethernet SRAM */ #define RX_DESC_BASE (uint32_t)Ð_RAM_BASE[0] diff --git a/bsp/mini2440/drivers/board.c b/bsp/mini2440/drivers/board.c index 48df4a3e87..afe190e1cf 100644 --- a/bsp/mini2440/drivers/board.c +++ b/bsp/mini2440/drivers/board.c @@ -35,7 +35,7 @@ rt_uint8_t _fiq_stack_start[1024]; rt_uint8_t _undefined_stack_start[512]; rt_uint8_t _abort_stack_start[512]; - rt_uint8_t _svc_stack_start[4096] SECTION(".nobss"); + rt_uint8_t _svc_stack_start[4096] RT_SECTION(".nobss"); #endif #if defined(__CC_ARM) diff --git a/bsp/sep6200/application/startup.c b/bsp/sep6200/application/startup.c index e714675699..78b9c30c5f 100644 --- a/bsp/sep6200/application/startup.c +++ b/bsp/sep6200/application/startup.c @@ -42,7 +42,7 @@ rt_uint8_t _irq_stack_start[1024]; rt_uint8_t _fiq_stack_start[1024]; rt_uint8_t _undefined_stack_start[512]; rt_uint8_t _abort_stack_start[512]; -rt_uint8_t _priv_stack_start[4096]; SECTION(".nobss"); +rt_uint8_t _priv_stack_start[4096]; RT_SECTION(".nobss"); extern unsigned char __bss_start; extern unsigned char __bss_end; diff --git a/components/finsh/finsh_api.h b/components/finsh/finsh_api.h index c601415d82..db2c175cb5 100644 --- a/components/finsh/finsh_api.h +++ b/components/finsh/finsh_api.h @@ -90,9 +90,9 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name); #else #define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \ - const char __fsym_##cmd##_name[] SECTION(".rodata.name") = #cmd; \ - const char __fsym_##cmd##_desc[] SECTION(".rodata.name") = #desc; \ - RT_USED const struct finsh_syscall __fsym_##cmd SECTION("FSymTab")= \ + const char __fsym_##cmd##_name[] RT_SECTION(".rodata.name") = #cmd; \ + const char __fsym_##cmd##_desc[] RT_SECTION(".rodata.name") = #desc; \ + RT_USED const struct finsh_syscall __fsym_##cmd RT_SECTION("FSymTab")= \ { \ __fsym_##cmd##_name, \ __fsym_##cmd##_desc, \ @@ -100,9 +100,9 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name); }; #define FINSH_VAR_EXPORT(name, type, desc) \ - const char __vsym_##name##_name[] SECTION(".rodata.name") = #name; \ - const char __vsym_##name##_desc[] SECTION(".rodata.name") = #desc; \ - RT_USED const struct finsh_sysvar __vsym_##name SECTION("VSymTab")= \ + const char __vsym_##name##_name[] RT_SECTION(".rodata.name") = #name; \ + const char __vsym_##name##_desc[] RT_SECTION(".rodata.name") = #desc; \ + RT_USED const struct finsh_sysvar __vsym_##name RT_SECTION("VSymTab")= \ { \ __vsym_##name##_name, \ __vsym_##name##_desc, \ @@ -155,7 +155,7 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name); #else #define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \ const char __fsym_##cmd##_name[] = #cmd; \ - RT_USED const struct finsh_syscall __fsym_##cmd SECTION("FSymTab")= \ + RT_USED const struct finsh_syscall __fsym_##cmd RT_SECTION("FSymTab")= \ { \ __fsym_##cmd##_name, \ (syscall_func)&name \ @@ -163,7 +163,7 @@ struct finsh_syscall* finsh_syscall_lookup(const char* name); #define FINSH_VAR_EXPORT(name, type, desc) \ const char __vsym_##name##_name[] = #name; \ - RT_USED const struct finsh_sysvar __vsym_##name SECTION("VSymTab")= \ + RT_USED const struct finsh_sysvar __vsym_##name RT_SECTION("VSymTab")= \ { \ __vsym_##name##_name, \ type, \ diff --git a/components/net/at/include/at.h b/components/net/at/include/at.h index 2d0e270f6a..7be821c21d 100644 --- a/components/net/at/include/at.h +++ b/components/net/at/include/at.h @@ -50,7 +50,7 @@ extern "C" { #endif #define AT_CMD_EXPORT(_name_, _args_expr_, _test_, _query_, _setup_, _exec_) \ - RT_USED static const struct at_cmd __at_cmd_##_test_##_query_##_setup_##_exec_ SECTION("RtAtCmdTab") = \ + RT_USED static const struct at_cmd __at_cmd_##_test_##_query_##_setup_##_exec_ RT_SECTION("RtAtCmdTab") = \ { \ _name_, \ _args_expr_, \ diff --git a/components/utilities/utest/utest.h b/components/utilities/utest/utest.h index 8d83fa3184..e2d72a931d 100644 --- a/components/utilities/utest/utest.h +++ b/components/utilities/utest/utest.h @@ -138,7 +138,7 @@ utest_t utest_handle_get(void); */ #define UTEST_TC_EXPORT(testcase, name, init, cleanup, timeout) \ RT_USED static const struct utest_tc_export _utest_testcase \ - SECTION("UtestTcTab") = \ + RT_SECTION("UtestTcTab") = \ { \ name, \ timeout, \ diff --git a/components/vmm/vmm.c b/components/vmm/vmm.c index 7d6f9875db..2bca67376c 100644 --- a/components/vmm/vmm.c +++ b/components/vmm/vmm.c @@ -22,9 +22,9 @@ extern void rt_hw_interrupt_init(void); extern void rt_application_init(void); -void vmm_entry(struct vmm_entry_param* param) SECTION(".vmm_init"); +void vmm_entry(struct vmm_entry_param* param) RT_SECTION(".vmm_init"); -struct rt_thread vmm_thread SECTION(".bss.share.vmm"); +struct rt_thread vmm_thread RT_SECTION(".bss.share.vmm"); extern rt_uint8_t vmm_stack_start; extern rt_uint8_t vmm_stack_end; @@ -75,7 +75,7 @@ static void vmm_entry_glue(rt_uint32_t level, unsigned int kernel_domain) /* inline would make the section setting meaningless */ __attribute__((noinline)) - SECTION(".vmm_glue"); + RT_SECTION(".vmm_glue"); static void vmm_entry_glue(rt_uint32_t level, unsigned int vmm_domain, unsigned int kernel_domain) diff --git a/components/vmm/vmm_context.c b/components/vmm/vmm_context.c index 91641a483a..2e3b95f825 100644 --- a/components/vmm/vmm_context.c +++ b/components/vmm/vmm_context.c @@ -18,7 +18,7 @@ #include "vmm_context.h" -struct rt_vmm_share_layout rt_vmm_share SECTION(".vmm.share"); +struct rt_vmm_share_layout rt_vmm_share RT_SECTION(".vmm.share"); volatile struct vmm_context *_vmm_context = RT_NULL; @@ -31,13 +31,13 @@ void vmm_context_init(void *context_addr) } #ifdef RT_VMM_USING_DOMAIN -unsigned long guest_domain_val SECTION(".bss.share"); -unsigned long vmm_domain_val SECTION(".bss.share"); +unsigned long guest_domain_val RT_SECTION(".bss.share"); +unsigned long vmm_domain_val RT_SECTION(".bss.share"); /* some RT-Thread code need to be called in the guest * context(rt_thread_idle_excute for example). To simplify the code, we need a * "super" domain mode to have access of both side. The code executed in super * domain mode is restricted and should be harmless. */ -unsigned long super_domain_val SECTION(".bss.share"); +unsigned long super_domain_val RT_SECTION(".bss.share"); void vmm_context_init_domain(struct vmm_domain *domain) { asm volatile ("mrc p15, 0, %0, c3, c0\n" : "=r" (guest_domain_val)); diff --git a/include/rtdef.h b/include/rtdef.h index 1226b43020..0256601949 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -117,7 +117,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ /* Compiler Related Definitions */ #if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */ #include - #define SECTION(x) __attribute__((section(x))) + #define RT_SECTION(x) __attribute__((section(x))) #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) @@ -133,7 +133,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #elif defined (__IAR_SYSTEMS_ICC__) /* for IAR Compiler */ #include - #define SECTION(x) @ x + #define RT_SECTION(x) @ x #define RT_UNUSED #define RT_USED __root #define PRAGMA(x) _Pragma(#x) @@ -154,7 +154,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define va_arg(v,l) __builtin_va_arg(v,l) #endif - #define SECTION(x) __attribute__((section(x))) + #define RT_SECTION(x) __attribute__((section(x))) #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) @@ -163,7 +163,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define RTT_API #elif defined (__ADSPBLACKFIN__) /* for VisualDSP++ Compiler */ #include - #define SECTION(x) __attribute__((section(x))) + #define RT_SECTION(x) __attribute__((section(x))) #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) @@ -172,7 +172,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define RTT_API #elif defined (_MSC_VER) #include - #define SECTION(x) + #define RT_SECTION(x) #define RT_UNUSED #define RT_USED #define ALIGN(n) __declspec(align(n)) @@ -184,7 +184,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ /* The way that TI compiler set section is different from other(at least * GCC and MDK) compilers. See ARM Optimizing C/C++ Compiler 5.9.3 for more * details. */ - #define SECTION(x) + #define RT_SECTION(x) #define RT_UNUSED #define RT_USED #define PRAGMA(x) _Pragma(#x) @@ -195,7 +195,7 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #elif defined (__TASKING__) #include - #define SECTION(x) + #define RT_SECTION(x) #define RT_UNUSED #define RT_USED #define PRAGMA(x) _Pragma(#x) @@ -222,11 +222,11 @@ typedef int (*init_fn_t)(void); }; #define INIT_EXPORT(fn, level) \ const char __rti_##fn##_name[] = #fn; \ - RT_USED const struct rt_init_desc __rt_init_desc_##fn SECTION(".rti_fn." level) = \ + RT_USED const struct rt_init_desc __rt_init_desc_##fn RT_SECTION(".rti_fn." level) = \ { __rti_##fn##_name, fn}; #else #define INIT_EXPORT(fn, level) \ - RT_USED const init_fn_t __rt_init_##fn SECTION(".rti_fn." level) = fn + RT_USED const init_fn_t __rt_init_##fn RT_SECTION(".rti_fn." level) = fn #endif #endif #else diff --git a/include/rtm.h b/include/rtm.h index 7e07a2239c..9da3a6b8b2 100644 --- a/include/rtm.h +++ b/include/rtm.h @@ -28,8 +28,8 @@ __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs #else #define RTM_EXPORT(symbol) \ -const char __rtmsym_##symbol##_name[] SECTION(".rodata.name") = #symbol; \ -const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \ +const char __rtmsym_##symbol##_name[] RT_SECTION(".rodata.name") = #symbol; \ +const struct rt_module_symtab __rtmsym_##symbol RT_SECTION("RTMSymTab")= \ { \ (void *)&symbol, \ __rtmsym_##symbol##_name \ diff --git a/libcpu/arm/realview-a8-vmm/interrupt.c b/libcpu/arm/realview-a8-vmm/interrupt.c index 5ef0bdc460..5fffb4ba36 100644 --- a/libcpu/arm/realview-a8-vmm/interrupt.c +++ b/libcpu/arm/realview-a8-vmm/interrupt.c @@ -26,9 +26,9 @@ extern volatile rt_uint8_t rt_interrupt_nest; struct rt_irq_desc isr_table[MAX_HANDLERS]; /* Those varibles will be accessed in ISR, so we need to share them. */ -rt_uint32_t rt_interrupt_from_thread SECTION(".bss.share.int"); -rt_uint32_t rt_interrupt_to_thread SECTION(".bss.share.int"); -rt_uint32_t rt_thread_switch_interrupt_flag SECTION(".bss.share.int"); +rt_uint32_t rt_interrupt_from_thread RT_SECTION(".bss.share.int"); +rt_uint32_t rt_interrupt_to_thread RT_SECTION(".bss.share.int"); +rt_uint32_t rt_thread_switch_interrupt_flag RT_SECTION(".bss.share.int"); const unsigned int VECTOR_BASE = 0x00; extern void rt_cpu_vector_set_base(unsigned int addr); diff --git a/libcpu/arm/zynq7000/mmu.c b/libcpu/arm/zynq7000/mmu.c index fbdacca10f..8674f9f60f 100644 --- a/libcpu/arm/zynq7000/mmu.c +++ b/libcpu/arm/zynq7000/mmu.c @@ -109,7 +109,7 @@ void rt_hw_cpu_dump_page_table(rt_uint32_t *ptb) /* level1 page table, each entry for 1MB memory. */ /* MMUTable is the name used by codes of Xilinx */ -volatile unsigned long MMUTable[4*1024] SECTION("mmu_tbl") __attribute__((aligned(16*1024))); +volatile unsigned long MMUTable[4*1024] RT_SECTION("mmu_tbl") __attribute__((aligned(16*1024))); void rt_hw_mmu_setmtt(rt_uint32_t vaddrStart, rt_uint32_t vaddrEnd, rt_uint32_t paddrStart,