correct outb usage

This commit is contained in:
Mathieu Maret 2018-07-18 01:13:32 +02:00
parent 200c311bcf
commit 3fceb00ab4

8
pic.c
View File

@ -46,10 +46,10 @@ void enableIrq(int irq)
{
if (irq < 8) {
uint8_t status = inb(PIC_MASTER_DATA);
outb((status | (1 << irq)), PIC_MASTER_DATA);
outb(PIC_MASTER_DATA, (status | (1 << irq)));
} else {
uint8_t status = inb(PIC_SLAVE_DATA);
outb((status | (1 << irq)), PIC_SLAVE_DATA);
outb(PIC_SLAVE_DATA, (status | (1 << irq)));
}
}
@ -57,9 +57,9 @@ void disableIrq(int irq)
{
if (irq < 8) {
uint8_t status = inb(PIC_MASTER_DATA);
outb((status & ~(1 << irq)), PIC_MASTER_DATA);
outb(PIC_MASTER_DATA, (status & ~(1 << irq)));
} else {
uint8_t status = inb(PIC_SLAVE_DATA);
outb((status & ~(1 << irq)), PIC_SLAVE_DATA);
outb(PIC_SLAVE_DATA, (status & ~(1 << irq)));
}
}