diff --git a/bsp/allwinner_tina/libcpu/interrupt.c b/bsp/allwinner_tina/libcpu/interrupt.c index c41b447b5a..f0fddbe12a 100644 --- a/bsp/allwinner_tina/libcpu/interrupt.c +++ b/bsp/allwinner_tina/libcpu/interrupt.c @@ -14,7 +14,7 @@ #include "interrupt.h" -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/bsp/asm9260t/platform/interrupt.c b/bsp/asm9260t/platform/interrupt.c index 76b18bc7a0..fd741de94b 100644 --- a/bsp/asm9260t/platform/interrupt.c +++ b/bsp/asm9260t/platform/interrupt.c @@ -15,7 +15,7 @@ #define MAX_HANDLERS (64) -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; diff --git a/bsp/at91/at91sam9260/platform/interrupt.c b/bsp/at91/at91sam9260/platform/interrupt.c index 60c4d0790b..6ce32cfdff 100644 --- a/bsp/at91/at91sam9260/platform/interrupt.c +++ b/bsp/at91/at91sam9260/platform/interrupt.c @@ -13,7 +13,7 @@ #include "interrupt.h" #define MAX_HANDLERS (AIC_IRQS + PIN_IRQS) -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; diff --git a/bsp/at91/at91sam9g45/platform/interrupt.c b/bsp/at91/at91sam9g45/platform/interrupt.c index c3dd99e798..4ab4bdbb86 100644 --- a/bsp/at91/at91sam9g45/platform/interrupt.c +++ b/bsp/at91/at91sam9g45/platform/interrupt.c @@ -15,7 +15,7 @@ #define AIC_IRQS 32 #define MAX_HANDLERS (AIC_IRQS + PIN_IRQS) -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; diff --git a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c index 3b886ccda0..4a2a36d40b 100644 --- a/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c +++ b/bsp/bluetrum/ab32vg1-ab-prougen/board/board.c @@ -27,7 +27,7 @@ typedef void (*spiflash_init_func)(uint8_t sf_read, uint8_t dummy); static struct rt_mutex mutex_spiflash = {0}; static struct rt_mutex mutex_cache = {0}; -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; extern uint32_t __heap_start, __heap_end; #ifdef RT_USING_CONSOLE diff --git a/bsp/cvitek/c906_little/board/interrupt.c b/bsp/cvitek/c906_little/board/interrupt.c index c3ecfb08a5..9a6625cf25 100755 --- a/bsp/cvitek/c906_little/board/interrupt.c +++ b/bsp/cvitek/c906_little/board/interrupt.c @@ -15,7 +15,7 @@ #include "encoding.h" #include "mmio.h" -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; extern rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/bsp/dm365/platform/interrupt.c b/bsp/dm365/platform/interrupt.c index fb0d4d3d3e..ed601ccf06 100644 --- a/bsp/dm365/platform/interrupt.c +++ b/bsp/dm365/platform/interrupt.c @@ -15,7 +15,7 @@ #define MAX_HANDLERS 64 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; struct rt_irq_desc irq_desc[MAX_HANDLERS]; diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sys.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sys.c index 21937596c5..ed5164455a 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sys.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sys.c @@ -21,7 +21,7 @@ #define INT_IRQ 0x00 #define INT_FIQ 0x01 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c index 7260bd0160..81f59fbd34 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c @@ -21,7 +21,7 @@ #define INT_IRQ 0x00 #define INT_FIQ 0x01 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/bsp/nxp/imx/imx6sx/cortex-a9/cpu/interrupt.c b/bsp/nxp/imx/imx6sx/cortex-a9/cpu/interrupt.c index fb6e3ff3e0..dfd7099b73 100644 --- a/bsp/nxp/imx/imx6sx/cortex-a9/cpu/interrupt.c +++ b/bsp/nxp/imx/imx6sx/cortex-a9/cpu/interrupt.c @@ -20,7 +20,7 @@ #define MAX_HANDLERS IMX_INTERRUPT_COUNT -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/bsp/raspberry-pi/raspi2/cpu/interrupt.c b/bsp/raspberry-pi/raspi2/cpu/interrupt.c index 7a48eaa9fd..a84722f76d 100644 --- a/bsp/raspberry-pi/raspi2/cpu/interrupt.c +++ b/bsp/raspberry-pi/raspi2/cpu/interrupt.c @@ -16,7 +16,7 @@ #define MAX_HANDLERS 64 -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c b/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c index 7a0b9210ec..69222f8320 100644 --- a/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c +++ b/bsp/raspberry-pi/raspi3-32/cpu/interrupt.c @@ -22,7 +22,7 @@ #ifdef RT_USING_SMP #define rt_interrupt_nest rt_cpu_self()->irq_nest #else -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; #endif const unsigned int VECTOR_BASE = 0x00; diff --git a/bsp/ti/c28x/tms320f28379d/board/board.c b/bsp/ti/c28x/tms320f28379d/board/board.c index 18f5b213bf..091dc25293 100644 --- a/bsp/ti/c28x/tms320f28379d/board/board.c +++ b/bsp/ti/c28x/tms320f28379d/board/board.c @@ -17,7 +17,7 @@ #include "F28x_Project.h" #ifndef RT_USING_SMP -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; #endif extern rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/libcpu/arm/AT91SAM7S/interrupt.c b/libcpu/arm/AT91SAM7S/interrupt.c index e4aa8643f1..8468d36413 100644 --- a/libcpu/arm/AT91SAM7S/interrupt.c +++ b/libcpu/arm/AT91SAM7S/interrupt.c @@ -13,7 +13,7 @@ #define MAX_HANDLERS 32 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/libcpu/arm/AT91SAM7X/interrupt.c b/libcpu/arm/AT91SAM7X/interrupt.c index 3a28f507ca..1d473654e2 100644 --- a/libcpu/arm/AT91SAM7X/interrupt.c +++ b/libcpu/arm/AT91SAM7X/interrupt.c @@ -18,7 +18,7 @@ /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/libcpu/arm/am335x/interrupt.c b/libcpu/arm/am335x/interrupt.c index 1810a92a65..ca9fe97c76 100644 --- a/libcpu/arm/am335x/interrupt.c +++ b/libcpu/arm/am335x/interrupt.c @@ -19,7 +19,7 @@ #define MAX_HANDLERS 128 -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/libcpu/arm/cortex-r4/interrupt.c b/libcpu/arm/cortex-r4/interrupt.c index 14a9023921..345ca30e43 100644 --- a/libcpu/arm/cortex-r4/interrupt.c +++ b/libcpu/arm/cortex-r4/interrupt.c @@ -22,7 +22,7 @@ /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; diff --git a/libcpu/arm/lpc214x/cpuport.c b/libcpu/arm/lpc214x/cpuport.c index 4b8896aa73..927ae93b4e 100644 --- a/libcpu/arm/lpc214x/cpuport.c +++ b/libcpu/arm/lpc214x/cpuport.c @@ -16,7 +16,7 @@ #define MAX_HANDLERS 32 #define SVCMODE 0x13 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; diff --git a/libcpu/arm/lpc24xx/interrupt.c b/libcpu/arm/lpc24xx/interrupt.c index 87bb86b879..ec1b29e09e 100644 --- a/libcpu/arm/lpc24xx/interrupt.c +++ b/libcpu/arm/lpc24xx/interrupt.c @@ -18,7 +18,7 @@ /* exception and interrupt handler table */ struct rt_irq_desc irq_desc[MAX_HANDLERS]; -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; diff --git a/libcpu/arm/realview-a8-vmm/interrupt.c b/libcpu/arm/realview-a8-vmm/interrupt.c index 2f55f72693..e846880589 100644 --- a/libcpu/arm/realview-a8-vmm/interrupt.c +++ b/libcpu/arm/realview-a8-vmm/interrupt.c @@ -16,7 +16,7 @@ #define MAX_HANDLERS NR_IRQS_PBA8 -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/libcpu/arm/s3c24x0/interrupt.c b/libcpu/arm/s3c24x0/interrupt.c index c985fc7c86..79ef42df1a 100644 --- a/libcpu/arm/s3c24x0/interrupt.c +++ b/libcpu/arm/s3c24x0/interrupt.c @@ -15,7 +15,7 @@ #define MAX_HANDLERS 32 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/libcpu/arm/s3c44b0/interrupt.c b/libcpu/arm/s3c44b0/interrupt.c index 5464011dd2..b69e675741 100644 --- a/libcpu/arm/s3c44b0/interrupt.c +++ b/libcpu/arm/s3c44b0/interrupt.c @@ -15,7 +15,7 @@ #define MAX_HANDLERS 26 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ rt_isr_handler_t isr_table[MAX_HANDLERS]; diff --git a/libcpu/arm/sep4020/interrupt.c b/libcpu/arm/sep4020/interrupt.c index 24907c139f..641472d19f 100644 --- a/libcpu/arm/sep4020/interrupt.c +++ b/libcpu/arm/sep4020/interrupt.c @@ -15,7 +15,7 @@ #define MAX_HANDLERS 32 -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/libcpu/arm/zynqmp-r5/interrupt.c b/libcpu/arm/zynqmp-r5/interrupt.c index fa37674761..dd9dc1aa53 100644 --- a/libcpu/arm/zynqmp-r5/interrupt.c +++ b/libcpu/arm/zynqmp-r5/interrupt.c @@ -16,7 +16,7 @@ #define MAX_HANDLERS IRQ_ZynqMP_MAXNR -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; diff --git a/libcpu/m16c/m16c62p/cpuport.c b/libcpu/m16c/m16c62p/cpuport.c index 5c193b1b59..bb0660e911 100644 --- a/libcpu/m16c/m16c62p/cpuport.c +++ b/libcpu/m16c/m16c62p/cpuport.c @@ -11,7 +11,7 @@ #include -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* switch flag on interrupt and thread pointer to save switch record */ rt_uint32_t rt_interrupt_from_thread; diff --git a/libcpu/ppc/ppc405/interrupt.c b/libcpu/ppc/ppc405/interrupt.c index 79607691f4..571bd6ff06 100644 --- a/libcpu/ppc/ppc405/interrupt.c +++ b/libcpu/ppc/ppc405/interrupt.c @@ -13,7 +13,7 @@ #include /* interrupt nest */ -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ #define MAX_HANDLERS 32 diff --git a/libcpu/risc-v/t-head/c906/interrupt.c b/libcpu/risc-v/t-head/c906/interrupt.c index 9e4cf2f157..2f7a86e680 100644 --- a/libcpu/risc-v/t-head/c906/interrupt.c +++ b/libcpu/risc-v/t-head/c906/interrupt.c @@ -15,7 +15,7 @@ #include "riscv.h" #include "plic.h" -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; extern rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/libcpu/risc-v/t-head/c908/interrupt.c b/libcpu/risc-v/t-head/c908/interrupt.c index 9e4cf2f157..2f7a86e680 100644 --- a/libcpu/risc-v/t-head/c908/interrupt.c +++ b/libcpu/risc-v/t-head/c908/interrupt.c @@ -15,7 +15,7 @@ #include "riscv.h" #include "plic.h" -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; extern rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; extern rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/libcpu/rx/cpuport.c b/libcpu/rx/cpuport.c index 37ee47c042..eae7c8c0de 100644 --- a/libcpu/rx/cpuport.c +++ b/libcpu/rx/cpuport.c @@ -19,7 +19,7 @@ #define ENTER_INTERRUPT() ICU.SWINTR.BIT.SWINT = 1; -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* switch flag on interrupt and thread pointer to save switch record */ diff --git a/libcpu/sparc-v8/bm3803/interrupt.c b/libcpu/sparc-v8/bm3803/interrupt.c index 45113266ef..bf2dda0fe7 100644 --- a/libcpu/sparc-v8/bm3803/interrupt.c +++ b/libcpu/sparc-v8/bm3803/interrupt.c @@ -16,7 +16,7 @@ #define MAX_HANDLERS 256 -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; struct rt_irq_desc isr_table[MAX_HANDLERS]; rt_uint32_t rt_interrupt_from_thread; rt_uint32_t rt_interrupt_to_thread; diff --git a/libcpu/ti-dsp/c28x/cpuport.c b/libcpu/ti-dsp/c28x/cpuport.c index ffb40fee77..5da5f1e2e3 100644 --- a/libcpu/ti-dsp/c28x/cpuport.c +++ b/libcpu/ti-dsp/c28x/cpuport.c @@ -17,7 +17,7 @@ #define DBG_LVL DBG_INFO #include -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread; diff --git a/libcpu/ti-dsp/c6x/interrupt.c b/libcpu/ti-dsp/c6x/interrupt.c index e0f938a4c6..fbcd5b9891 100644 --- a/libcpu/ti-dsp/c6x/interrupt.c +++ b/libcpu/ti-dsp/c6x/interrupt.c @@ -14,7 +14,7 @@ #define MAX_HANDLERS 128 -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; struct rt_irq_desc isr_table[MAX_HANDLERS]; rt_uint32_t rt_interrupt_from_thread; rt_uint32_t rt_interrupt_to_thread; diff --git a/libcpu/unicore32/sep6200/interrupt.c b/libcpu/unicore32/sep6200/interrupt.c index b34e648630..ca0be86ad7 100644 --- a/libcpu/unicore32/sep6200/interrupt.c +++ b/libcpu/unicore32/sep6200/interrupt.c @@ -78,7 +78,7 @@ do{ \ }while(0) -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; /* exception and interrupt handler table */ struct rt_irq_desc isr_table[MAX_HANDLERS]; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; diff --git a/libcpu/v850/70f34/cpuport.c b/libcpu/v850/70f34/cpuport.c index 8ac3053e7b..f8e304fe1f 100644 --- a/libcpu/v850/70f34/cpuport.c +++ b/libcpu/v850/70f34/cpuport.c @@ -11,7 +11,7 @@ #include -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; /* switch flag on interrupt and thread pointer to save switch record */ rt_uint32_t rt_interrupt_from_thread; diff --git a/libcpu/xilinx/microblaze/trap.c b/libcpu/xilinx/microblaze/trap.c index bcfb3cc492..86b99a06a7 100755 --- a/libcpu/xilinx/microblaze/trap.c +++ b/libcpu/xilinx/microblaze/trap.c @@ -25,7 +25,7 @@ extern XIntc int_ctl; /* The instance of the Interrupt Controller */ -extern rt_uint32_t rt_interrupt_nest; +extern rt_atomic_t rt_interrupt_nest; rt_uint32_t rt_interrupt_from_thread, rt_interrupt_to_thread; rt_uint32_t rt_thread_switch_interrupt_flag; diff --git a/src/scheduler_up.c b/src/scheduler_up.c index d65870bbf2..cbd2eea8cd 100644 --- a/src/scheduler_up.c +++ b/src/scheduler_up.c @@ -46,7 +46,7 @@ rt_uint32_t rt_thread_ready_priority_group; rt_uint8_t rt_thread_ready_table[32]; #endif /* RT_THREAD_PRIORITY_MAX > 32 */ -extern volatile rt_uint8_t rt_interrupt_nest; +extern volatile rt_atomic_t rt_interrupt_nest; static rt_int16_t rt_scheduler_lock_nest; rt_uint8_t rt_current_priority;