MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_pic_init

Function rt_hw_pic_init

libcpu/ia32/interrupt.c:33–55  ·  view source on GitHub ↗

* This function initializes 8259 interrupt controller */

Source from the content-addressed store, hash-verified

31 * This function initializes 8259 interrupt controller
32 */
33void rt_hw_pic_init()
34{
35 outb(IO_PIC1, 0x11);
36 outb(IO_PIC1+1, IRQ_OFFSET);
37 outb(IO_PIC1+1, 1<<IRQ_SLAVE);
38 outb(IO_PIC1+1, 0x3);
39 outb(IO_PIC1+1, 0xff);
40 outb(IO_PIC1, 0x68);
41 outb(IO_PIC1, 0x0a);
42 outb(IO_PIC2, 0x11);
43 outb(IO_PIC2+1, IRQ_OFFSET + 8);
44 outb(IO_PIC2+1, IRQ_SLAVE);
45 outb(IO_PIC2+1, 0x3);
46 outb(IO_PIC2+1, 0xff);
47 outb(IO_PIC2, 0x68);
48 outb(IO_PIC2, 0x0a);
49
50 if (irq_mask_8259A != 0xFFFF)
51 {
52 outb(IO_PIC1+1, (char)irq_mask_8259A);
53 outb(IO_PIC2+1, (char)(irq_mask_8259A >> 8));
54 }
55}
56
57void rt_hw_interrupt_handle(int vector, void* param)
58{

Callers 1

rt_hw_interrupt_initFunction · 0.85

Calls 1

outbFunction · 0.85

Tested by

no test coverage detected