This commit is contained in:
kaashoek 2006-08-04 18:23:23 +00:00
parent c8b29f6d03
commit 366189214e
2 changed files with 18 additions and 20 deletions

2
defs.h
View file

@ -40,8 +40,6 @@ int strncmp(const char *p, const char *q, uint n);
void syscall(void);
// picirq.c
extern ushort irq_mask_8259A;
void irq_setmask_8259A(ushort mask);
void pic_init(void);
// mp.c

View file

@ -12,7 +12,24 @@
// Current IRQ mask.
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
ushort irq_mask_8259A = 0xFFFF & ~(1<<IRQ_SLAVE);
static ushort irq_mask_8259A = 0xFFFF & ~(1<<IRQ_SLAVE);
static void
irq_setmask_8259A(ushort mask)
{
int i;
irq_mask_8259A = mask;
outb(IO_PIC1+1, (char)mask);
outb(IO_PIC2+1, (char)(mask >> 8));
cprintf("%d: enabled interrupts:", cpu());
for (i = 0; i < 16; i++)
if (~mask & (1<<i))
cprintf(" %d", i);
cprintf("\n");
}
/* Initialize the 8259A interrupt controllers. */
void
@ -68,20 +85,3 @@ pic_init(void)
if (irq_mask_8259A != 0xFFFF)
irq_setmask_8259A(irq_mask_8259A);
}
void
irq_setmask_8259A(ushort mask)
{
int i;
irq_mask_8259A = mask;
outb(IO_PIC1+1, (char)mask);
outb(IO_PIC2+1, (char)(mask >> 8));
cprintf("%d: enabled interrupts:", cpu());
for (i = 0; i < 16; i++)
if (~mask & (1<<i))
cprintf(" %d", i);
cprintf("\n");
}