1 | /* $Id: LegacyBiosMpTable.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * LegacyBiosMpTable.h
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | /*++
|
---|
38 |
|
---|
39 | This code is based on:
|
---|
40 |
|
---|
41 | Copyright (c) 2007, Intel Corporation
|
---|
42 | All rights reserved. This program and the accompanying materials
|
---|
43 | are licensed and made available under the terms and conditions of the BSD License
|
---|
44 | which accompanies this distribution. The full text of the license may be found at
|
---|
45 | http://opensource.org/licenses/bsd-license.php
|
---|
46 |
|
---|
47 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
---|
48 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
---|
49 |
|
---|
50 | Module Name:
|
---|
51 |
|
---|
52 | LegacyBiosMpTable.h
|
---|
53 |
|
---|
54 | Abstract:
|
---|
55 | Defines data structures per Multi Processor Specification Ver 1.4.
|
---|
56 |
|
---|
57 | --*/
|
---|
58 |
|
---|
59 | #ifndef LEGACY_BIOS_MPTABLE_H_
|
---|
60 | #define LEGACY_BIOS_MPTABLE_H_
|
---|
61 |
|
---|
62 | #define EFI_LEGACY_MP_TABLE_REV_1_4 0x04
|
---|
63 |
|
---|
64 | //
|
---|
65 | // Define MP table structures. All are packed.
|
---|
66 | //
|
---|
67 | #pragma pack(push, 1)
|
---|
68 |
|
---|
69 | #define EFI_LEGACY_MP_TABLE_FLOATING_POINTER_SIGNATURE SIGNATURE_32 ('_', 'M', 'P', '_')
|
---|
70 | typedef struct {
|
---|
71 | UINT32 Signature;
|
---|
72 | UINT32 PhysicalAddress;
|
---|
73 | UINT8 Length;
|
---|
74 | UINT8 SpecRev;
|
---|
75 | UINT8 Checksum;
|
---|
76 | UINT8 FeatureByte1;
|
---|
77 | struct {
|
---|
78 | UINT32 Reserved1 : 6;
|
---|
79 | UINT32 MutipleClk : 1;
|
---|
80 | UINT32 Imcr : 1;
|
---|
81 | UINT32 Reserved2 : 24;
|
---|
82 | } FeatureByte2_5;
|
---|
83 | } EFI_LEGACY_MP_TABLE_FLOATING_POINTER;
|
---|
84 |
|
---|
85 | #define EFI_LEGACY_MP_TABLE_HEADER_SIGNATURE SIGNATURE_32 ('P', 'C', 'M', 'P')
|
---|
86 | typedef struct {
|
---|
87 | UINT32 Signature;
|
---|
88 | UINT16 BaseTableLength;
|
---|
89 | UINT8 SpecRev;
|
---|
90 | UINT8 Checksum;
|
---|
91 | CHAR8 OemId[8];
|
---|
92 | CHAR8 OemProductId[12];
|
---|
93 | UINT32 OemTablePointer;
|
---|
94 | UINT16 OemTableSize;
|
---|
95 | UINT16 EntryCount;
|
---|
96 | UINT32 LocalApicAddress;
|
---|
97 | UINT16 ExtendedTableLength;
|
---|
98 | UINT8 ExtendedChecksum;
|
---|
99 | UINT8 Reserved;
|
---|
100 | } EFI_LEGACY_MP_TABLE_HEADER;
|
---|
101 |
|
---|
102 | typedef struct {
|
---|
103 | UINT8 EntryType;
|
---|
104 | } EFI_LEGACY_MP_TABLE_ENTRY_TYPE;
|
---|
105 |
|
---|
106 | //
|
---|
107 | // Entry Type 0: Processor.
|
---|
108 | //
|
---|
109 | #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_PROCESSOR 0x00
|
---|
110 | typedef struct {
|
---|
111 | UINT8 EntryType;
|
---|
112 | UINT8 Id;
|
---|
113 | UINT8 Ver;
|
---|
114 | struct {
|
---|
115 | UINT8 Enabled : 1;
|
---|
116 | UINT8 Bsp : 1;
|
---|
117 | UINT8 Reserved : 6;
|
---|
118 | } Flags;
|
---|
119 | struct {
|
---|
120 | UINT32 Stepping : 4;
|
---|
121 | UINT32 Model : 4;
|
---|
122 | UINT32 Family : 4;
|
---|
123 | UINT32 Reserved : 20;
|
---|
124 | } Signature;
|
---|
125 | struct {
|
---|
126 | UINT32 Fpu : 1;
|
---|
127 | UINT32 Reserved1 : 6;
|
---|
128 | UINT32 Mce : 1;
|
---|
129 | UINT32 Cx8 : 1;
|
---|
130 | UINT32 Apic : 1;
|
---|
131 | UINT32 Reserved2 : 22;
|
---|
132 | } Features;
|
---|
133 | UINT32 Reserved1;
|
---|
134 | UINT32 Reserved2;
|
---|
135 | } EFI_LEGACY_MP_TABLE_ENTRY_PROCESSOR;
|
---|
136 |
|
---|
137 | //
|
---|
138 | // Entry Type 1: Bus.
|
---|
139 | //
|
---|
140 | #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_BUS 0x01
|
---|
141 | typedef struct {
|
---|
142 | UINT8 EntryType;
|
---|
143 | UINT8 Id;
|
---|
144 | CHAR8 TypeString[6];
|
---|
145 | } EFI_LEGACY_MP_TABLE_ENTRY_BUS;
|
---|
146 |
|
---|
147 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUS "CBUS " // Corollary CBus
|
---|
148 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_CBUSII "CBUSII" // Corollary CBUS II
|
---|
149 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_EISA "EISA " // Extended ISA
|
---|
150 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_FUTURE "FUTURE" // IEEE FutureBus
|
---|
151 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_INTERN "INTERN" // Internal bus
|
---|
152 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_ISA "ISA " // Industry Standard Architecture
|
---|
153 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBI "MBI " // Multibus I
|
---|
154 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MBII "MBII " // Multibus II
|
---|
155 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MCA "MCA " // Micro Channel Architecture
|
---|
156 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPI "MPI " // MPI
|
---|
157 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_MPSA "MPSA " // MPSA
|
---|
158 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_NUBUS "NUBUS " // Apple Macintosh NuBus
|
---|
159 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCI "PCI " // Peripheral Component Interconnect
|
---|
160 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_PCMCIA "PCMCIA" // PC Memory Card International Assoc.
|
---|
161 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_TC "TC " // DEC TurboChannel
|
---|
162 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VL "VL " // VESA Local Bus
|
---|
163 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_VME "VME " // VMEbus
|
---|
164 | #define EFI_LEGACY_MP_TABLE_ENTRY_BUS_STRING_XPRESS "XPRESS" // Express System Bus
|
---|
165 | //
|
---|
166 | // Entry Type 2: I/O APIC.
|
---|
167 | //
|
---|
168 | #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IOAPIC 0x02
|
---|
169 | typedef struct {
|
---|
170 | UINT8 EntryType;
|
---|
171 | UINT8 Id;
|
---|
172 | UINT8 Ver;
|
---|
173 | struct {
|
---|
174 | UINT8 Enabled : 1;
|
---|
175 | UINT8 Reserved : 7;
|
---|
176 | } Flags;
|
---|
177 | UINT32 Address;
|
---|
178 | } EFI_LEGACY_MP_TABLE_ENTRY_IOAPIC;
|
---|
179 |
|
---|
180 | //
|
---|
181 | // Entry Type 3: I/O Interrupt Assignment.
|
---|
182 | //
|
---|
183 | #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_IO_INT 0x03
|
---|
184 | typedef struct {
|
---|
185 | UINT8 EntryType;
|
---|
186 | UINT8 IntType;
|
---|
187 | struct {
|
---|
188 | UINT16 Polarity : 2;
|
---|
189 | UINT16 Trigger : 2;
|
---|
190 | UINT16 Reserved : 12;
|
---|
191 | } Flags;
|
---|
192 | UINT8 SourceBusId;
|
---|
193 | union {
|
---|
194 | struct {
|
---|
195 | UINT8 IntNo : 2;
|
---|
196 | UINT8 Dev : 5;
|
---|
197 | UINT8 Reserved : 1;
|
---|
198 | } fields;
|
---|
199 | UINT8 byte;
|
---|
200 | } SourceBusIrq;
|
---|
201 | UINT8 DestApicId;
|
---|
202 | UINT8 DestApicIntIn;
|
---|
203 | } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT;
|
---|
204 |
|
---|
205 | typedef enum {
|
---|
206 | EfiLegacyMpTableEntryIoIntTypeInt = 0,
|
---|
207 | EfiLegacyMpTableEntryIoIntTypeNmi = 1,
|
---|
208 | EfiLegacyMpTableEntryIoIntTypeSmi = 2,
|
---|
209 | EfiLegacyMpTableEntryIoIntTypeExtInt= 3,
|
---|
210 | } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_TYPE;
|
---|
211 |
|
---|
212 | typedef enum {
|
---|
213 | EfiLegacyMpTableEntryIoIntFlagsPolaritySpec = 0x0,
|
---|
214 | EfiLegacyMpTableEntryIoIntFlagsPolarityActiveHigh = 0x1,
|
---|
215 | EfiLegacyMpTableEntryIoIntFlagsPolarityReserved = 0x2,
|
---|
216 | EfiLegacyMpTableEntryIoIntFlagsPolarityActiveLow = 0x3,
|
---|
217 | } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_POLARITY;
|
---|
218 |
|
---|
219 | typedef enum {
|
---|
220 | EfiLegacyMpTableEntryIoIntFlagsTriggerSpec = 0x0,
|
---|
221 | EfiLegacyMpTableEntryIoIntFlagsTriggerEdge = 0x1,
|
---|
222 | EfiLegacyMpTableEntryIoIntFlagsTriggerReserved = 0x2,
|
---|
223 | EfiLegacyMpTableEntryIoIntFlagsTriggerLevel = 0x3,
|
---|
224 | } EFI_LEGACY_MP_TABLE_ENTRY_IO_INT_FLAGS_TRIGGER;
|
---|
225 |
|
---|
226 | //
|
---|
227 | // Entry Type 4: Local Interrupt Assignment.
|
---|
228 | //
|
---|
229 | #define EFI_LEGACY_MP_TABLE_ENTRY_TYPE_LOCAL_INT 0x04
|
---|
230 | typedef struct {
|
---|
231 | UINT8 EntryType;
|
---|
232 | UINT8 IntType;
|
---|
233 | struct {
|
---|
234 | UINT16 Polarity : 2;
|
---|
235 | UINT16 Trigger : 2;
|
---|
236 | UINT16 Reserved : 12;
|
---|
237 | } Flags;
|
---|
238 | UINT8 SourceBusId;
|
---|
239 | UINT8 SourceBusIrq;
|
---|
240 | UINT8 DestApicId;
|
---|
241 | UINT8 DestApicIntIn;
|
---|
242 | } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT;
|
---|
243 |
|
---|
244 | typedef enum {
|
---|
245 | EfiLegacyMpTableEntryLocalIntTypeInt = 0,
|
---|
246 | EfiLegacyMpTableEntryLocalIntTypeNmi = 1,
|
---|
247 | EfiLegacyMpTableEntryLocalIntTypeSmi = 2,
|
---|
248 | EfiLegacyMpTableEntryLocalIntTypeExtInt = 3,
|
---|
249 | } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_TYPE;
|
---|
250 |
|
---|
251 | typedef enum {
|
---|
252 | EfiLegacyMpTableEntryLocalIntFlagsPolaritySpec = 0x0,
|
---|
253 | EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveHigh= 0x1,
|
---|
254 | EfiLegacyMpTableEntryLocalIntFlagsPolarityReserved = 0x2,
|
---|
255 | EfiLegacyMpTableEntryLocalIntFlagsPolarityActiveLow = 0x3,
|
---|
256 | } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_POLARITY;
|
---|
257 |
|
---|
258 | typedef enum {
|
---|
259 | EfiLegacyMpTableEntryLocalIntFlagsTriggerSpec = 0x0,
|
---|
260 | EfiLegacyMpTableEntryLocalIntFlagsTriggerEdge = 0x1,
|
---|
261 | EfiLegacyMpTableEntryLocalIntFlagsTriggerReserved = 0x2,
|
---|
262 | EfiLegacyMpTableEntryLocalIntFlagsTriggerLevel = 0x3,
|
---|
263 | } EFI_LEGACY_MP_TABLE_ENTRY_LOCAL_INT_FLAGS_TRIGGER;
|
---|
264 |
|
---|
265 | //
|
---|
266 | // Entry Type 128: System Address Space Mapping.
|
---|
267 | //
|
---|
268 | #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_SYS_ADDR_SPACE_MAPPING 0x80
|
---|
269 | typedef struct {
|
---|
270 | UINT8 EntryType;
|
---|
271 | UINT8 Length;
|
---|
272 | UINT8 BusId;
|
---|
273 | UINT8 AddressType;
|
---|
274 | UINT64 AddressBase;
|
---|
275 | UINT64 AddressLength;
|
---|
276 | } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING;
|
---|
277 |
|
---|
278 | typedef enum {
|
---|
279 | EfiLegacyMpTableEntryExtSysAddrSpaceMappingIo = 0,
|
---|
280 | EfiLegacyMpTableEntryExtSysAddrSpaceMappingMemory = 1,
|
---|
281 | EfiLegacyMpTableEntryExtSysAddrSpaceMappingPrefetch = 2,
|
---|
282 | } EFI_LEGACY_MP_TABLE_ENTRY_EXT_SYS_ADDR_SPACE_MAPPING_TYPE;
|
---|
283 |
|
---|
284 | //
|
---|
285 | // Entry Type 129: Bus Hierarchy.
|
---|
286 | //
|
---|
287 | #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_BUS_HIERARCHY 0x81
|
---|
288 | typedef struct {
|
---|
289 | UINT8 EntryType;
|
---|
290 | UINT8 Length;
|
---|
291 | UINT8 BusId;
|
---|
292 | struct {
|
---|
293 | UINT8 SubtractiveDecode : 1;
|
---|
294 | UINT8 Reserved : 7;
|
---|
295 | } BusInfo;
|
---|
296 | UINT8 ParentBus;
|
---|
297 | UINT8 Reserved1;
|
---|
298 | UINT8 Reserved2;
|
---|
299 | UINT8 Reserved3;
|
---|
300 | } EFI_LEGACY_MP_TABLE_ENTRY_EXT_BUS_HIERARCHY;
|
---|
301 |
|
---|
302 | //
|
---|
303 | // Entry Type 130: Compatibility Bus Address Space Modifier.
|
---|
304 | //
|
---|
305 | #define EFI_LEGACY_MP_TABLE_ENTRY_EXT_TYPE_COMPAT_BUS_ADDR_SPACE_MODIFIER 0x82
|
---|
306 | typedef struct {
|
---|
307 | UINT8 EntryType;
|
---|
308 | UINT8 Length;
|
---|
309 | UINT8 BusId;
|
---|
310 | struct {
|
---|
311 | UINT8 RangeMode : 1;
|
---|
312 | UINT8 Reserved : 7;
|
---|
313 | } AddrMode;
|
---|
314 | UINT32 PredefinedRangeList;
|
---|
315 | } EFI_LEGACY_MP_TABLE_ENTRY_EXT_COMPAT_BUS_ADDR_SPACE_MODIFIER;
|
---|
316 |
|
---|
317 | #pragma pack(pop)
|
---|
318 |
|
---|
319 | #endif
|
---|