enable/disable IRQ backward
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3363 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
4a8c16484e
commit
a7835b0252
@ -138,6 +138,11 @@ static void up_remappic(void)
|
|||||||
idt_outb(0x28, PIC2_ICW2);
|
idt_outb(0x28, PIC2_ICW2);
|
||||||
idt_outb(PIC_ICW3_SID2, PIC2_ICW3);
|
idt_outb(PIC_ICW3_SID2, PIC2_ICW3);
|
||||||
idt_outb(PIC_ICW4_808xMODE, PIC2_ICW4);
|
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;
|
unsigned int regaddr;
|
||||||
uint8_t regbit;
|
uint8_t regbit;
|
||||||
|
|
||||||
if ((unsigned)irq >= IRQ0)
|
if (irq >= IRQ0)
|
||||||
{
|
{
|
||||||
/* Map the IRQ IMR regiser to a PIC and a bit number */
|
/* Map the IRQ IMR regiser to a PIC and a bit number */
|
||||||
|
|
||||||
if ((unsigned)irq <= IRQ7)
|
if (irq <= IRQ7)
|
||||||
{
|
{
|
||||||
regaddr = PIC1_IMR;
|
regaddr = PIC1_IMR;
|
||||||
regbit = (1 << (irq - IRQ0));
|
regbit = (1 << (irq - IRQ0));
|
||||||
}
|
}
|
||||||
else if ((unsigned)irq <= IRQ15)
|
else if (irq <= IRQ15)
|
||||||
{
|
{
|
||||||
regaddr = PIC2_IMR;
|
regaddr = PIC2_IMR;
|
||||||
regbit = (1 << (irq - IRQ8));
|
regbit = (1 << (irq - IRQ8));
|
||||||
@ -295,9 +300,9 @@ void up_disable_irq(int irq)
|
|||||||
return;
|
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;
|
unsigned int regaddr;
|
||||||
uint8_t regbit;
|
uint8_t regbit;
|
||||||
|
|
||||||
if ((unsigned)irq >= IRQ0)
|
if (irq >= IRQ0)
|
||||||
{
|
{
|
||||||
/* Map the IRQ IMR regiser to a PIC and a bit number */
|
/* Map the IRQ IMR regiser to a PIC and a bit number */
|
||||||
|
|
||||||
if ((unsigned)irq <= IRQ7)
|
if (irq <= IRQ7)
|
||||||
{
|
{
|
||||||
regaddr = PIC1_IMR;
|
regaddr = PIC1_IMR;
|
||||||
regbit = (1 << (irq - IRQ0));
|
regbit = (1 << (irq - IRQ0));
|
||||||
}
|
}
|
||||||
else if ((unsigned)irq <= IRQ15)
|
else if (irq <= IRQ15)
|
||||||
{
|
{
|
||||||
regaddr = PIC2_IMR;
|
regaddr = PIC2_IMR;
|
||||||
regbit = (1 << (irq - IRQ8));
|
regbit = (1 << (irq - IRQ8));
|
||||||
@ -333,9 +338,9 @@ void up_enable_irq(int irq)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable the interrupt */
|
/* Enable (unmask) the interrupt */
|
||||||
|
|
||||||
modifyreg8(regaddr, 0, regbit);
|
modifyreg8(regaddr, regbit, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void up_registerdump(uint32_t *regs)
|
|||||||
regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]);
|
regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]);
|
||||||
lldbg("ebx:%08x edx:%08x ecx:%08x eax:%08x\n",
|
lldbg("ebx:%08x edx:%08x ecx:%08x eax:%08x\n",
|
||||||
regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]);
|
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_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP],
|
||||||
regs[REG_SS]);
|
regs[REG_SS]);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
|
#include <arch/irq.h>
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
@ -87,9 +88,6 @@
|
|||||||
* Private Function Prototypes
|
* 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
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user