Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * xapic.h
- * Advanced Programmable Interrupt Controller
- */
- #ifndef __XAPIC_H
- #define __XAPIC_H
- #include <os/system.h>
- #include <types.h>
- #define LAPIC_MM_REG_ID 0x0020
- #define LAPIC_MM_REG_VERSION 0x0030
- #define LAPIC_MM_REG_TASK_PRIORITY 0x0080
- #define LAPIC_MM_REG_PROCESSOR_PRIORITY 0x00A0
- #define LAPIC_MM_REG_EOI 0x00B0
- #define LAPIC_MM_REG_LOGICAL_DESTINATION 0x00D0
- #define LAPIC_MM_REG_DESTINATION_FORMAT 0x00E0
- #define LAPIC_MM_REG_SPURIOUS_INTERRUPT 0x00F0
- #define LAPIC_MM_REG_LVT_TIMER 0x0320
- #define IOAPIC_MM_REG_IOSEL 0x00
- #define IOAPIC_MM_REG_IOWIN 0x10
- enum {
- IOAPIC_REG_IDENTIFY,
- IOAPIC_REG_VERSION,
- IOAPIC_REG_ARBITRATION
- };
- #define IOAPIC_DMODE_FIXED 0x00
- #define IOAPIC_DMODE_LOW_PRIORITY 0x01
- #define IOAPIC_DMODE_SMI 0x02
- #define IOAPIC_DMODE_NMI 0x04
- #define IOAPIC_DMODE_INIT 0x05
- #define IOAPIC_DMODE_EXTINT 0x07
- typedef struct _IOAPICRegIdentify {
- uint8 apicVersion;
- uint8 reserved1;
- uint8 maximumRedirectionEntry;
- uint8 reserved2;
- } PACKED IOAPICRegIdentify;
- int XAPICInitialize(uint16* coreCount);
- void XAPICInstallRedirectionEntry(uint16 index, uint64 value);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment