Implement PIT interrupts
This commit is contained in:
@ -11,68 +11,14 @@
|
||||
#include "util/util.h"
|
||||
#include "cpu.h"
|
||||
#include "util/mmio.h"
|
||||
#include "acpi.h"
|
||||
|
||||
#define IOAPIC_IOREGSEL 0x00
|
||||
#define IOAPIC_IOWIN 0x10
|
||||
|
||||
#define IOAPIC_IOAPICID 0x00
|
||||
#define IOAPIC_IOAPICVER 0x01
|
||||
#define IOAPIC_IOAPICARB 0x02
|
||||
#define IOAPIC_IOREDTBL 0x10
|
||||
|
||||
#define LAPIC_ID 0x0020
|
||||
#define LAPIC_VER 0x0030
|
||||
#define LAPIC_TPR 0x0080
|
||||
#define LAPIC_APR 0x0090
|
||||
#define LAPIC_PPR 0x00A0
|
||||
#define LAPIC_EOI 0x00B0
|
||||
#define LAPIC_RRD 0x00C0
|
||||
#define LAPIC_LDR 0x00D0
|
||||
#define LAPIC_DFR 0x00E0
|
||||
#define LAPIC_SVR 0x00F0
|
||||
#define LAPIC_ISR 0x0100
|
||||
#define LAPIC_TMR 0x0180
|
||||
#define LAPIC_IRR 0x0200
|
||||
#define LAPIC_ESR 0x0280
|
||||
#define LAPIC_ICRLO 0x0300
|
||||
#define LAPIC_ICRHI 0x0310
|
||||
#define LAPIC_TIMER 0x0320
|
||||
#define LAPIC_THERMAL 0x0330
|
||||
#define LAPIC_PERF 0x0340
|
||||
#define LAPIC_LINT0 0x0350
|
||||
#define LAPIC_LINT1 0x0360
|
||||
#define LAPIC_ERROR 0x0370
|
||||
#define LAPIC_TICR 0x0380
|
||||
#define LAPIC_TCCR 0x0390
|
||||
#define LAPIC_TDCR 0x03E0
|
||||
|
||||
#define ICR_FIXED 0x00000000
|
||||
#define ICR_LOWEST 0x00000100
|
||||
#define ICR_SMI 0x00000200
|
||||
#define ICR_NMI 0x00000400
|
||||
#define ICR_INIT 0x00000500
|
||||
#define ICR_STARTUP 0x00000600
|
||||
#define ICR_PHYS 0x00000000
|
||||
#define ICR_LOGC 0x00000800
|
||||
#define ICR_IDLE 0x00000000
|
||||
#define ICR_SEND_PENDING 0x00001000
|
||||
#define ICR_DEASSERT 0x00000000
|
||||
#define ICR_ASSERT 0x00004000
|
||||
#define ICR_EDGE 0x00000000
|
||||
#define ICR_LEVEL 0x00008000
|
||||
#define ICR_NO_SHORTHAND 0x00000000
|
||||
#define ICR_SELF 0x00040000
|
||||
#define ICR_ALL_INC_SELF 0x00080000
|
||||
#define ICR_ALL_EXCL_SELF 0x000C0000
|
||||
|
||||
#define ICR_DEST_SHIFT 24
|
||||
|
||||
typedef struct LApic {
|
||||
struct LApic *next;
|
||||
uint8_t id;
|
||||
} LApic;
|
||||
|
||||
struct acpi_madt *MADT = NULL;
|
||||
uint8_t *IOAPIC;
|
||||
uint8_t *LAPIC;
|
||||
LApic *LAPICS = NULL;
|
||||
|
Reference in New Issue
Block a user