From: batt Date: Tue, 23 Oct 2007 13:44:42 +0000 (+0000) Subject: Change macro name to IRQ_ENABLED. X-Git-Tag: 1.0.0~314 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8892633f666bee56325f62ff9693b9a164253dc8;p=bertos.git Change macro name to IRQ_ENABLED. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@928 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/app/at91sam7s/at91sam7s.c b/app/at91sam7s/at91sam7s.c index 4e75cf4e..57fdd8fd 100644 --- a/app/at91sam7s/at91sam7s.c +++ b/app/at91sam7s/at91sam7s.c @@ -80,7 +80,7 @@ int main(void) timer_init(); proc_init(); - ASSERT(!IRQ_GETSTATE()); + ASSERT(!IRQ_ENABLED()); @@ -90,7 +90,7 @@ int main(void) ser_setparity(host_port, SER_PARITY_NONE); IRQ_ENABLE; - ASSERT(IRQ_GETSTATE()); + ASSERT(IRQ_ENABLED()); /* Disable all pullups */ PIOA_PUDR = 0xffffffff; diff --git a/cpu/cpu.h b/cpu/cpu.h index 03a0827d..1e68ac2c 100644 --- a/cpu/cpu.h +++ b/cpu/cpu.h @@ -154,7 +154,7 @@ set_CPSR(x); \ } while (0) - #define IRQ_GETSTATE() \ + #define IRQ_ENABLED() \ ((bool)(get_CPSR() & 0xb0)) #define BREAKPOINT /* asm("bkpt 0") DOES NOT WORK */ @@ -214,7 +214,7 @@ sreg; \ }) - #define IRQ_GETSTATE() (!((CPU_READ_FLAGS() & 0xc0) == 0xc0)) + #define IRQ_ENABLED() ((CPU_READ_FLAGS() & 0xc0) != 0xc0) /** * Initialization value for registers in stack frame. @@ -239,7 +239,7 @@ #define IRQ_ENABLE FIXME #define IRQ_SAVE_DISABLE(x) FIXME #define IRQ_RESTORE(x) FIXME - #define IRQ_GETSTATE() FIXME + #define IRQ_ENABLED() FIXME typedef uint32_t cpuflags_t; // FIXME typedef uint32_t cpustack_t; // FIXME @@ -272,13 +272,13 @@ } #define IRQ_RUNNING() irq_running() - static inline bool irq_getstate(void) + static inline bool irq_enabled(void) { uint16_t x; asm(move SR,x); return !(x & 0x0200); } - #define IRQ_GETSTATE() irq_getstate() + #define IRQ_ENABLED() irq_enabled() typedef uint16_t cpuflags_t; typedef unsigned int cpustack_t; @@ -320,7 +320,7 @@ ); \ } while (0) - #define IRQ_GETSTATE() \ + #define IRQ_ENABLED() \ ({ \ uint8_t sreg; \ __asm__ __volatile__( \ diff --git a/drv/timer.c b/drv/timer.c index b25afba5..9148d930 100644 --- a/drv/timer.c +++ b/drv/timer.c @@ -173,9 +173,9 @@ Timer *timer_abort(Timer *timer) */ void timer_delayTicks(ticks_t delay) { -#if defined(IRQ_GETSTATE) +#if defined(IRQ_ENABLED) /* We shouldn't sleep with interrupts disabled */ - ASSERT(IRQ_GETSTATE()); + ASSERT(IRQ_ENABLED()); #endif #if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS