aboutsummaryrefslogtreecommitdiff
path: root/devices/pic_8259.c
diff options
context:
space:
mode:
Diffstat (limited to 'devices/pic_8259.c')
-rw-r--r--devices/pic_8259.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/devices/pic_8259.c b/devices/pic_8259.c
index 75a2d0e..7b4807c 100644
--- a/devices/pic_8259.c
+++ b/devices/pic_8259.c
@@ -6,11 +6,11 @@
#define PIC2 0xa0
#define DATA 1
-// initialization
+/* initialization */
#define ICW1_INIT 0x10
-// TODO
+/* TODO */
#define ICW1_ICW4 0x01
-// 8086/88 mode
+/* 8086/88 mode */
#define ICW4_8086 0x01
void
@@ -19,16 +19,16 @@ pic_init()
outb(ICW1_INIT | ICW1_ICW4, PIC1);
outb(ICW1_INIT | ICW1_ICW4, PIC2);
- outb(0x20, PIC1 + DATA); // offset 0x20
- outb(0x28, PIC2 + DATA); // offset 0x28
+ outb(0x20, PIC1 + DATA); /* offset 0x20 */
+ outb(0x28, PIC2 + DATA); /* offset 0x28 */
- outb(0x04, PIC1 + DATA); // tell master pic there is a slave pic
- outb(0x02, PIC2 + DATA); // tell slave pic its cascade identity
+ outb(0x04, PIC1 + DATA); /* tell master pic there is a slave pic */
+ outb(0x02, PIC2 + DATA); /* tell slave pic its cascade identity */
outb(ICW4_8086, PIC1 + DATA);
outb(ICW4_8086, PIC2 + DATA);
- // PIC masks
+ /* PIC masks */
outb(0xff, PIC1 + DATA);
outb(0xff, PIC2 + DATA);
}
@@ -37,13 +37,13 @@ void
pic_enable()
{
unsigned char mask1 = 0xff;
- mask1 &= ~(1 << 0); // irq0 timer
- mask1 &= ~(1 << 1); // irq1 keyboard
- mask1 &= ~(1 << 2); // irq1 cascade
+ mask1 &= ~(1 << 0); /* irq0 timer */
+ mask1 &= ~(1 << 1); /* irq1 keyboard */
+ mask1 &= ~(1 << 2); /* irq1 cascade */
outb(mask1, PIC1 + DATA);
unsigned char mask2 = 0xff;
- mask2 &= ~(1 << 4); // irq12 mouse
+ mask2 &= ~(1 << 4); /* irq12 mouse */
outb(mask2, PIC2 + DATA);
enable_interrupts();