X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Firq.h;h=011524b8f098bd874ab38d967aea34f6bde31426;hb=3819bd4557d9991f73cb758cb0a52a3f9cd9b629;hp=5fddfdc9cee57f08da34b6cbd70db60579a8e3fa;hpb=547a273e4edd84b2a2e2d69b5698a7b88374578c;p=bertos.git diff --git a/bertos/cpu/irq.h b/bertos/cpu/irq.h index 5fddfdc9..011524b8 100644 --- a/bertos/cpu/irq.h +++ b/bertos/cpu/irq.h @@ -60,6 +60,7 @@ #define IRQ_RESTORE(x) FIXME #endif /* OS_EMBEDDED */ + #elif CPU_ARM #ifdef __IAR_SYSTEMS_ICC__ @@ -68,8 +69,8 @@ #if __CPU_MODE__ == 1 /* Thumb */ /* Use stubs */ - extern cpuflags_t get_CPSR(void); - extern void set_CPSR(cpuflags_t flags); + extern cpu_flags_t get_CPSR(void); + extern void set_CPSR(cpu_flags_t flags); #else #define get_CPSR __get_CPSR #define set_CPSR __set_CPSR @@ -92,8 +93,6 @@ #define IRQ_ENABLED() \ ((bool)(get_CPSR() & 0xb0)) - #define BREAKPOINT /* asm("bkpt 0") DOES NOT WORK */ - #else /* !__IAR_SYSTEMS_ICC__ */ #define IRQ_DISABLE \ @@ -139,7 +138,7 @@ #define CPU_READ_FLAGS() \ ({ \ - cpuflags_t sreg; \ + cpu_flags_t sreg; \ asm volatile ( \ "mrs %0, cpsr\n\t" \ : "=r" (sreg) \ @@ -166,7 +165,6 @@ #elif CPU_DSP56K - #define BREAKPOINT asm(debug) #define IRQ_DISABLE do { asm(bfset #0x0200,SR); asm(nop); } while (0) #define IRQ_ENABLE do { asm(bfclr #0x0200,SR); asm(nop); } while (0) @@ -245,13 +243,13 @@ #ifdef IRQ_ENABLED /// Ensure interrupts are enabled - #define ASSERT_IRQ_ENABLED() ASSERT(IRQ_ENABLED()) + #define IRQ_ASSERT_ENABLED() ASSERT(IRQ_ENABLED()) /// Ensure interrupts are not enabled - #define ASSERT_IRQ_DISABLED() ASSERT(IRQ_ENABLED()) + #define IRQ_ASSERT_DISABLED() ASSERT(!IRQ_ENABLED()) #else - #define ASSERT_IRQ_ENABLED() do {} while(0) - #define ASSERT_IRQ_DISABLED() do {} while(0) + #define IRQ_ASSERT_ENABLED() do {} while(0) + #define IRQ_ASSERT_DISABLED() do {} while(0) #endif /** @@ -261,16 +259,10 @@ */ #define ATOMIC(CODE) \ do { \ - cpuflags_t __flags; \ + cpu_flags_t __flags; \ IRQ_SAVE_DISABLE(__flags); \ CODE; \ IRQ_RESTORE(__flags); \ } while (0) - -#ifndef BREAKPOINT -#define BREAKPOINT /* nop */ -#endif - - #endif /* CPU_IRQ_H */