Misc Changes
[tpg/acess2.git] / Kernel / arch / x86 / include / mp.h
1 /*
2  */
3 #ifndef _MP_H
4 #define _MP_H
5
6 #define MPPTR_IDENT     ('_'|('M'<<8)|('P'<<16)|('_'<<24))
7 #define MPTABLE_IDENT   ('P'|('C'<<8)|('M'<<16)|('P'<<24))
8
9 typedef struct sMPInfo {
10         Uint32  Sig;    // '_MP_'
11         Uint32  MPConfig;
12         Uint8   Length;
13         Uint8   Version;
14         Uint8   Checksum;
15         Uint8   Features[5];    // 2-4 are unused
16 } tMPInfo;
17
18 typedef union uMPTable_Ent {
19         Uint8   Type;
20         struct {
21                 Uint8   Type;
22                 Uint8   APICID;
23                 Uint8   APICVer;
24                 Uint8   CPUFlags;       // bit 0: Enabled, bit 1: Boot Processor
25                 Uint32  CPUSignature;   // Stepping, Model, Family
26                 Uint32  FeatureFlags;
27                 Uint32  Reserved[2];
28         } __attribute__((packed))       Proc;   // 0x00
29         struct {
30                 Uint8   Type;
31                 Uint8   ID;
32                 char    TypeString[6];
33         } __attribute__((packed))       Bus;    // 0x01
34         struct {
35                 Uint8   Type;
36                 Uint8   ID;
37                 Uint8   Version;
38                 Uint8   Flags;  // bit 0: Enabled
39                 Uint32  Addr;
40         } __attribute__((packed))       IOAPIC; // 0x02
41         struct {
42                 Uint8   Type;
43                 Uint8   IntType;
44                 Uint16  Flags;  // 0,1: Polarity, 2,3: Trigger Mode
45                 Uint8   SourceBusID;
46                 Uint8   SourceBusIRQ;
47                 Uint8   DestAPICID;
48                 Uint8   DestAPICIRQ;
49         } __attribute__((packed))       IOInt;
50         struct {
51                 Uint8   Type;
52                 Uint8   IntType;
53                 Uint16  Flags;  // 0,1: Polarity, 2,3: Trigger Mode
54                 Uint8   SourceBusID;
55                 Uint8   SourceBusIRQ;
56                 Uint8   DestLocalAPICID;
57                 Uint8   DestLocalAPICIRQ;
58         } __attribute__((packed))       LocalInt;
59 } __attribute__((packed)) tMPTable_Ent;
60
61 typedef struct sMPTable {
62         Uint32  Sig;
63         Uint16  BaseTableLength;
64         Uint8   SpecRev;
65         Uint8   Checksum;
66         
67         char    OemID[8];
68         char    ProductID[12];
69         
70         Uint32  OEMTablePtr;
71         Uint16  OEMTableSize;
72         Uint16  EntryCount;
73         
74         Uint32  LocalAPICMemMap;        //!< Address used to access the local APIC
75         Uint16  ExtendedTableLen;
76         Uint8   ExtendedTableChecksum;
77         Uint8   Reserved;
78         
79         tMPTable_Ent    Entries[];
80 } tMPTable;
81
82 typedef volatile struct {
83         Uint32  Addr;
84         Uint32  Resvd1[3];
85         union {
86                 Uint8   Byte;
87                 Uint16  Word;
88                 Uint32  DWord;
89         }       Value;
90         Uint32  Resvd2[3];
91 }       tIOAPIC;
92
93 typedef struct {
94         Uint32  Val;
95         Uint32  Padding[3];
96 }       tReg;
97
98 typedef volatile struct {
99         tReg    _unused;
100         tReg    _unused2;
101         tReg    ID;
102         tReg    Version;
103 }       tAPIC;
104
105 #endif

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