diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-16 17:17:58 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-16 17:17:58 +0000 |
commit | 33b868cdc66ba55a3849bcb953e16a6ff96c1bcd (patch) | |
tree | a0453c9dbff5a5b6d07844c2257471abc81fa1f7 /nuttx/arch/x86/include/i486/irq.h | |
parent | 476f7ff06ef2561761015980c30e8fbfe0a7f8cf (diff) | |
download | px4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.tar.gz px4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.tar.bz2 px4-nuttx-33b868cdc66ba55a3849bcb953e16a6ff96c1bcd.zip |
Fix QEMU timer interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3387 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/x86/include/i486/irq.h')
-rwxr-xr-x | nuttx/arch/x86/include/i486/irq.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nuttx/arch/x86/include/i486/irq.h b/nuttx/arch/x86/include/i486/irq.h index cb78e4d81..0abf384ea 100755 --- a/nuttx/arch/x86/include/i486/irq.h +++ b/nuttx/arch/x86/include/i486/irq.h @@ -135,10 +135,18 @@ static inline irqstate_t irqflags() return flags; } -/* Get a sample of the FLAGS register, determine if interrupts are disabled */ +/* Get a sample of the FLAGS register, determine if interrupts are disabled. + * If the X86_FLAGS_IF is cleared by cli, then interrupts are disabled. If + * if the X86_FLAGS_IF is set by sti, then interrupts are enable. + */ static inline bool irqdisabled(irqstate_t flags) { + return ((flags & X86_FLAGS_IF) == 0); +} + +static inline bool irqenabled(irqstate_t flags) +{ return ((flags & X86_FLAGS_IF) != 0); } @@ -169,9 +177,9 @@ static inline irqstate_t irqsave(void) static inline void irqrestore(irqstate_t flags) { - if (irqdisabled(flags)) + if (irqenabled(flags)) { - irqdisable(); + irqenable(); } } |