1 /** @file
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  Reserved1 : 6;
31   UINT32  MutipleClk : 1;
32   UINT32  Imcr : 1;
33   UINT32  Reserved2 : 24;
34 } FEATUREBYTE2_5;
35 
36 typedef struct {
37   UINT32  Signature;
38   UINT32  PhysicalAddress;
39   UINT8   Length;
40   UINT8   SpecRev;
41   UINT8   Checksum;
42   UINT8   FeatureByte1;
43   FEATUREBYTE2_5 FeatureByte2_5;
44 } EFI_LEGACY_MP_TABLE_FLOATING_POINTER;
45 
46 #define EFI_LEGACY_MP_TABLE_HEADER_SIGNATURE  SIGNATURE_32 ('P', 'C', 'M', 'P')
47 typedef struct {
48   UINT32  Signature;
49   UINT16  BaseTableLength;
50   UINT8   SpecRev;
51   UINT8   Checksum;
52   CHAR8   OemId[8];
53   CHAR8   OemProductId[12];
54   UINT32  OemTablePointer;
55   UINT16  OemTableSize;
56   UINT16  EntryCount;
57   UINT32  LocalApicAddress;
58   UINT16  ExtendedTableLength;
59   UINT8   ExtendedChecksum;
60   UINT8   Reserved;
61 } EFI_LEGACY_MP_TABLE_HEADER;
62 
63 typedef struct {
64   UINT8 EntryType;
65 } EFI_LEGACY_MP_TABLE_ENTRY_TYPE;
66 
67 //
68 // Entry Type 0: Processor.
69 //
70 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_PROCESSOR  0x00
71 typedef struct {
72   UINT8 Enabled : 1;
73   UINT8 Bsp : 1;
74   UINT8 Reserved : 6;
75 } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FLAGS;
76 
77 typedef struct {
78   UINT32  Stepping : 4;
79   UINT32  Model : 4;
80   UINT32  Family : 4;
81   UINT32  Reserved : 20;
82 } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_SIGNATURE;
83 
84 typedef 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 } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FEATURES;
92 
93 typedef struct {
94   UINT8 EntryType;
95   UINT8 Id;
96   UINT8 Ver;
97   EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FLAGS     Flags;
98   EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_SIGNATURE Signature;
99   EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR_FEATURES  Features;
100   UINT32  Reserved1;
101   UINT32  Reserved2;
102 } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR;
103 
104 //
105 // Entry Type 1: Bus.
106 //
107 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_BUS  0x01
108 typedef struct {
109   UINT8 EntryType;
110   UINT8 Id;
111   CHAR8 TypeString[6];
112 } EFI_LEGACY_MP_TABLE_ENTRY_BUS;
113 
114 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUS   "CBUS  "  // Corollary CBus
115 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUSII "CBUSII"  // Corollary CBUS II
116 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_EISA   "EISA  "  // Extended ISA
117 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_FUTURE "FUTURE"  // IEEE FutureBus
118 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_INTERN "INTERN"  // Internal bus
119 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_ISA    "ISA   "  // Industry Standard Architecture
120 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBI    "MBI   "  // Multibus I
121 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBII   "MBII  "  // Multibus II
122 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MCA    "MCA   "  // Micro Channel Architecture
123 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPI    "MPI   "  // MPI
124 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPSA   "MPSA  "  // MPSA
125 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_NUBUS  "NUBUS "  // Apple Macintosh NuBus
126 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCI    "PCI   "  // Peripheral Component Interconnect
127 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCMCIA "PCMCIA"  // PC Memory Card International Assoc.
128 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_TC     "TC    "  // DEC TurboChannel
129 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VL     "VL    "  // VESA Local Bus
130 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VME    "VME   "  // VMEbus
131 #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_XPRESS "XPRESS"  // Express System Bus
132 //
133 // Entry Type 2: I/O APIC.
134 //
135 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IOAPIC 0x02
136 typedef struct {
137   UINT8 Enabled : 1;
138   UINT8 Reserved : 7;
139 } EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC_FLAGS;
140 
141 typedef struct {
142   UINT8 EntryType;
143   UINT8 Id;
144   UINT8 Ver;
145   EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC_FLAGS Flags;
146   UINT32  Address;
147 } EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC;
148 
149 //
150 // Entry Type 3: I/O Interrupt Assignment.
151 //
152 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IO_INT 0x03
153 typedef struct {
154   UINT16  Polarity : 2;
155   UINT16  Trigger : 2;
156   UINT16  Reserved : 12;
157 } EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS;
158 
159 typedef struct {
160   UINT8 IntNo : 2;
161   UINT8 Dev : 5;
162   UINT8 Reserved : 1;
163 } EFI_LEGACY_MP_TABLE_ENTRY_INT_FIELDS;
164 
165 typedef union {
166   EFI_LEGACY_MP_TABLE_ENTRY_INT_FIELDS fields;
167   UINT8 byte;
168 } EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ;
169 
170 typedef struct {
171   UINT8 EntryType;
172   UINT8 IntType;
173   EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS Flags;
174   UINT8 SourceBusId;
175   EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ SourceBusIrq;
176   UINT8 DestApicId;
177   UINT8 DestApicIntIn;
178 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT;
179 
180 typedef enum {
181   EfiLegacyMpTableEntryIoIntTypeInt   = 0,
182   EfiLegacyMpTableEntryIoIntTypeNmi   = 1,
183   EfiLegacyMpTableEntryIoIntTypeSmi   = 2,
184   EfiLegacyMpTableEntryIoIntTypeExtInt= 3,
185 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_TYPE;
186 
187 typedef enum {
188   EfiLegacyMpTableEntryIoIntFlagsPolaritySpec       = 0x0,
189   EfiLegacyMpTableEntryIoIntFlagsPolarityActiveHigh = 0x1,
190   EfiLegacyMpTableEntryIoIntFlagsPolarityReserved   = 0x2,
191   EfiLegacyMpTableEntryIoIntFlagsPolarityActiveLow  = 0x3,
192 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_POLARITY;
193 
194 typedef enum {
195   EfiLegacyMpTableEntryIoIntFlagsTriggerSpec        = 0x0,
196   EfiLegacyMpTableEntryIoIntFlagsTriggerEdge        = 0x1,
197   EfiLegacyMpTableEntryIoIntFlagsTriggerReserved    = 0x2,
198   EfiLegacyMpTableEntryIoIntFlagsTriggerLevel       = 0x3,
199 } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_TRIGGER;
200 
201 //
202 // Entry Type 4: Local Interrupt Assignment.
203 //
204 #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_LOCAL_INT  0x04
205 typedef struct {
206   UINT8 EntryType;
207   UINT8 IntType;
208   EFI_LEGACY_MP_TABLE_ENTRY_INT_FLAGS Flags;
209   UINT8 SourceBusId;
210   EFI_LEGACY_MP_TABLE_ENTRY_INT_SOURCE_BUS_IRQ SourceBusIrq;
211   UINT8 DestApicId;
212   UINT8 DestApicIntIn;
213 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT;
214 
215 typedef enum {
216   EfiLegacyMpTableEntryLocalIntTypeInt              = 0,
217   EfiLegacyMpTableEntryLocalIntTypeNmi              = 1,
218   EfiLegacyMpTableEntryLocalIntTypeSmi              = 2,
219   EfiLegacyMpTableEntryLocalIntTypeExtInt           = 3,
220 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_TYPE;
221 
222 typedef enum {
223   EfiLegacyMpTableEntryLocalIntFlagsPolaritySpec      = 0x0,
224   EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveHigh= 0x1,
225   EfiLegacyMpTableEntryLocalIntFlagsPolarityReserved  = 0x2,
226   EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveLow = 0x3,
227 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_POLARITY;
228 
229 typedef enum {
230   EfiLegacyMpTableEntryLocalIntFlagsTriggerSpec       = 0x0,
231   EfiLegacyMpTableEntryLocalIntFlagsTriggerEdge       = 0x1,
232   EfiLegacyMpTableEntryLocalIntFlagsTriggerReserved   = 0x2,
233   EfiLegacyMpTableEntryLocalIntFlagsTriggerLevel      = 0x3,
234 } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_TRIGGER;
235 
236 //
237 // Entry Type 128: System Address Space Mapping.
238 //
239 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_SYS_ADDR_SPACE_MAPPING 0x80
240 typedef struct {
241   UINT8   EntryType;
242   UINT8   Length;
243   UINT8   BusId;
244   UINT8   AddressType;
245   UINT64  AddressBase;
246   UINT64  AddressLength;
247 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING;
248 
249 typedef enum {
250   EfiLegacyMpTableEntryExtSysAddrSpaceMappingIo       = 0,
251   EfiLegacyMpTableEntryExtSysAddrSpaceMappingMemory   = 1,
252   EfiLegacyMpTableEntryExtSysAddrSpaceMappingPrefetch = 2,
253 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING_TYPE;
254 
255 //
256 // Entry Type 129: Bus Hierarchy.
257 //
258 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_BUS_HIERARCHY  0x81
259 typedef struct {
260   UINT8 SubtractiveDecode : 1;
261   UINT8 Reserved : 7;
262 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY_BUSINFO;
263 
264 typedef struct {
265   UINT8 EntryType;
266   UINT8 Length;
267   UINT8 BusId;
268   EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY_BUSINFO BusInfo;
269   UINT8 ParentBus;
270   UINT8 Reserved1;
271   UINT8 Reserved2;
272   UINT8 Reserved3;
273 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY;
274 
275 //
276 // Entry Type 130: Compatibility Bus Address Space Modifier.
277 //
278 #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_COMPAT_BUS_ADDR_SPACE_MODIFIER 0x82
279 typedef struct {
280   UINT8 RangeMode : 1;
281   UINT8 Reserved : 7;
282 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER_ADDR_MODE;
283 
284 typedef struct {
285   UINT8 EntryType;
286   UINT8 Length;
287   UINT8 BusId;
288   EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER_ADDR_MODE AddrMode;
289   UINT32  PredefinedRangeList;
290 } EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER;
291 
292 #pragma pack()
293 
294 #endif
295