[rtdef] use lower-case to define attributes (#6728)

* [rtdef] rename RT_WEAK attribute as rt_weak

* [rtdef] rename RT_USED attribute as rt_used

* [rtdef] rename RT_SECTION attribute as rt_section

* [rtdef] rename ALIGN attribute as rt_align

* [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
This commit is contained in:
Man, Jianting (Meco)
2022-12-11 13:12:03 -05:00
committed by GitHub
parent a4b8762d85
commit 99bdf978d7
178 changed files with 472 additions and 462 deletions
+2 -2
View File
@@ -17,7 +17,7 @@
#ifdef RT_USING_SMP
/* The more common mpidr_el1 table, redefine it in BSP if it is in other cases */
RT_WEAK rt_uint64_t rt_cpu_mpidr_early[] =
rt_weak rt_uint64_t rt_cpu_mpidr_early[] =
{
[0] = 0x80000000,
[1] = 0x80000001,
@@ -96,7 +96,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/*@{*/
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
register rt_int32_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -32,7 +32,7 @@ struct init_stack_frame {
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
}
+2 -2
View File
@@ -20,7 +20,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -28,7 +28,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -20,7 +20,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -28,7 +28,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -182,7 +182,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -156,7 +156,7 @@ void mmu_setmtt(rt_uint32_t vaddrStart, rt_uint32_t vaddrEnd, rt_uint32_t paddrS
}
/* set page table */
RT_WEAK void mmu_setmtts(void)
rt_weak void mmu_setmtts(void)
{
mmu_setmtt(0x00000000, 0xFFFFFFFF, 0x00000000, RW_NCNB); /* None cached for 4G memory */
mmu_setmtt(0x80200000, 0x80800000 - 1, 0x80200000, RW_CB); /* 126M cached DDR memory */
+2 -2
View File
@@ -146,7 +146,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
rt_kprintf("Restarting system...\n");
@@ -161,7 +161,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -11,14 +11,14 @@
#include <rthw.h>
#include <rtthread.h>
RT_WEAK void machine_reset(void)
rt_weak void machine_reset(void)
{
rt_kprintf("reboot system...\n");
rt_hw_interrupt_disable();
while (1);
}
RT_WEAK void machine_shutdown(void)
rt_weak void machine_shutdown(void)
{
rt_kprintf("shutdown...\n");
rt_hw_interrupt_disable();
+2 -2
View File
@@ -147,7 +147,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
rt_kprintf("Restarting system...\n");
@@ -162,7 +162,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -421,13 +421,13 @@ void mmu_invalidate_dcache_all()
#endif
/* level1 page table */
static volatile unsigned int _pgd_table[4*1024] ALIGN(16*1024);
static volatile unsigned int _pgd_table[4*1024] rt_align(16*1024);
/*
* level2 page table
* RT_MMU_PTE_SIZE must be 1024*n
*/
#define RT_MMU_PTE_SIZE 4096
static volatile unsigned int _pte_table[RT_MMU_PTE_SIZE] ALIGN(1*1024);
static volatile unsigned int _pte_table[RT_MMU_PTE_SIZE] rt_align(1*1024);
void mmu_create_pgd(struct mem_desc *mdesc)
{
+1 -1
View File
@@ -74,7 +74,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/*@{*/
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -42,12 +42,12 @@ static unsigned int _gic_max_irq;
* PE within a cluster with an Affinity 0 value equal to the bit number.
* @return {rt_uint32_t} 0 is finish , 1 is data valid
*/
RT_WEAK rt_uint32_t arm_gic_cpumask_to_affval(rt_uint32_t *cpu_mask, rt_uint32_t *cluster_id, rt_uint32_t *target_list)
rt_weak rt_uint32_t arm_gic_cpumask_to_affval(rt_uint32_t *cpu_mask, rt_uint32_t *cluster_id, rt_uint32_t *target_list)
{
return 0;
}
RT_WEAK rt_uint64_t get_main_cpu_affval(void)
rt_weak rt_uint64_t get_main_cpu_affval(void)
{
return 0;
}
+1 -1
View File
@@ -131,7 +131,7 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;//((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |SCB_AIRCR_SYSRESETREQ_Msk);
}
+1 -1
View File
@@ -132,7 +132,7 @@ void rt_hw_hard_fault_exception(struct exception_stack_frame *contex)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;//((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |SCB_AIRCR_SYSRESETREQ_Msk);
}
+2 -2
View File
@@ -346,7 +346,7 @@ void rt_hw_hard_fault_exception(struct exception_info * exception_info)
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
@@ -356,7 +356,7 @@ RT_WEAK void rt_hw_cpu_shutdown(void)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;
}
+2 -2
View File
@@ -488,7 +488,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
@@ -498,7 +498,7 @@ RT_WEAK void rt_hw_cpu_shutdown(void)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;
}
+2 -2
View File
@@ -431,7 +431,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
@@ -441,7 +441,7 @@ RT_WEAK void rt_hw_cpu_shutdown(void)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;
}
+2 -2
View File
@@ -430,7 +430,7 @@ void rt_hw_hard_fault_exception(struct exception_info *exception_info)
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
@@ -440,7 +440,7 @@ RT_WEAK void rt_hw_cpu_shutdown(void)
/**
* reset CPU
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
SCB_AIRCR = SCB_RESET_VALUE;
}
+2 -2
View File
@@ -20,7 +20,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -28,7 +28,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -145,7 +145,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
rt_kprintf("Restarting system...\n");
@@ -160,7 +160,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -421,12 +421,12 @@ void mmu_invalidate_dcache_all()
#endif
/* level1 page table */
static volatile unsigned int _pgd_table[4*1024] ALIGN(16*1024);
static volatile unsigned int _pgd_table[4*1024] rt_align(16*1024);
/*
* level2 page table
* RT_MMU_PTE_SIZE must be 1024*n
*/
static volatile unsigned int _pte_table[RT_MMU_PTE_SIZE] ALIGN(1*1024);
static volatile unsigned int _pte_table[RT_MMU_PTE_SIZE] rt_align(1*1024);
void mmu_create_pgd(struct mem_desc *mdesc)
{
+2 -2
View File
@@ -163,7 +163,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
}
@@ -171,7 +171,7 @@ RT_WEAK void rt_hw_cpu_reset(void)
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -20,7 +20,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -28,7 +28,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -18,7 +18,7 @@
/*@{*/
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+3 -3
View File
@@ -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 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");
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);
+2 -2
View File
@@ -148,7 +148,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
/* Disable all interrupt except the WDT */
INTMSK = (~((rt_uint32_t)1 << INTWDT));
@@ -171,7 +171,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -100,7 +100,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -108,7 +108,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -152,7 +152,7 @@ rt_base_t rt_hw_cpu_dcache_status()
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
/* enable watchdog */
@@ -173,7 +173,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -19,7 +19,7 @@
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
/*NOTREACHED*/
}
+2 -2
View File
@@ -23,7 +23,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset(void)
rt_weak void rt_hw_cpu_reset(void)
{
/* open the watch-dog */
WDT_EN = 0x01; /* watch dog enable */
@@ -38,7 +38,7 @@ RT_WEAK void rt_hw_cpu_reset(void)
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -138,7 +138,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
* #endif
*/
#ifndef RT_USING_SMP
RT_WEAK void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t from_thread, rt_thread_t to_thread)
rt_weak void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_thread_t from_thread, rt_thread_t to_thread)
{
if (rt_thread_switch_interrupt_flag == 0)
rt_interrupt_from_thread = from;
@@ -151,7 +151,7 @@ RT_WEAK void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to, rt_t
#endif /* end of RT_USING_SMP */
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -77,7 +77,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
}
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -176,7 +176,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
return old_handler;
}
RT_WEAK
rt_weak
void plic_irq_handle(plic_irq_t irq)
{
rt_kprintf("UN-handled interrupt %d occurred!!!\n", irq);
+1 -1
View File
@@ -150,7 +150,7 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
* @brief shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -135,7 +135,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
}
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -179,7 +179,7 @@ void rt_hw_context_switch_interrupt(rt_uint32_t from, rt_uint32_t to)
*
* @author LXZ (2014/11/8)
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -251,7 +251,7 @@ int entry(void)
#ifndef RT_USING_HEAP
/* if there is not enable heap, we should use static thread and stack. */
ALIGN(8)
rt_align(8)
static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE];
struct rt_thread main_thread;
#endif
+1 -1
View File
@@ -157,7 +157,7 @@ int __rt_ffs(int value)
/**
* shutdown CPU
*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
+1 -1
View File
@@ -19,7 +19,7 @@
* None
* RETURNED VALUE: None
-----------------------------------------------------------------------------*/
RT_WEAK void rt_hw_cpu_shutdown(void)
rt_weak void rt_hw_cpu_shutdown(void)
{
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -245,7 +245,7 @@ static void sep6200_poweroff(void)
* reset cpu by dog's time-out
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
rt_kprintf("Soft reset, Restarting system...\n");
@@ -260,7 +260,7 @@ RT_WEAK void rt_hw_cpu_reset()
* shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_base_t level;
rt_kprintf("shutdown...\n");
+2 -2
View File
@@ -14,7 +14,7 @@
* this function will reset CPU
*
*/
RT_WEAK void rt_hw_cpu_reset()
rt_weak void rt_hw_cpu_reset()
{
}
@@ -22,7 +22,7 @@ RT_WEAK void rt_hw_cpu_reset()
* this function will shutdown CPU
*
*/
RT_WEAK void rt_hw_cpu_shutdown()
rt_weak void rt_hw_cpu_shutdown()
{
rt_kprintf("shutdown...\n");