Kernel/x86 - Moved MP Table parsing into its own file
[tpg/acess2.git] / KernelLand / Kernel / arch / x86 / include / apic.h
1 /*
2  * Acess2 Kernel (x86 Port)
3  * - By John Hodge (thePowersGang)
4  *
5  * include/apic.h
6  * - Definitions for APIC/IOAPIC
7  */
8 #ifndef _APIC_H_
9 #define _APIC_H_
10
11 typedef volatile struct sIOAPIC tIOAPIC;
12 typedef volatile struct sAPICReg tAPICReg;
13 typedef struct sAPIC    tAPIC;
14
15 extern tAPIC    *gpMP_LocalAPIC;
16
17 struct sIOAPIC
18 {
19         Uint32  Addr;
20         Uint32  Resvd1[3];
21         union {
22                 Uint8   Byte;
23                 Uint16  Word;
24                 Uint32  DWord;
25         }       Value;
26         Uint32  Resvd2[3];
27 };
28
29 struct sAPICReg
30 {
31         Uint32  Val;
32         Uint32  Padding[3];
33 };
34
35 struct sAPIC
36 {
37         tAPICReg        _unused1[2];
38         tAPICReg        ID;
39         tAPICReg        Version;
40         tAPICReg        _unused2[4];
41         tAPICReg        TPR;    // Task Priority Register
42         tAPICReg        APR;    // Arbitration Priority Register (RO)
43         tAPICReg        PPR;    // Processor Priority Register (RO)
44         tAPICReg        EOI;    // EOI Register (Write Only)
45         tAPICReg        _unused3[1];
46         tAPICReg        LogDest;        // Logical Destination Register
47         tAPICReg        DestFmt;        // Destination Format Register (0-27: RO, 28-31: RW)
48         tAPICReg        SIV;    // Spurious Interrupt Vector Register (0-8: RW, 9-31: RO)
49         tAPICReg        ISR[8]; // In-Service Register - Total 256 Bits (RO)
50         tAPICReg        TMR[8]; // Trigger Mode Register - Total 256 Bits (RO)
51         tAPICReg        IRR[8]; // Interrupt Request Register - Total 256 Bits (RO)
52         tAPICReg        ErrorStatus;    // Error Status Register (RO)
53         tAPICReg        _unused4[6];
54         tAPICReg        LVTCMI; // LVT CMI Registers
55         // 0x300
56         tAPICReg        ICR[2]; // Interrupt Command Register (RW)
57         // LVT Registers (Controls Local Vector Table)
58         // Structure:
59         // 0-7:   Vector - IDT Vector for the interrupt
60         // 12:    Delivery Status (0: Idle, 1: Send Pending)
61         // 16:    Mask (0: Enabled, 1: Disabled)
62         // 0x320
63         tAPICReg        LVTTimer;       // LVT Timer Register (RW)
64         tAPICReg        LVTThermalSensor;       // LVT Thermal Sensor Register (RW)
65         tAPICReg        LVTPerfMonCounters;     // LVT Performance Monitor Counters Register (RW)
66         tAPICReg        LVTLInt0;       // LVT Local Interrupt (LINT) #0 Register (RW);
67         tAPICReg        LVTLInt1;       // LVT Local Interrupt (LINT) #1 Register (RW);
68         tAPICReg        LVTError;       // LVT Error Register (RW);
69         // 0x380
70         tAPICReg        InitialCount;   // Initial Count Register (Used for the timer) (RW)
71         tAPICReg        CurrentCount;   // Current Count Register (Used for the timer) (RW)
72         tAPICReg        _unused5[4];
73         // 0x3E0
74         tAPICReg        DivideConifg;   // Divide Configuration Register (RW)
75         tAPICReg        _unused6[1];
76 };
77
78 #endif

UCC git Repository :: git.ucc.asn.au