|
AquilaOS documentation
How it works, and its code
|
x86: the PC's two 8259 programmable interrupt controllers (PICs). More...
#include <core/system.h>#include <core/panic.h>#include <core/arch.h>#include <platform/misc.h>#include <sys/sched.h>#include <sys/signal.h>#include <cpu/cpu.h>Go to the source code of this file.
Macros | |
| #define | PIC_CMD 0x00 |
| #define | PIC_DATA 0x01 |
| #define | ICW1 0x11 |
| #define | ICW2_MASTER 0x20 |
| #define | ICW2_SLAVE 0x28 |
| #define | ICW3_MASTER 0x04 |
| #define | ICW3_SLAVE 0x02 |
| #define | ICW4 0x01 |
| #define | IRQ_ACK 0x20 |
Functions | |
| static void | x86_irq_mask (int irq) |
| Masks an IRQ at its 8259. | |
| static void | x86_irq_unmask (int irq) |
| Unmasks an IRQ at its 8259 (for the slave's, the master's IRQ 2 too). | |
| static void | x86_irq_remap (void) |
| Initializes the 8259s, with their IRQs at vectors 32 to 47, so that they don't collide with the CPU's exceptions. | |
| static void | pic_chip_eoi (unsigned irq) |
| Tells the 8259s that an interrupt is handled: the slave too for its own IRQs. | |
| static void | pic_chip_mask (unsigned irq) |
| Masks an IRQ, for irq.c. | |
| static void | pic_chip_unmask (unsigned irq) |
| Unmasks an IRQ, for irq.c. | |
| static const char * | pic_chip_describe (unsigned irq) |
| Describes an IRQ's route, for /proc/interrupts. | |
| static int | x86_pic_probe (void) |
| Checks that there is an 8259 at the master's ports: it must keep the mask that was written. | |
| void | x86_pic_disable (void) |
| Masks every IRQ of the 8259s, when the APIC brings the interrupts. | |
| int | x86_pic_setup (struct ioaddr *_master, struct ioaddr *_slave) |
| Sets up the 8259s, with every IRQ masked. | |
Variables | |
| static struct ioaddr | master |
| static struct ioaddr | slave |
| static uint16_t | pic_mask = 0xFFFF |
| struct x86_irq_chip | x86_pic_chip |
x86: the PC's two 8259 programmable interrupt controllers (PICs).
The 8259s bring the interrupts when there's no APIC (or with apic=off), as an x86_irq_chip (irq.c). With the APIC, they are still set up (their IRQs remapped to vectors 32 to 47, past the exceptions), then masked, and they stay masked.
Definition in file pic.c.
| #define ICW1 0x11 |
Definition at line 37 of file pic.c.
Referenced by x86_irq_remap().
| #define ICW2_MASTER 0x20 |
Definition at line 38 of file pic.c.
Referenced by x86_irq_remap().
| #define ICW2_SLAVE 0x28 |
Definition at line 39 of file pic.c.
Referenced by x86_irq_remap().
| #define ICW3_MASTER 0x04 |
Definition at line 40 of file pic.c.
Referenced by x86_irq_remap().
| #define ICW3_SLAVE 0x02 |
Definition at line 41 of file pic.c.
Referenced by x86_irq_remap().
| #define ICW4 0x01 |
Definition at line 42 of file pic.c.
Referenced by x86_irq_remap().
| #define IRQ_ACK 0x20 |
Definition at line 91 of file pic.c.
Referenced by pic_chip_eoi().
| #define PIC_CMD 0x00 |
Definition at line 19 of file pic.c.
Referenced by pic_chip_eoi(), and x86_irq_remap().
| #define PIC_DATA 0x01 |
Definition at line 20 of file pic.c.
Referenced by x86_irq_mask(), x86_irq_remap(), x86_irq_unmask(), x86_pic_disable(), and x86_pic_probe().
|
static |
Describes an IRQ's route, for /proc/interrupts.
Definition at line 121 of file pic.c.
References pic_chip_describe().
Referenced by pic_chip_describe().
|
static |
Tells the 8259s that an interrupt is handled: the slave too for its own IRQs.
Definition at line 95 of file pic.c.
References io_out8(), IRQ_ACK, master, pic_chip_eoi(), PIC_CMD, and slave.
Referenced by pic_chip_eoi().
|
static |
Masks an IRQ, for irq.c.
Definition at line 107 of file pic.c.
References pic_chip_mask(), and x86_irq_mask().
Referenced by pic_chip_mask().
|
static |
Unmasks an IRQ, for irq.c.
Definition at line 114 of file pic.c.
References pic_chip_unmask(), and x86_irq_unmask().
Referenced by pic_chip_unmask().
|
static |
Masks an IRQ at its 8259.
Definition at line 48 of file pic.c.
References io_out8(), master, panic, PIC_DATA, pic_mask, slave, and x86_irq_mask().
Referenced by pic_chip_mask(), and x86_irq_mask().
|
static |
Initializes the 8259s, with their IRQs at vectors 32 to 47, so that they don't collide with the CPU's exceptions.
Definition at line 79 of file pic.c.
References ICW1, ICW2_MASTER, ICW2_SLAVE, ICW3_MASTER, ICW3_SLAVE, ICW4, io_out8(), master, PIC_CMD, PIC_DATA, slave, and x86_irq_remap().
Referenced by x86_irq_remap(), and x86_pic_setup().
|
static |
Unmasks an IRQ at its 8259 (for the slave's, the master's IRQ 2 too).
Definition at line 62 of file pic.c.
References io_out8(), master, panic, PIC_DATA, pic_mask, slave, and x86_irq_unmask().
Referenced by pic_chip_unmask(), and x86_irq_unmask().
| void x86_pic_disable | ( | void | ) |
Masks every IRQ of the 8259s, when the APIC brings the interrupts.
Definition at line 152 of file pic.c.
References io_out8(), master, PIC_DATA, slave, and x86_pic_disable().
Referenced by x86_apic_setup(), x86_pic_disable(), and x86_pic_setup().
|
static |
Checks that there is an 8259 at the master's ports: it must keep the mask that was written.
Returns 0, or -ENODEV.
Definition at line 136 of file pic.c.
References io_in8(), io_out8(), master, PIC_DATA, slave, and x86_pic_probe().
Referenced by x86_pic_probe(), and x86_pic_setup().
Sets up the 8259s, with every IRQ masked.
| _master | the master's ports (0x20) |
| _slave | the slave's ports (0xA0) |
Definition at line 165 of file pic.c.
References ioaddr::addr, ioaddr_type_str(), master, printk(), slave, x86_irq_remap(), x86_pic_disable(), x86_pic_probe(), and x86_pic_setup().
Referenced by x86_pc_pic_init(), and x86_pic_setup().
|
static |
Definition at line 22 of file pic.c.
Referenced by pic_chip_eoi(), x86_irq_mask(), x86_irq_remap(), x86_irq_unmask(), x86_pic_disable(), x86_pic_probe(), and x86_pic_setup().
|
static |
Definition at line 45 of file pic.c.
Referenced by x86_irq_mask(), and x86_irq_unmask().
|
static |
Definition at line 23 of file pic.c.
Referenced by pic_chip_eoi(), x86_irq_mask(), x86_irq_remap(), x86_irq_unmask(), x86_pic_disable(), x86_pic_probe(), and x86_pic_setup().
| struct x86_irq_chip x86_pic_chip |
Definition at line 126 of file pic.c.
Referenced by x86_pc_irq_init().