]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Framework/Protocol/LegacyBiosPlatform/LegacyBiosPlatform.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Protocol / LegacyBiosPlatform / LegacyBiosPlatform.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 1999 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials\r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12\r
13Module Name:\r
14\r
15 LegacyBiosPlatform.h\r
16 \r
17Abstract:\r
18\r
19 The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16 \r
20 implementation with this EFI code. The EFI driver that produces \r
21 the Legacy BIOS protocol is generic and consumes this protocol.\r
22 A driver that matches the Legacy16 produces this protocol\r
23 \r
24Revision History\r
25\r
26 The EFI Legacy BIOS Platform Protocol is compliant with CSM spec 0.96.\r
27\r
28--*/\r
29\r
30#ifndef _EFI_LEGACY_BIOS_PLATFORM_H\r
31#define _EFI_LEGACY_BIOS_PLATFORM_H\r
32\r
33#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
34 { \\r
7ccf38a3 35 0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4} \\r
3eb9473e 36 }\r
37\r
38EFI_FORWARD_DECLARATION (EFI_LEGACY_BIOS_PLATFORM_PROTOCOL);\r
39\r
40#include "Tiano.h"\r
41#include EFI_PROTOCOL_DEFINITION (LegacyBios)\r
42\r
43#pragma pack(1)\r
44//\r
45// Define structures for GetOemIntData\r
46// Note:\r
47// OemIntDataElenent is an array of structures from 0 to Count-1.\r
48// RawData is an array of bytes from 0 to RamDataLength-1.\r
49//\r
50typedef struct {\r
51 UINT16 Int;\r
52 UINT16 Ax;\r
53 UINT32 RawDataLength;\r
54 UINT8 RawData[1];\r
55} EFI_OEM_INT_DATA_ELEMENT;\r
56\r
57typedef struct {\r
58 UINT16 Count;\r
59 EFI_OEM_INT_DATA_ELEMENT OemIntDataElement[1];\r
60} EFI_OEM_INT_DATA;\r
61#pragma pack()\r
62\r
63typedef enum {\r
64 EfiGetPlatformBinaryMpTable = 0,\r
65 EfiGetPlatformBinaryOemIntData = 1,\r
66 EfiGetPlatformBinaryOem16Data = 2,\r
67 EfiGetPlatformBinaryOem32Data = 3,\r
68 EfiGetPlatformBinaryTpmBinary = 4,\r
69 EfiGetPlatformBinarySystemRom = 5,\r
70 EfiGetPlatformPciExpressBase = 6,\r
71 EfiGetPlatformPmmSize = 7,\r
72 EfiGetPlatformEndOfOpromShadowAddr = 8\r
73} EFI_GET_PLATFORM_INFO_MODE;\r
74\r
75typedef enum {\r
76 EfiGetPlatformVgaHandle = 0,\r
77 EfiGetPlatformIdeHandle = 1,\r
78 EfiGetPlatformIsaBusHandle = 2,\r
79 EfiGetPlatformUsbHandle = 3\r
80} EFI_GET_PLATFORM_HANDLE_MODE;\r
81\r
82typedef enum {\r
83 EfiPlatformHookPrepareToScanRom = 0,\r
84 EfiPlatformHookShadowServiceRoms= 1,\r
85 EfiPlatformHookAfterRomInit = 2\r
86} EFI_GET_PLATFORM_HOOK_MODE;\r
87\r
88typedef\r
89EFI_STATUS\r
90(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (\r
91 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
92 IN EFI_GET_PLATFORM_INFO_MODE Mode,\r
93 OUT VOID **Table,\r
94 OUT UINTN *TableSize,\r
95 OUT UINTN *Location,\r
96 OUT UINTN *Alignment,\r
97 IN UINT16 LegacySegment,\r
98 IN UINT16 LegacyOffset\r
99 )\r
100/*++\r
101\r
102 Routine Description:\r
103 Return a System ROM image for the platform\r
104\r
105 Arguments:\r
106 This - Protocol instance pointer.\r
107 Mode - Specifies what data to return\r
108 Table - Pointer to MP table.\r
109 TableSize - Size in bytes of table.\r
110 Location - Legacy region requested\r
111 0x00 = Any location\r
112 Bit 0 = 0xF0000 region\r
113 Bit 1 = 0xE0000 region\r
114 Multiple bits can be set\r
115 Alignment - Address alignment for allocation.\r
116 Bit mapped. First non-zero bit from right\r
117 is alignment.\r
118 \r
119 LegacySegment - Segment in LegacyBios where Table is stored\r
120 LegacyOffset - Offset in LegacyBios where Table is stored\r
121\r
122 Returns:\r
123 EFI_SUCCESS - Data was returned successfully.\r
124 EFI_UNSUPPORTED - Mode is not supported on the platform.\r
125 EFI_NOT_FOUND - Binary image or table not found.\r
126\r
127--*/\r
128;\r
129\r
130typedef\r
131EFI_STATUS\r
132(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (\r
133 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
134 IN EFI_GET_PLATFORM_HANDLE_MODE Mode,\r
135 IN UINT16 Type,\r
136 OUT EFI_HANDLE **HandleBuffer,\r
137 OUT UINTN *HandleCount,\r
138 IN VOID **AdditionalData OPTIONAL\r
139 )\r
140/*++\r
141\r
142 Routine Description:\r
143 Return the Legacy16 policy for which device should be the VGA controller\r
144 used during a Legacy16 boot.\r
145\r
146 Arguments:\r
147 This - Protocol instance pointer.\r
148 Mode - Specifies what handle to return.\r
149 Type - Type from Device Path for Handle to represent.\r
150 HandleBuffer - Handles of the device/controller in priority order \r
151 with HandleBuffer[0] highest priority.\r
152 HandleCount - Number of handles in the buffer.\r
153 AdditionalData - Mode specific.\r
154\r
155\r
156 Returns:\r
157 EFI_SUCCESS - Handle is valid\r
158 EFI_UNSUPPORTED - Mode is not supported on the platform.\r
159 EFI_NOT_FOUND - Handle is not known\r
160\r
161--*/\r
162;\r
163\r
164typedef\r
165EFI_STATUS\r
166(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (\r
167 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
168 IN VOID *EfiToLegacy16BootTable\r
169 );\r
170\r
171/*++\r
172\r
173 Routine Description:\r
174 Load and initialize the Legacy BIOS SMM handler.\r
175\r
176 Arguments:\r
177 This - Protocol instance pointer.\r
178 EfiToLegacy16BootTable - Pointer to Legacy16 boot table.\r
179 Returns:\r
180 EFI_SUCCESS - SMM code loaded.\r
181 EFI_DEVICE_ERROR - SMM code failed to load\r
182\r
183--*/\r
184;\r
185\r
186typedef\r
187EFI_STATUS\r
188(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (\r
189 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
190 IN EFI_GET_PLATFORM_HOOK_MODE Mode,\r
191 IN UINT16 Type,\r
192 IN EFI_HANDLE DeviceHandle,\r
193 IN OUT UINTN *ShadowAddress,\r
194 IN EFI_COMPATIBILITY16_TABLE * Compatibility16Table,\r
195 IN VOID **AdditionalData OPTIONAL\r
196 )\r
197/*++\r
198\r
199 Routine Description:\r
200 Prepare to scan a ROM. \r
201\r
202 Arguments:\r
203 This - Protocol instance pointer.\r
204 Handle - Device handle\r
205 ShadowAddress - Address that ROM is shadowed at prior to \r
206 initialization or first free ROM address,\r
207 depending upon mode.\r
208 Compatibility16Table - Pointer to Compatibility16Table.\r
209 AdditionalData - Mode specific.\r
210 \r
211\r
212 Returns:\r
213 EFI_SUCCESS - RomImage is valid\r
214 EFI_UNSUPPORTED - Mode is not supported on the platform or platform \r
215 policy is to not install this OPROM.\r
216--*/\r
217;\r
218\r
219typedef\r
220EFI_STATUS\r
221(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (\r
222 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
223 OUT VOID **RoutingTable,\r
224 OUT UINTN *RoutingTableEntries,\r
225 OUT VOID **LocalPirqTable, OPTIONAL\r
226 OUT UINTN *PirqTableSize, OPTIONAL\r
227 OUT VOID **LocalIrqPriorityTable, OPTIONAL\r
228 OUT UINTN *IrqPriorityTableEntries OPTIONAL\r
229 )\r
230/*++\r
231\r
232 Routine Description:\r
233 1. List of IRQ routing entries and number of entries.\r
234 2. Pointer to Entire $PIR table and length.\r
235 3. List of IRQs to assign to PCI in priority.\r
236\r
237 Arguments:\r
238 This - Protocol instance pointer.\r
239 RoutingTable - Pointer to PCI IRQ Routing table.\r
240 RoutingTableEntries - Number of entries in table.\r
241 LocalPirqTable - $PIR table\r
242 PirqTableSize - $PIR table size\r
243 LocalIrqPriorityTable - List of interrupts in priority order to assign\r
244 IrqPriorityTableEntries- Number of entries in priority table\r
245\r
246 Returns:\r
247 EFI_SUCCESS - Table pointer returned\r
248\r
249--*/\r
250;\r
251\r
252typedef\r
253EFI_STATUS\r
254(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (\r
255 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
256 IN UINTN PciBus,\r
257 IN UINTN PciDevice,\r
258 IN UINTN PciFunction,\r
259 IN OUT UINT8 *Pirq,\r
260 OUT UINT8 *PciIrq\r
261 )\r
262/*++\r
263\r
264 Routine Description:\r
265 Translate the PIRQ reported by the PCI device into the true PIRQ \r
266 from the internal IRQ routing information and IRQ assigned or to be\r
267 assigned to device.\r
268\r
269 Arguments: \r
270 This - Protocol instance pointer.\r
271 Base as defined below is the bus,device, function in\r
272 IRQ routing table.\r
273 PciBus - Base Bus for this device.\r
274 PciDevice - Base Device for this device.\r
275 PciFunction - Base Function for this device.\r
276 Pirq - Input is PIRQ reported by device, output is true PIRQ.\r
277 PciIrq - The IRQ already assigned to the PIRQ or the IRQ to be\r
278 assigned to the PIRQ.\r
279\r
280 Returns:\r
281 EFI_SUCCESS - Irq translated\r
282\r
283--*/\r
284;\r
285\r
286typedef\r
287EFI_STATUS\r
288(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (\r
289 IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL * This,\r
290 IN BBS_BBS_DEVICE_PATH * BbsDevicePath,\r
291 IN VOID *BbsTable,\r
292 IN UINT32 LoadOptionsSize,\r
293 IN VOID *LoadOptions,\r
294 IN VOID *EfiToLegacy16BootTable\r
295 )\r
296/*++\r
297\r
298 Routine Description:\r
299 Attempt to legacy boot the BootOption. If the EFI contexted has been \r
300 compromised this function will not return.\r
301\r
302 Arguments:\r
303 This - Protocol instance pointer.\r
304 BbsDevicePath - EFI Device Path from BootXXXX variable.\r
305 BbsTable - Internal BBS table.\r
306 LoadOptionSize - Size of LoadOption in size.\r
307 LoadOption - LoadOption from BootXXXX variable\r
308 EfiToLegacy16BootTable - Pointer to BootTable structure\r
309\r
310 Returns:\r
311 EFI_SUCCESS - Removable media not present\r
312\r
313--*/\r
314;\r
315\r
5d46191d 316struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
3eb9473e 317 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;\r
318 EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;\r
319 EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;\r
320 EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;\r
321 EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;\r
322 EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;\r
323 EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;\r
5d46191d 324};\r
3eb9473e 325\r
326extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
327\r
328#endif\r