diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-10 23:37:45 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-10 23:37:45 +0000 |
commit | ee17172d5800fca4fab951e65050b711a6d3b0d4 (patch) | |
tree | 92d402aa0bddf62dea4ca67f6b4727b1133de300 /nuttx/arch | |
parent | b2878db7f7c57ce8be3421520417d3ed09c81ee5 (diff) | |
download | px4-nuttx-ee17172d5800fca4fab951e65050b711a6d3b0d4.tar.gz px4-nuttx-ee17172d5800fca4fab951e65050b711a6d3b0d4.tar.bz2 px4-nuttx-ee17172d5800fca4fab951e65050b711a6d3b0d4.zip |
enable/disable IRQ backward
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3363 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch')
-rwxr-xr-x | nuttx/arch/x86/src/i486/up_irq.c | 25 | ||||
-rw-r--r-- | nuttx/arch/x86/src/i486/up_regdump.c | 2 | ||||
-rwxr-xr-x | nuttx/arch/x86/src/qemu/qemu_timerisr.c | 4 |
3 files changed, 17 insertions, 14 deletions
diff --git a/nuttx/arch/x86/src/i486/up_irq.c b/nuttx/arch/x86/src/i486/up_irq.c index 33a9130d5..c77936b4f 100755 --- a/nuttx/arch/x86/src/i486/up_irq.c +++ b/nuttx/arch/x86/src/i486/up_irq.c @@ -138,6 +138,11 @@ static void up_remappic(void) idt_outb(0x28, PIC2_ICW2); idt_outb(PIC_ICW3_SID2, PIC2_ICW3); idt_outb(PIC_ICW4_808xMODE, PIC2_ICW4); + + /* Mask interrupts from PIC */ + + idt_outb(PIC1_IMR_ALL, PIC1_IMR); + idt_outb(PIC2_IMR_ALL, PIC2_IMR); } /**************************************************************************** @@ -276,16 +281,16 @@ void up_disable_irq(int irq) unsigned int regaddr; uint8_t regbit; - if ((unsigned)irq >= IRQ0) + if (irq >= IRQ0) { /* Map the IRQ IMR regiser to a PIC and a bit number */ - if ((unsigned)irq <= IRQ7) + if (irq <= IRQ7) { regaddr = PIC1_IMR; regbit = (1 << (irq - IRQ0)); } - else if ((unsigned)irq <= IRQ15) + else if (irq <= IRQ15) { regaddr = PIC2_IMR; regbit = (1 << (irq - IRQ8)); @@ -295,9 +300,9 @@ void up_disable_irq(int irq) return; } - /* Disable the interrupt */ + /* Disable (mask) the interrupt */ - modifyreg8(regaddr, regbit, 0); + modifyreg8(regaddr, 0, regbit); } } @@ -314,16 +319,16 @@ void up_enable_irq(int irq) unsigned int regaddr; uint8_t regbit; - if ((unsigned)irq >= IRQ0) + if (irq >= IRQ0) { /* Map the IRQ IMR regiser to a PIC and a bit number */ - if ((unsigned)irq <= IRQ7) + if (irq <= IRQ7) { regaddr = PIC1_IMR; regbit = (1 << (irq - IRQ0)); } - else if ((unsigned)irq <= IRQ15) + else if (irq <= IRQ15) { regaddr = PIC2_IMR; regbit = (1 << (irq - IRQ8)); @@ -333,9 +338,9 @@ void up_enable_irq(int irq) return; } - /* Enable the interrupt */ + /* Enable (unmask) the interrupt */ - modifyreg8(regaddr, 0, regbit); + modifyreg8(regaddr, regbit, 0); } } diff --git a/nuttx/arch/x86/src/i486/up_regdump.c b/nuttx/arch/x86/src/i486/up_regdump.c index 68d31cdce..5a5da0e70 100644 --- a/nuttx/arch/x86/src/i486/up_regdump.c +++ b/nuttx/arch/x86/src/i486/up_regdump.c @@ -76,7 +76,7 @@ void up_registerdump(uint32_t *regs) regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]); lldbg("ebx:%08x edx:%08x ecx:%08x eax:%08x\n", regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]); - lldbg("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n", + lldbg("eip:%08x cs:%08x flg:%08x sp:%08x ss:%08x\n", regs[REG_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP], regs[REG_SS]); } diff --git a/nuttx/arch/x86/src/qemu/qemu_timerisr.c b/nuttx/arch/x86/src/qemu/qemu_timerisr.c index ca51816af..531b7d09d 100755 --- a/nuttx/arch/x86/src/qemu/qemu_timerisr.c +++ b/nuttx/arch/x86/src/qemu/qemu_timerisr.c @@ -47,6 +47,7 @@ #include <debug.h> #include <nuttx/arch.h> +#include <arch/irq.h> #include <arch/io.h> #include <arch/board/board.h> @@ -87,9 +88,6 @@ * Private Function Prototypes ****************************************************************************/ -static void outb(uint8_t val, uint16_t addr) __attribute__((noinline)); -static int up_timerisr(int irq, uint32_t *regs); - /**************************************************************************** * Private Functions ****************************************************************************/ |