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