]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
Update comment in SMM Library class include file.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / LegacyBiosPlatform.h
CommitLineData
79964ac8 1/** @file\r
2 The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16\r
3 implementation with this EFI code. The EFI driver that produces\r
4 the Legacy BIOS protocol is generic and consumes this protocol.\r
5 A driver that matches the Legacy16 produces this protocol\r
6\r
7 Copyright (c) 2007, Intel Corporation\r
8 All rights reserved. This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16 Module Name: LegacyBiosPlatform.h\r
17\r
18 @par Revision Reference:\r
19 This protocol is defined in Framework for EFI Compatibility Support Module spec\r
0f899407 20 Version 0.97.\r
79964ac8 21\r
22**/\r
23\r
24#ifndef _EFI_LEGACY_BIOS_PLATFORM_H_\r
25#define _EFI_LEGACY_BIOS_PLATFORM_H_\r
26\r
b80fbe85 27#include <FrameworkDxe.h>\r
28\r
79964ac8 29#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
30 { \\r
31 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r
32 }\r
33\r
34typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r
35\r
36typedef enum {\r
37 EfiGetPlatformBinaryMpTable = 0,\r
38 EfiGetPlatformBinaryOemIntData = 1,\r
39 EfiGetPlatformBinaryOem16Data = 2,\r
40 EfiGetPlatformBinaryOem32Data = 3,\r
41 EfiGetPlatformBinaryTpmBinary = 4,\r
42 EfiGetPlatformBinarySystemRom = 5,\r
43 EfiGetPlatformPciExpressBase = 6,\r
44 EfiGetPlatformPmmSize = 7,\r
45 EfiGetPlatformEndOpromShadowAddr = 8,\r
46\r
47} EFI_GET_PLATFORM_INFO_MODE;\r
48\r
49typedef enum {\r
50 EfiGetPlatformVgaHandle = 0,\r
51 EfiGetPlatformIdeHandle = 1,\r
52 EfiGetPlatformIsaBusHandle = 2,\r
53 EfiGetPlatformUsbHandle = 3\r
54} EFI_GET_PLATFORM_HANDLE_MODE;\r
55\r
56typedef enum {\r
57 EfiPlatformHookPrepareToScanRom = 0,\r
58 EfiPlatformHookShadowServiceRoms= 1,\r
59 EfiPlatformHookAfterRomInit = 2\r
60} EFI_GET_PLATFORM_HOOK_MODE;\r
61\r
9226e4ee 62\r
63//\r
64//\r
65//\r
66\r
67#define PCI_UNUSED 0x00\r
68#define PCI_USED 0xFF\r
69#define LEGACY_USED 0xFE\r
70\r
71#pragma pack(1)\r
72\r
73//\r
74//\r
75//\r
76typedef struct {\r
77 UINT8 Irq;\r
78 UINT8 Used;\r
79} EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY;\r
80\r
81//\r
82// Define PIR table structures\r
83//\r
84#define EFI_LEGACY_PIRQ_TABLE_SIGNATURE SIGNATURE_32 ('$', 'P', 'I', 'R')\r
85\r
86typedef struct {\r
87 UINT32 Signature;\r
88 UINT8 MinorVersion;\r
89 UINT8 MajorVersion;\r
90 UINT16 TableSize;\r
91 UINT8 Bus;\r
92 UINT8 DevFun;\r
93 UINT16 PciOnlyIrq;\r
94 UINT16 CompatibleVid;\r
95 UINT16 CompatibleDid;\r
96 UINT32 Miniport;\r
97 UINT8 Reserved[11];\r
98 UINT8 Checksum;\r
99} EFI_LEGACY_PIRQ_TABLE_HEADER;\r
100\r
101\r
102typedef struct {\r
103 UINT8 Pirq;\r
104 UINT16 IrqMask;\r
105} EFI_LEGACY_PIRQ_ENTRY;\r
106\r
107typedef struct {\r
108 UINT8 Bus;\r
109 UINT8 Device;\r
110 EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];\r
111 UINT8 Slot;\r
112 UINT8 Reserved;\r
113} EFI_LEGACY_IRQ_ROUTING_ENTRY;\r
114\r
115#pragma pack()\r
116\r
117\r
79964ac8 118/**\r
119 Finds the binary data or other platform information.\r
120\r
121 @param This Protocol instance pointer.\r
122 @param Mode Specifies what data to return\r
123 @param Table Pointer to MP table.\r
124 @param TableSize Size in bytes of table.\r
125 @param Location Legacy region requested\r
126 0x00 = Any location\r
127 Bit 0 = 0xF0000 region\r
128 Bit 1 = 0xE0000 region\r
129 Multiple bits can be set\r
130 @param Alignment Address alignment for allocation.\r
131 Bit mapped. First non-zero bit from right\r
132 is alignment.\r
133 @param LegacySegment Segment in LegacyBios where Table is stored\r
134 @param LegacyOffset Offset in LegacyBios where Table is stored\r
135\r
136 @retval EFI_SUCCESS Data was returned successfully.\r
137 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
138 @retval EFI_NOT_FOUND Binary image or table not found.\r
139\r
140**/\r
141typedef\r
142EFI_STATUS\r
69686d56 143(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO)(\r
79964ac8 144 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
145 IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
146 OUT VOID **Table,\r
147 OUT UINTN *TableSize,\r
148 OUT UINTN *Location,\r
149 OUT UINTN *Alignment,\r
150 IN UINT16 LegacySegment,\r
151 IN UINT16 LegacyOffset\r
152 );\r
153\r
154/**\r
155 Returns a buffer of handles for the requested sub-function.\r
156\r
157 @param This Protocol instance pointer.\r
158 @param Mode Specifies what handle to return.\r
159 @param Type Type from Device Path for Handle to represent.\r
160 @param HandleBuffer Handles of the device/controller in priority order\r
161 with HandleBuffer[0] highest priority.\r
162 @param HandleCount Number of handles in the buffer.\r
163 @param AdditionalData Mode specific.\r
164\r
165 @retval EFI_SUCCESS Handle is valid\r
166 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
167 @retval EFI_NOT_FOUND Handle is not known\r
168\r
169**/\r
170typedef\r
171EFI_STATUS\r
69686d56 172(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE)(\r
79964ac8 173 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
174 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
175 IN UINT16 Type,\r
176 OUT EFI_HANDLE **HandleBuffer,\r
177 OUT UINTN *HandleCount,\r
178 IN VOID **AdditionalData OPTIONAL\r
179 );\r
180\r
181/**\r
182 Load and initialize the Legacy BIOS SMM handler.\r
183\r
184 @param This Protocol instance pointer.\r
185 @param EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
186\r
187 @retval EFI_SUCCESS SMM code loaded.\r
188 @retval EFI_DEVICE_ERROR SMM code failed to load\r
189\r
190**/\r
191typedef\r
192EFI_STATUS\r
69686d56 193(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT)(\r
79964ac8 194 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
195 IN VOID *EfiToLegacy16BootTable\r
196 );\r
197\r
198/**\r
199 Allows platform to perform any required action after a LegacyBios operation.\r
200\r
201 @param This Protocol instance pointer.\r
202 @param Mode Specifies what handle to return.\r
203 @param Type Mode specific.\r
204 @param DeviceHandle List of PCI devices in the system.\r
205 @param ShadowAddress First free OpROM area, after other OpROMs have been dispatched.\r
206 @param Compatibility16Table Pointer to Compatibility16Table.\r
207 @param AdditionalData Mode specific Pointer to additional data returned - mode specific.\r
208\r
209 @retval EFI_SUCCESS RomImage is valid\r
210 @retval EFI_UNSUPPORTED Mode is not supported on the platform.\r
211\r
212**/\r
213typedef\r
214EFI_STATUS\r
69686d56 215(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS)(\r
79964ac8 216 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
217 IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
218 IN UINT16 Type,\r
219 IN EFI_HANDLE DeviceHandle,\r
220 IN OUT UINTN *ShadowAddress,\r
221 IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table,\r
222 IN VOID **AdditionalData OPTIONAL\r
223 );\r
224\r
225/**\r
226 Returns information associated with PCI IRQ routing.\r
227\r
228 @param This Protocol instance pointer.\r
229 @param RoutingTable Pointer to PCI IRQ Routing table.\r
230 @param RoutingTableEntries Number of entries in table.\r
231 @param LocalPirqTable $PIR table\r
232 @param PirqTableSize $PIR table size\r
233 @param LocalIrqPriorityTable List of interrupts in priority order to assign\r
234 @param IrqPriorityTableEntries Number of entries in priority table\r
235\r
236 @retval EFI_SUCCESS Data was successfully returned.\r
237\r
238**/\r
239typedef\r
240EFI_STATUS\r
69686d56 241(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE)(\r
79964ac8 242 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
243 OUT VOID **RoutingTable,\r
244 OUT UINTN *RoutingTableEntries,\r
245 OUT VOID **LocalPirqTable, OPTIONAL\r
246 OUT UINTN *PirqTableSize, OPTIONAL\r
247 OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
248 OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
249 );\r
250\r
251/**\r
252 Translates the given PIRQ accounting for bridge\r
253\r
254 @param This Protocol instance pointer.\r
255 @param PciBus PCI bus number for this device.\r
256 @param PciDevice PCI device number for this device.\r
257 @param PciFunction PCI function number for this device.\r
258 @param Pirq Input is PIRQ reported by device, output is true PIRQ.\r
259 @param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r
260 assigned to the PIRQ.\r
261\r
262 @retval EFI_SUCCESS The PIRQ was translated.\r
263\r
264**/\r
265typedef\r
266EFI_STATUS\r
69686d56 267(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ)(\r
79964ac8 268 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
269 IN UINTN PciBus,\r
270 IN UINTN PciDevice,\r
271 IN UINTN PciFunction,\r
272 IN OUT UINT8 *Pirq,\r
273 OUT UINT8 *PciIrq\r
274 );\r
275\r
276/**\r
277 Attempt to legacy boot the BootOption. If the EFI contexted has been\r
278 compromised this function will not return.\r
279\r
280 @param This Protocol instance pointer.\r
281 @param BbsDevicePath EFI Device Path from BootXXXX variable.\r
282 @param BbsTable Internal BBS table.\r
283 @param LoadOptionSize Size of LoadOption in size.\r
284 @param LoadOption LoadOption from BootXXXX variable\r
285 @param EfiToLegacy16BootTable Pointer to BootTable structure\r
286\r
287 @retval EFI_SUCCESS Ready to boot.\r
288\r
289**/\r
290typedef\r
291EFI_STATUS\r
69686d56 292(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT)(\r
79964ac8 293 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,\r
294 IN BBS_BBS_DEVICE_PATH *BbsDevicePath,\r
295 IN VOID *BbsTable,\r
296 IN UINT32 LoadOptionsSize,\r
297 IN VOID *LoadOptions,\r
298 IN VOID *EfiToLegacy16BootTable\r
299 );\r
300\r
301/**\r
302 @par Protocol Description:\r
303 Abstracts the platform portion of the traditional BIOS.\r
304\r
305 @param GetPlatformInfo\r
306 Gets binary data or other platform information.\r
307\r
308 @param GetPlatformHandle\r
309 Returns a buffer of all handles matching the requested subfunction.\r
310\r
311 @param SmmInit\r
312 Loads and initializes the traditional BIOS SMM handler.\r
313\r
314 @param PlatformHooks\r
315 Allows platform to perform any required actions after a LegacyBios operation.\r
316\r
317 @param GetRoutingTable\r
318 Gets $PIR table.\r
319\r
320 @param TranslatePirq\r
321 Translates the given PIRQ to the final value after traversing any PCI bridges.\r
322\r
323 @param PrepareToBoot\r
324 Final platform function before the system attempts to boot to a traditional OS.\r
325\r
326**/\r
327struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
328 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
329 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
330 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
331 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
332 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
333 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
334 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
335};\r
336\r
337extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
338\r
339#endif\r