]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/LegacyBiosMpTable.h
6aba16616d0ded3cda2e739945d6d9fd9ea64973
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / LegacyBiosMpTable.h
1 /*++
2 Defives data structures per MultiProcessor Specification Ver 1.4.
3
4 The MultiProcessor Specification defines an enhancement to the standard
5 to which PC manufacturers design DOS-compatible systems.
6
7 Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 --*/
17
18 #ifndef _LEGACY_BIOS_MPTABLE_H_
19 #define _LEGACY_BIOS_MPTABLE_H_
20
21 #define EFI_LEGACY_MP_TABLE_REV_1_4 0x04
22
23 //
24 // Define MP table structures. All are packed.
25 //
26 #pragma pack(1)
27
28 #define EFI_LEGACY_MP_TABLE_FLOATING_POINTER_SIGNATURE SIGNATURE_32 ('_', 'M', 'P', '_')
29 typedef struct {
30 UINT32 Signature;
31 UINT32 PhysicalAddress;
32 UINT8 Length;
33 UINT8 SpecRev;
34 UINT8 Checksum;
35 UINT8 FeatureByte1;
36 struct {
37 UINT32 Reserved1 : 6;
38 UINT32 MutipleClk : 1;
39 UINT32 Imcr : 1;
40 UINT32 Reserved2 : 24;
41 } FeatureByte2_5;
42 } EFI_LEGACY_MP_TABLE_FLOATING_POINTER;
43
44 #define EFI_LEGACY_MP_TABLE_HEADER_SIGNATURE SIGNATURE_32 ('P', 'C', 'M', 'P')
45 typedef struct {
46 UINT32 Signature;
47 UINT16 BaseTableLength;
48 UINT8 SpecRev;
49 UINT8 Checksum;
50 CHAR8 OemId[8];
51 CHAR8 OemProductId[12];
52 UINT32 OemTablePointer;
53 UINT16 OemTableSize;
54 UINT16 EntryCount;
55 UINT32 LocalApicAddress;
56 UINT16 ExtendedTableLength;
57 UINT8 ExtendedChecksum;
58 UINT8 Reserved;
59 } EFI_LEGACY_MP_TABLE_HEADER;
60
61 typedef struct {
62 UINT8 EntryType;
63 } EFI_LEGACY_MP_TABLE_ENTRY_TYPE;
64
65 //
66 // Entry Type 0: Processor.
67 //
68 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_PROCESSOR 0x00
69 typedef struct {
70 UINT8 EntryType;
71 UINT8 Id;
72 UINT8 Ver;
73 struct {
74 UINT8 Enabled : 1;
75 UINT8 Bsp : 1;
76 UINT8 Reserved : 6;
77 } Flags;
78 struct {
79 UINT32 Stepping : 4;
80 UINT32 Model : 4;
81 UINT32 Family : 4;
82 UINT32 Reserved : 20;
83 } Signature;
84 struct {
85 UINT32 Fpu : 1;
86 UINT32 Reserved1 : 6;
87 UINT32 Mce : 1;
88 UINT32 Cx8 : 1;
89 UINT32 Apic : 1;
90 UINT32 Reserved2 : 22;
91 } Features;
92 UINT32 Reserved1;
93 UINT32 Reserved2;
94 } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR;
95
96 //
97 // Entry Type 1: Bus.
98 //
99 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_BUS 0x01
100 typedef struct {
101 UINT8 EntryType;
102 UINT8 Id;
103 CHAR8 TypeString[6];
104 } EFI_LEGACY_MP_TABLE_ENTRY_BUS;
105
106 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUS "CBUS " // Corollary CBus
107 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUSII "CBUSII" // Corollary CBUS II
108 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_EISA "EISA " // Extended ISA
109 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_FUTURE "FUTURE" // IEEE FutureBus
110 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_INTERN "INTERN" // Internal bus
111 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_ISA "ISA " // Industry Standard Architecture
112 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBI "MBI " // Multibus I
113 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBII "MBII " // Multibus II
114 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MCA "MCA " // Micro Channel Architecture
115 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPI "MPI " // MPI
116 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPSA "MPSA " // MPSA
117 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_NUBUS "NUBUS " // Apple Macintosh NuBus
118 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCI "PCI " // Peripheral Component Interconnect
119 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCMCIA "PCMCIA" // PC Memory Card International Assoc.
120 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_TC "TC " // DEC TurboChannel
121 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VL "VL " // VESA Local Bus
122 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VME "VME " // VMEbus
123 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_XPRESS "XPRESS" // Express System Bus
124 //
125 // Entry Type 2: I/O APIC.
126 //
127 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IOAPIC 0x02
128 typedef struct {
129 UINT8 EntryType;
130 UINT8 Id;
131 UINT8 Ver;
132 struct {
133 UINT8 Enabled : 1;
134 UINT8 Reserved : 7;
135 } Flags;
136 UINT32 Address;
137 } EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC;
138
139 //
140 // Entry Type 3: I/O Interrupt Assignment.
141 //
142 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IO_INT 0x03
143 typedef struct {
144 UINT8 EntryType;
145 UINT8 IntType;
146 struct {
147 UINT16 Polarity : 2;
148 UINT16 Trigger : 2;
149 UINT16 Reserved : 12;
150 } Flags;
151 UINT8 SourceBusId;
152 union {
153 struct {
154 UINT8 IntNo : 2;
155 UINT8 Dev : 5;
156 UINT8 Reserved : 1;
157 } fields;
158 UINT8 byte;
159 } SourceBusIrq;
160 UINT8 DestApicId;
161 UINT8 DestApicIntIn;
162 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT;
163
164 typedef enum {
165 EfiLegacyMpTableEntryIoIntTypeInt = 0,
166 EfiLegacyMpTableEntryIoIntTypeNmi = 1,
167 EfiLegacyMpTableEntryIoIntTypeSmi = 2,
168 EfiLegacyMpTableEntryIoIntTypeExtInt= 3,
169 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_TYPE;
170
171 typedef enum {
172 EfiLegacyMpTableEntryIoIntFlagsPolaritySpec = 0x0,
173 EfiLegacyMpTableEntryIoIntFlagsPolarityActiveHigh = 0x1,
174 EfiLegacyMpTableEntryIoIntFlagsPolarityReserved = 0x2,
175 EfiLegacyMpTableEntryIoIntFlagsPolarityActiveLow = 0x3,
176 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_POLARITY;
177
178 typedef enum {
179 EfiLegacyMpTableEntryIoIntFlagsTriggerSpec = 0x0,
180 EfiLegacyMpTableEntryIoIntFlagsTriggerEdge = 0x1,
181 EfiLegacyMpTableEntryIoIntFlagsTriggerReserved = 0x2,
182 EfiLegacyMpTableEntryIoIntFlagsTriggerLevel = 0x3,
183 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_TRIGGER;
184
185 //
186 // Entry Type 4: Local Interrupt Assignment.
187 //
188 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_LOCAL_INT 0x04
189 typedef struct {
190 UINT8 EntryType;
191 UINT8 IntType;
192 struct {
193 UINT16 Polarity : 2;
194 UINT16 Trigger : 2;
195 UINT16 Reserved : 12;
196 } Flags;
197 UINT8 SourceBusId;
198 union {
199 struct {
200 UINT8 IntNo : 2;
201 UINT8 Dev : 5;
202 UINT8 Reserved : 1;
203 } fields;
204 UINT8 byte;
205 } SourceBusIrq;
206 UINT8 DestApicId;
207 UINT8 DestApicIntIn;
208 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT;
209
210 typedef enum {
211 EfiLegacyMpTableEntryLocalIntTypeInt = 0,
212 EfiLegacyMpTableEntryLocalIntTypeNmi = 1,
213 EfiLegacyMpTableEntryLocalIntTypeSmi = 2,
214 EfiLegacyMpTableEntryLocalIntTypeExtInt = 3,
215 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_TYPE;
216
217 typedef enum {
218 EfiLegacyMpTableEntryLocalIntFlagsPolaritySpec = 0x0,
219 EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveHigh= 0x1,
220 EfiLegacyMpTableEntryLocalIntFlagsPolarityReserved = 0x2,
221 EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveLow = 0x3,
222 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_POLARITY;
223
224 typedef enum {
225 EfiLegacyMpTableEntryLocalIntFlagsTriggerSpec = 0x0,
226 EfiLegacyMpTableEntryLocalIntFlagsTriggerEdge = 0x1,
227 EfiLegacyMpTableEntryLocalIntFlagsTriggerReserved = 0x2,
228 EfiLegacyMpTableEntryLocalIntFlagsTriggerLevel = 0x3,
229 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_TRIGGER;
230
231 //
232 // Entry Type 128: System Address Space Mapping.
233 //
234 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_SYS_ADDR_SPACE_MAPPING 0x80
235 typedef struct {
236 UINT8 EntryType;
237 UINT8 Length;
238 UINT8 BusId;
239 UINT8 AddressType;
240 UINT64 AddressBase;
241 UINT64 AddressLength;
242 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING;
243
244 typedef enum {
245 EfiLegacyMpTableEntryExtSysAddrSpaceMappingIo = 0,
246 EfiLegacyMpTableEntryExtSysAddrSpaceMappingMemory = 1,
247 EfiLegacyMpTableEntryExtSysAddrSpaceMappingPrefetch = 2,
248 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING_TYPE;
249
250 //
251 // Entry Type 129: Bus Hierarchy.
252 //
253 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_BUS_HIERARCHY 0x81
254 typedef struct {
255 UINT8 EntryType;
256 UINT8 Length;
257 UINT8 BusId;
258 struct {
259 UINT8 SubtractiveDecode : 1;
260 UINT8 Reserved : 7;
261 } BusInfo;
262 UINT8 ParentBus;
263 UINT8 Reserved1;
264 UINT8 Reserved2;
265 UINT8 Reserved3;
266 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY;
267
268 //
269 // Entry Type 130: Compatibility Bus Address Space Modifier.
270 //
271 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_COMPAT_BUS_ADDR_SPACE_MODIFIER 0x82
272 typedef struct {
273 UINT8 EntryType;
274 UINT8 Length;
275 UINT8 BusId;
276 struct {
277 UINT8 RangeMode : 1;
278 UINT8 Reserved : 7;
279 } AddrMode;
280 UINT32 PredefinedRangeList;
281 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER;
282
283 #pragma pack()
284
285 #endif