uniform code writing-disable interrupt

This commit is contained in:
thewon86
2022-04-20 14:22:43 +08:00
committed by guo
parent 5fa15a19a0
commit f5b0bfd3f4
47 changed files with 293 additions and 290 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
register rt_int32_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -240,7 +240,7 @@ void rt_hw_mmu_init(void)
int rt_hw_mmu_map(unsigned long addr, unsigned long size, unsigned long attr)
{
int ret;
rt_ubase_t level;
rt_base_t level;
level = rt_hw_interrupt_disable();
ret = rt_hw_mmu_setmtt(addr, addr + size, addr, attr);
+1 -1
View File
@@ -151,7 +151,7 @@ rt_base_t rt_hw_cpu_dcache_status()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -163,7 +163,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -164,7 +164,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -65,7 +65,7 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -162,7 +162,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -20,7 +20,7 @@
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -173,7 +173,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+6 -4
View File
@@ -11,7 +11,7 @@
#include <rtthread.h>
#include <sep4020.h>
extern rt_uint32_t rt_hw_interrupt_disable(void);
extern rt_base_t rt_hw_interrupt_disable(void);
//TODO
#warning I DON'T KNOW IF THE MMU OPERATION WORKS ON SEP4020
@@ -175,12 +175,14 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t UNUSED level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
RT_ASSERT(RT_NULL);
while (level)
{
RT_ASSERT(RT_NULL);
}
}
/*@}*/
+1 -1
View File
@@ -25,7 +25,7 @@ void rt_hw_cpu_reset()
*/
void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -61,7 +61,7 @@ const char *exception_name[] = {
rt_base_t rt_hw_interrupt_disable(void)
{
rt_base_t status = read_c0_status();
register rt_base_t status = read_c0_status();
clear_c0_status(ST0_IE);
return status;
}
+2 -1
View File
@@ -803,7 +803,8 @@ void *rt_hw_mmu_v2p(rt_mmu_info *mmu_info, void* v_addr)
}
#ifdef RT_USING_USERSPACE
void init_mm_setup(unsigned int *mtbl, unsigned int size, unsigned int pv_off) {
void init_mm_setup(unsigned int *mtbl, unsigned int size, unsigned int pv_off)
{
unsigned int va;
for (va = 0; va < 0x1000; va++) {
+3 -3
View File
@@ -77,7 +77,7 @@ void uic_interrupt(rt_uint32_t uic_base, int vec_base)
rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handler,
void* param, const char* name)
{
int intVal;
rt_base_t level;
rt_isr_handler_t old_handler;
if (((int)vector < 0) || ((int) vector >= MAX_HANDLERS))
@@ -86,13 +86,13 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t new_handle
}
/* install the handler in the system interrupt table */
intVal = rt_hw_interrupt_disable (); /* lock interrupts to prevent races */
level = rt_hw_interrupt_disable(); /* lock interrupts to prevent races */
old_handler = isr_table[vector].handler;
isr_table[vector].handler = new_handler;
isr_table[vector].param = param;
rt_hw_interrupt_enable (intVal);
rt_hw_interrupt_enable(level);
}
void rt_hw_interrupt_mask(int vector)
+2 -2
View File
@@ -151,7 +151,7 @@ void sw_clearpend(void)
*/
rt_base_t rt_hw_interrupt_disable(void)
{
rt_base_t value = 0;
register rt_base_t value = 0;
asm("csrrw %0, mstatus, %1":"=r"(value):"r"(0x1800));
return value;
}
@@ -188,7 +188,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
/* shutdown CPU */
void rt_hw_cpu_shutdown(void)
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -153,7 +153,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_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -152,7 +152,7 @@ void rt_hw_context_switch(rt_ubase_t from, rt_ubase_t to)
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -137,7 +137,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
/** shutdown CPU */
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -102,7 +102,7 @@ void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to)
/** shutdown CPU */
void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();
+1 -1
View File
@@ -262,7 +262,7 @@ RT_WEAK void rt_hw_cpu_reset()
*/
RT_WEAK void rt_hw_cpu_shutdown()
{
rt_uint32_t level;
rt_base_t level;
rt_kprintf("shutdown...\n");
level = rt_hw_interrupt_disable();