POK(kernelpart)
|
Go to the source code of this file.
Functions | |
int | pok_pic_init () |
int | pok_pic_mask (uint8_t irq) |
int | pok_pic_unmask (uint8_t irq) |
void | pok_pic_eoi (uint8_t irq) |
void pok_pic_eoi | ( | uint8_t | irq | ) |
Definition at line 90 of file pic.c.
{ if (irq >= 8) { outb (PIC_SLAVE_BASE, 0x20); } outb (PIC_MASTER_BASE, 0x20); }
int pok_pic_init | ( | ) |
Definition at line 25 of file pic.c.
{ outb (PIC_MASTER_BASE, PIC_MASTER_ICW1); outb (PIC_SLAVE_BASE, PIC_SLAVE_ICW1); outb (PIC_MASTER_BASE + 1, PIC_MASTER_ICW2); outb (PIC_SLAVE_BASE + 1, PIC_SLAVE_ICW2); outb (PIC_MASTER_BASE + 1, PIC_MASTER_ICW3); outb (PIC_SLAVE_BASE + 1, PIC_SLAVE_ICW3); outb (PIC_MASTER_BASE + 1, PIC_MASTER_ICW4); outb (PIC_SLAVE_BASE + 1, PIC_SLAVE_ICW4); /* Mask everything */ outb (PIC_MASTER_BASE + 1, 0xfb); outb (PIC_SLAVE_BASE + 1, 0xff); return (POK_ERRNO_OK); }
int pok_pic_mask | ( | uint8_t | irq | ) |
Definition at line 46 of file pic.c.
{ uint8_t mask; if (irq > 15) { return (POK_ERRNO_EINVAL); } if (irq < 8) { mask = inb (PIC_MASTER_BASE + 1); outb (PIC_MASTER_BASE + 1, mask | (1 << irq)); } else { mask = inb (PIC_SLAVE_BASE + 1); outb (PIC_SLAVE_BASE + 1, mask | (1 << (irq - 8))); } return (POK_ERRNO_OK); }
int pok_pic_unmask | ( | uint8_t | irq | ) |
Definition at line 69 of file pic.c.
{ uint8_t mask; if (irq > 15) return (POK_ERRNO_EINVAL); if (irq < 8) { mask = inb(PIC_MASTER_BASE + 1); outb(PIC_MASTER_BASE + 1, mask & ~(1 << irq)); } else { mask = inb(PIC_SLAVE_BASE + 1); outb(PIC_SLAVE_BASE + 1, mask & ~(1 << (irq - 8))); } return (POK_ERRNO_OK); }