|
AquilaOS documentation
How it works, and its code
|
The PC platform: its interrupt controllers, its timers, its PCI bus and its real time clock, set up at boot, and the tick. More...
#include <core/kargs.h>#include <core/system.h>#include <cpu/io.h>#include <dev/pci.h>#include <platform/misc.h>Go to the source code of this file.
Macros | |
| #define | I8254_ADDR 0x40 |
| #define | I8254_TYPE IOADDR_PORT |
| #define | PIC_MASTER 0x20 |
| #define | PIC_SLAVE 0xA0 |
| #define | PIT_IRQ 0 |
Functions | |
| static int | x86_pc_pic_init (void) |
| Sets up the 8259s at the PC's ports. | |
| static void | x86_pc_pci_init (void) |
| Gives PCI its host bridge. | |
| static int | x86_pc_pit_init (void) |
| Sets up the PIT at the PC's ports. | |
| static int | x86_pc_cmos_init (void) |
| Sets up the real time clock at the PC's ports. | |
| uint32_t | platform_timer_setup (size_t period_ns, irq_handler_t handler) |
| Starts the scheduler's tick: the local APIC's timer if the APIC brings the interrupts, else the PIT. | |
| static void | x86_pc_irq_init (void) |
| Sets up the interrupts: through the APIC if there's one (and not apic=off), else through the 8259s. | |
| int | platform_init (void) |
Variables | |
| static struct pci_host | x86_pc_pci |
| static int | apic |
The PC platform: its interrupt controllers, its timers, its PCI bus and its real time clock, set up at boot, and the tick.
Definition in file init.c.
| #define I8254_ADDR 0x40 |
Definition at line 13 of file init.c.
Referenced by x86_pc_pit_init().
| #define I8254_TYPE IOADDR_PORT |
Definition at line 14 of file init.c.
Referenced by x86_pc_pit_init().
| #define PIC_MASTER 0x20 |
Definition at line 17 of file init.c.
Referenced by x86_pc_pic_init().
| #define PIC_SLAVE 0xA0 |
Definition at line 18 of file init.c.
Referenced by x86_pc_pic_init().
| #define PIT_IRQ 0 |
Definition at line 72 of file init.c.
Referenced by platform_timer_setup().
| int platform_init | ( | void | ) |
Definition at line 118 of file init.c.
References apic, gic_setup(), pci_host_set(), platform_init(), printk(), virt_pci, x86_pc_cmos_init(), x86_pc_irq_init(), x86_pc_pci_init(), x86_pc_pit_init(), and x86_smp_init().
Referenced by aarch64_init(), platform_init(), and x86_cpu_init().
| uint32_t platform_timer_setup | ( | size_t | period_ns, |
| irq_handler_t | handler ) |
Starts the scheduler's tick: the local APIC's timer if the APIC brings the interrupts, else the PIT.
| period_ns | the tick's period, in ns |
| handler | the tick's handler |
Definition at line 84 of file init.c.
References apic, irq_install(), NULL, PIT_IRQ, platform_timer_setup(), x86_lapic_timer_setup(), and x86_pit_period_set().
Referenced by arch_sched_init(), and platform_timer_setup().
|
static |
Sets up the real time clock at the PC's ports.
Definition at line 63 of file init.c.
References ioaddr::addr, IOADDR_PORT, ioaddr::type, x86_cmos_setup(), and x86_pc_cmos_init().
Referenced by platform_init(), and x86_pc_cmos_init().
|
static |
Sets up the interrupts: through the APIC if there's one (and not apic=off), else through the 8259s.
The 8259s are remapped either way.
Definition at line 96 of file init.c.
References apic, printk(), x86_apic_setup(), x86_irq_chip_name(), x86_irq_chip_set(), x86_irq_gates_setup(), x86_pc_irq_init(), x86_pc_pic_init(), and x86_pic_chip.
Referenced by platform_init(), and x86_pc_irq_init().
|
static |
Gives PCI its host bridge.
Definition at line 44 of file init.c.
References pci_host_set(), x86_pc_pci, and x86_pc_pci_init().
Referenced by platform_init(), and x86_pc_pci_init().
|
static |
Sets up the 8259s at the PC's ports.
Returns 0, or -ENODEV.
Definition at line 21 of file init.c.
References ioaddr::addr, IOADDR_PORT, PIC_MASTER, PIC_SLAVE, ioaddr::type, x86_pc_pic_init(), and x86_pic_setup().
Referenced by x86_pc_irq_init(), and x86_pc_pic_init().
|
static |
Sets up the PIT at the PC's ports.
Definition at line 52 of file init.c.
References ioaddr::addr, I8254_ADDR, I8254_TYPE, ioaddr::type, x86_pc_pit_init(), and x86_pit_setup().
Referenced by platform_init(), and x86_pc_pit_init().
|
static |
Definition at line 74 of file init.c.
Referenced by platform_init(), platform_timer_setup(), and x86_pc_irq_init().
|
static |
Definition at line 36 of file init.c.
Referenced by x86_pc_pci_init().