]>
Commit | Line | Data |
---|---|---|
1 | /*++\r | |
2 | \r | |
3 | Copyright (c) 2006 - 2007, Intel Corporation<BR>\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | EfiScriptLib.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | \r | |
19 | --*/\r | |
20 | \r | |
21 | #ifndef _BOOT_SCRIPT_LIB_H_\r | |
22 | #define _BOOT_SCRIPT_LIB_H_\r | |
23 | \r | |
24 | #include <PiPei.h>\r | |
25 | #include <Ppi/BootScriptExecuter.h>\r | |
26 | \r | |
27 | #include <IndustryStandard/SmBus.h>\r | |
28 | \r | |
29 | EFI_STATUS\r | |
30 | EFIAPI\r | |
31 | BootScriptSaveIoWrite (\r | |
32 | IN UINT16 TableName,\r | |
33 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
34 | IN UINT64 Address,\r | |
35 | IN UINTN Count,\r | |
36 | IN VOID *Buffer\r | |
37 | )\r | |
38 | /*++\r | |
39 | \r | |
40 | Routine Description:\r | |
41 | \r | |
42 | Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE\r | |
43 | \r | |
44 | Arguments:\r | |
45 | \r | |
46 | TableName - Desired boot script table\r | |
47 | \r | |
48 | Width - The width of the I/O operations.\r | |
49 | \r | |
50 | Address - The base address of the I/O operations.\r | |
51 | \r | |
52 | Count - The number of I/O operations to perform.\r | |
53 | \r | |
54 | Buffer - The source buffer from which to write data. \r | |
55 | \r | |
56 | Returns: \r | |
57 | \r | |
58 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
59 | \r | |
60 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
61 | \r | |
62 | --*/\r | |
63 | ;\r | |
64 | \r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | BootScriptSaveIoReadWrite (\r | |
68 | IN UINT16 TableName,\r | |
69 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
70 | IN UINT64 Address,\r | |
71 | IN VOID *Data,\r | |
72 | IN VOID *DataMask\r | |
73 | )\r | |
74 | /*++\r | |
75 | \r | |
76 | Routine Description:\r | |
77 | \r | |
78 | Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE\r | |
79 | \r | |
80 | Arguments:\r | |
81 | \r | |
82 | TableName - Desired boot script table\r | |
83 | \r | |
84 | Width - The width of the I/O operations.\r | |
85 | \r | |
86 | Address - The base address of the I/O operations.\r | |
87 | \r | |
88 | Data - A pointer to the data to be OR-ed.\r | |
89 | \r | |
90 | DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r | |
91 | \r | |
92 | Returns: \r | |
93 | \r | |
94 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
95 | \r | |
96 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
97 | \r | |
98 | --*/\r | |
99 | ;\r | |
100 | \r | |
101 | EFI_STATUS\r | |
102 | EFIAPI\r | |
103 | BootScriptSaveMemWrite (\r | |
104 | IN UINT16 TableName,\r | |
105 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
106 | IN UINT64 Address,\r | |
107 | IN UINTN Count,\r | |
108 | IN VOID *Buffer\r | |
109 | )\r | |
110 | /*++\r | |
111 | \r | |
112 | Routine Description:\r | |
113 | \r | |
114 | Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE\r | |
115 | \r | |
116 | Arguments:\r | |
117 | \r | |
118 | TableName - Desired boot script table\r | |
119 | \r | |
120 | Width - The width of the memory operations.\r | |
121 | \r | |
122 | Address - The base address of the memory operations.\r | |
123 | \r | |
124 | Count - The number of memory operations to perform.\r | |
125 | \r | |
126 | Buffer - The source buffer from which to write the data. \r | |
127 | \r | |
128 | Returns: \r | |
129 | \r | |
130 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
131 | \r | |
132 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
133 | \r | |
134 | --*/\r | |
135 | ;\r | |
136 | \r | |
137 | EFI_STATUS\r | |
138 | EFIAPI\r | |
139 | BootScriptSaveMemReadWrite (\r | |
140 | IN UINT16 TableName,\r | |
141 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
142 | IN UINT64 Address,\r | |
143 | IN VOID *Data,\r | |
144 | IN VOID *DataMask\r | |
145 | )\r | |
146 | /*++\r | |
147 | \r | |
148 | Routine Description:\r | |
149 | \r | |
150 | Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE\r | |
151 | \r | |
152 | Arguments:\r | |
153 | \r | |
154 | TableName - Desired boot script table\r | |
155 | \r | |
156 | Width - The width of the memory operations.\r | |
157 | \r | |
158 | Address - The base address of the memory operations.\r | |
159 | \r | |
160 | Data - A pointer to the data to be OR-ed.\r | |
161 | \r | |
162 | DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r | |
163 | \r | |
164 | Returns: \r | |
165 | \r | |
166 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
167 | \r | |
168 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
169 | \r | |
170 | --*/\r | |
171 | ;\r | |
172 | \r | |
173 | EFI_STATUS\r | |
174 | EFIAPI\r | |
175 | BootScriptSavePciCfgWrite (\r | |
176 | IN UINT16 TableName,\r | |
177 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
178 | IN UINT64 Address,\r | |
179 | IN UINTN Count,\r | |
180 | IN VOID *Buffer\r | |
181 | )\r | |
182 | /*++\r | |
183 | \r | |
184 | Routine Description:\r | |
185 | \r | |
186 | Save PCI configuration space write operation to boot script with opcode \r | |
187 | EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE\r | |
188 | \r | |
189 | Arguments:\r | |
190 | \r | |
191 | TableName - Desired boot script table\r | |
192 | \r | |
193 | Width - The width of the PCI operations\r | |
194 | \r | |
195 | Address - The address within the PCI configuration space.\r | |
196 | \r | |
197 | Count - The number of PCI operations to perform.\r | |
198 | \r | |
199 | Buffer - The source buffer from which to write the data.\r | |
200 | \r | |
201 | Returns: \r | |
202 | \r | |
203 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
204 | \r | |
205 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
206 | \r | |
207 | --*/\r | |
208 | ;\r | |
209 | \r | |
210 | EFI_STATUS\r | |
211 | EFIAPI\r | |
212 | BootScriptSavePciCfgReadWrite (\r | |
213 | IN UINT16 TableName,\r | |
214 | IN EFI_BOOT_SCRIPT_WIDTH Width,\r | |
215 | IN UINT64 Address,\r | |
216 | IN VOID *Data,\r | |
217 | IN VOID *DataMask\r | |
218 | )\r | |
219 | /*++\r | |
220 | \r | |
221 | Routine Description:\r | |
222 | \r | |
223 | Save PCI configuration space modify operation to boot script with opcode \r | |
224 | EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE\r | |
225 | \r | |
226 | Arguments:\r | |
227 | \r | |
228 | TableName - Desired boot script table\r | |
229 | \r | |
230 | Width - The width of the PCI operations\r | |
231 | \r | |
232 | Address - The address within the PCI configuration space.\r | |
233 | \r | |
234 | Data - A pointer to the data to be OR-ed.\r | |
235 | \r | |
236 | DataMask - A pointer to the data mask to be AND-ed with the data read from the register.\r | |
237 | \r | |
238 | Returns: \r | |
239 | \r | |
240 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
241 | \r | |
242 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
243 | \r | |
244 | --*/\r | |
245 | ;\r | |
246 | \r | |
247 | EFI_STATUS\r | |
248 | EFIAPI\r | |
249 | BootScriptSaveSmbusExecute (\r | |
250 | IN UINT16 TableName,\r | |
251 | IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r | |
252 | IN EFI_SMBUS_DEVICE_COMMAND Command,\r | |
253 | IN EFI_SMBUS_OPERATION Operation,\r | |
254 | IN BOOLEAN PecCheck,\r | |
255 | IN UINTN *Length,\r | |
256 | IN VOID *Buffer\r | |
257 | )\r | |
258 | /*++\r | |
259 | \r | |
260 | Routine Description:\r | |
261 | \r | |
262 | Save SMBus command execution to boot script with opcode \r | |
263 | EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE\r | |
264 | \r | |
265 | Arguments:\r | |
266 | \r | |
267 | TableName - Desired boot script table\r | |
268 | SlaveAddress - The SMBus address for the slave device that the operation is targeting.\r | |
269 | Command - The command that is transmitted by the SMBus host controller to the \r | |
270 | SMBus slave device.\r | |
271 | Operation - Indicates which particular SMBus protocol it will use to execute the \r | |
272 | SMBus transactions.\r | |
273 | PecCheck - Defines if Packet Error Code (PEC) checking is required for this operation.\r | |
274 | Length - A pointer to signify the number of bytes that this operation will do.\r | |
275 | Buffer - Contains the value of data to execute to the SMBUS slave device.\r | |
276 | \r | |
277 | Returns:\r | |
278 | \r | |
279 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
280 | \r | |
281 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
282 | \r | |
283 | --*/\r | |
284 | ;\r | |
285 | \r | |
286 | EFI_STATUS\r | |
287 | EFIAPI\r | |
288 | BootScriptSaveStall (\r | |
289 | IN UINT16 TableName,\r | |
290 | IN UINTN Duration\r | |
291 | )\r | |
292 | /*++\r | |
293 | \r | |
294 | Routine Description:\r | |
295 | \r | |
296 | Save execution stall on the processor to boot script with opcode \r | |
297 | EFI_BOOT_SCRIPT_STALL_OPCODE\r | |
298 | \r | |
299 | Arguments:\r | |
300 | \r | |
301 | TableName - Desired boot script table\r | |
302 | \r | |
303 | Duration - Duration in microseconds of the stall.\r | |
304 | \r | |
305 | Returns:\r | |
306 | \r | |
307 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
308 | \r | |
309 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
310 | \r | |
311 | --*/\r | |
312 | ;\r | |
313 | \r | |
314 | EFI_STATUS\r | |
315 | EFIAPI\r | |
316 | BootScriptSaveDispatch (\r | |
317 | IN UINT16 TableName,\r | |
318 | IN EFI_PHYSICAL_ADDRESS EntryPoint\r | |
319 | )\r | |
320 | /*++\r | |
321 | \r | |
322 | Routine Description:\r | |
323 | \r | |
324 | Save dispatching specified arbitrary code to boot script with opcode \r | |
325 | EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r | |
326 | \r | |
327 | Arguments:\r | |
328 | \r | |
329 | TableName - Desired boot script table\r | |
330 | \r | |
331 | EntryPoint - Entry point of the code to be dispatched.\r | |
332 | \r | |
333 | Returns:\r | |
334 | \r | |
335 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
336 | \r | |
337 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
338 | \r | |
339 | --*/\r | |
340 | ;\r | |
341 | \r | |
342 | EFI_STATUS\r | |
343 | EFIAPI\r | |
344 | BootScriptSaveDispatch2 (\r | |
345 | IN UINT16 TableName,\r | |
346 | IN EFI_PHYSICAL_ADDRESS EntryPoint,\r | |
347 | IN EFI_PHYSICAL_ADDRESS Context\r | |
348 | )\r | |
349 | /*++\r | |
350 | \r | |
351 | Routine Description:\r | |
352 | \r | |
353 | Save dispatching specified arbitrary code to boot script with opcode \r | |
354 | EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r | |
355 | \r | |
356 | Arguments:\r | |
357 | \r | |
358 | TableName - Desired boot script table\r | |
359 | \r | |
360 | EntryPoint - Entry point of the code to be dispatched.\r | |
361 | \r | |
362 | Context - The data that will be passed into code.\r | |
363 | \r | |
364 | Returns:\r | |
365 | \r | |
366 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
367 | \r | |
368 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
369 | \r | |
370 | --*/\r | |
371 | ;\r | |
372 | \r | |
373 | EFI_STATUS\r | |
374 | EFIAPI\r | |
375 | BootScriptSaveDispatch2Image (\r | |
376 | IN UINT16 TableName,\r | |
377 | IN EFI_GUID *FfsName,\r | |
378 | IN EFI_PHYSICAL_ADDRESS Context,\r | |
379 | IN EFI_HANDLE ParentHandle\r | |
380 | )\r | |
381 | /*++\r | |
382 | \r | |
383 | Routine Description:\r | |
384 | \r | |
385 | Save dispatching specified arbitrary code to boot script with opcode \r | |
386 | EFI_BOOT_SCRIPT_DISPATCH_OPCODE\r | |
387 | \r | |
388 | Arguments:\r | |
389 | \r | |
390 | TableName - Desired boot script table\r | |
391 | \r | |
392 | FfsName - The file name of the code to be dispatched.\r | |
393 | \r | |
394 | Context - The data that will be passed into code.\r | |
395 | \r | |
396 | ParentHandle - The caller's image handle.\r | |
397 | \r | |
398 | Returns:\r | |
399 | \r | |
400 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
401 | \r | |
402 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
403 | \r | |
404 | --*/\r | |
405 | ;\r | |
406 | \r | |
407 | EFI_STATUS\r | |
408 | EFIAPI\r | |
409 | BootScriptSaveInformation (\r | |
410 | IN UINT16 TableName,\r | |
411 | IN UINT32 Length, \r | |
412 | IN EFI_PHYSICAL_ADDRESS Buffer\r | |
413 | )\r | |
414 | /*++\r | |
415 | \r | |
416 | Routine Description:\r | |
417 | \r | |
418 | Save information specified by Buffer, length is specified by Length, to \r | |
419 | boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r | |
420 | \r | |
421 | Arguments:\r | |
422 | \r | |
423 | TableName - Desired boot script table\r | |
424 | \r | |
425 | FfsName - The file name of the code to be dispatched.\r | |
426 | \r | |
427 | Context - The data that will be passed into code.\r | |
428 | \r | |
429 | ParentHandle - The caller's image handle.\r | |
430 | \r | |
431 | Returns:\r | |
432 | \r | |
433 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
434 | \r | |
435 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
436 | \r | |
437 | --*/\r | |
438 | ;\r | |
439 | \r | |
440 | EFI_STATUS\r | |
441 | EFIAPI\r | |
442 | BootScriptSaveInformationUnicodeString (\r | |
443 | IN UINT16 TableName,\r | |
444 | IN CONST CHAR16 *String\r | |
445 | )\r | |
446 | /*++\r | |
447 | \r | |
448 | Routine Description:\r | |
449 | \r | |
450 | Save unicode string information specified by Buffer to \r | |
451 | boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r | |
452 | \r | |
453 | Arguments:\r | |
454 | \r | |
455 | TableName - Desired boot script table\r | |
456 | \r | |
457 | FfsName - The file name of the code to be dispatched.\r | |
458 | \r | |
459 | Context - The data that will be passed into code.\r | |
460 | \r | |
461 | ParentHandle - The caller's image handle.\r | |
462 | \r | |
463 | Returns:\r | |
464 | \r | |
465 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
466 | \r | |
467 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
468 | \r | |
469 | --*/\r | |
470 | ;\r | |
471 | \r | |
472 | EFI_STATUS\r | |
473 | EFIAPI\r | |
474 | BootScriptSaveInformationAsciiString (\r | |
475 | IN UINT16 TableName,\r | |
476 | IN CONST CHAR8 *String\r | |
477 | )\r | |
478 | /*++\r | |
479 | \r | |
480 | Routine Description:\r | |
481 | \r | |
482 | Save ASCII string information specified by Buffer to \r | |
483 | boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE\r | |
484 | \r | |
485 | Arguments:\r | |
486 | \r | |
487 | TableName - Desired boot script table\r | |
488 | \r | |
489 | FfsName - The file name of the code to be dispatched.\r | |
490 | \r | |
491 | Context - The data that will be passed into code.\r | |
492 | \r | |
493 | ParentHandle - The caller's image handle.\r | |
494 | \r | |
495 | Returns:\r | |
496 | \r | |
497 | EFI_NOT_FOUND - BootScriptSave Protocol not exist.\r | |
498 | \r | |
499 | EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS\r | |
500 | \r | |
501 | --*/\r | |
502 | ;\r | |
503 | \r | |
504 | EFI_STATUS\r | |
505 | EFIAPI\r | |
506 | BootScriptSaveInitialize (\r | |
507 | IN EFI_HANDLE ImageHandle,\r | |
508 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
509 | )\r | |
510 | /*++\r | |
511 | \r | |
512 | Routine Description:\r | |
513 | \r | |
514 | Intialize Boot Script Lib if it has not yet been initialized. \r | |
515 | \r | |
516 | Arguments:\r | |
517 | \r | |
518 | ImageHandle - The firmware allocated handle for the EFI image.\r | |
519 | \r | |
520 | SystemTable - A pointer to the EFI System Table.\r | |
521 | \r | |
522 | Returns: \r | |
523 | \r | |
524 | EFI_STATUS always returns EFI_SUCCESS\r | |
525 | \r | |
526 | --*/\r | |
527 | ; \r | |
528 | #endif\r | |
529 | \r | |
530 | \r |