]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Defines library APIs used by modules to save EFI Boot Script Opcodes.\r | |
3 | These OpCode will be restored by S3 related modules.\r | |
4 | Note that some of the API defined in the Library class may not\r | |
5 | be provided in the Framework version library instance, which means some of these\r | |
6 | APIs cannot be used if the underlying firmware is Framework and not PI.\r | |
7 | \r | |
8 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
9 | \r | |
10 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
11 | \r | |
12 | **/\r | |
13 | \r | |
14 | #ifndef _S3_BOOT_SCRIPT_LIB_H_\r | |
15 | #define _S3_BOOT_SCRIPT_LIB_H_\r | |
16 | \r | |
17 | #include <Library/BaseLib.h>\r | |
18 | #include <IndustryStandard/SmBus.h>\r | |
19 | \r | |
20 | /**\r | |
21 | Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an\r | |
22 | address that can be passed to the S3 Boot Script Library PCI functions.\r | |
23 | \r | |
24 | @param Bus PCI Bus number. Range 0..255.\r | |
25 | @param Device PCI Device number. Range 0..31.\r | |
26 | @param Function PCI Function number. Range 0..7.\r | |
27 | @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095\r | |
28 | for PCI Express.\r | |
29 | \r | |
30 | @return The encoded PCI address.\r | |
31 | \r | |
32 | **/\r | |
33 | #define S3_BOOT_SCRIPT_LIB_PCI_ADDRESS(Bus, Device, Function, Register) \\r | |
34 | (UINT64) ( \\r | |
35 | (((UINTN) Bus) << 24) | \\r | |
36 | (((UINTN) Device) << 16) | \\r | |
37 | (((UINTN) Function) << 8) | \\r | |
38 | (((UINTN) (Register)) < 256 ? ((UINTN) (Register)) : (UINT64) (LShiftU64 ((UINT64) (Register), 32))))\r | |
39 | \r | |
40 | ///\r | |
41 | /// S3 Boot Script Width.\r | |
42 | ///\r | |
43 | typedef enum {\r | |
44 | S3BootScriptWidthUint8, ///< 8-bit operation.\r | |
45 | S3BootScriptWidthUint16, ///< 16-bit operation.\r | |
46 | S3BootScriptWidthUint32, ///< 32-bit operation.\r | |
47 | S3BootScriptWidthUint64, ///< 64-bit operation.\r | |
48 | S3BootScriptWidthFifoUint8, ///< 8-bit FIFO operation.\r | |
49 | S3BootScriptWidthFifoUint16, ///< 16-bit FIFO operation.\r | |
50 | S3BootScriptWidthFifoUint32, ///< 32-bit FIFO operation.\r | |
51 | S3BootScriptWidthFifoUint64, ///< 64-bit FIFO operation.\r | |
52 | S3BootScriptWidthFillUint8, ///< 8-bit Fill operation.\r | |
53 | S3BootScriptWidthFillUint16, ///< 16-bit Fill operation.\r | |
54 | S3BootScriptWidthFillUint32, ///< 32-bit Fill operation.\r | |
55 | S3BootScriptWidthFillUint64, ///< 64-bit Fill operation.\r | |
56 | S3BootScriptWidthMaximum\r | |
57 | } S3_BOOT_SCRIPT_LIB_WIDTH;\r | |
58 | \r | |
59 | /**\r | |
60 | Save I/O write to boot script.\r | |
61 | \r | |
62 | @param[in] Width The width of the I/O operations.\r | |
63 | @param[in] Address The base address of the I/O operations.\r | |
64 | @param[in] Count The number of I/O operations to perform.\r | |
65 | @param[in] Buffer The source buffer from which to write data.\r | |
66 | \r | |
67 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
68 | the operation.\r | |
69 | @retval RETURN_SUCCESS The opcode was added.\r | |
70 | \r | |
71 | **/\r | |
72 | RETURN_STATUS\r | |
73 | EFIAPI\r | |
74 | S3BootScriptSaveIoWrite (\r | |
75 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
76 | IN UINT64 Address,\r | |
77 | IN UINTN Count,\r | |
78 | IN VOID *Buffer\r | |
79 | );\r | |
80 | \r | |
81 | /**\r | |
82 | Adds a record for an I/O modify operation into a S3 boot script table.\r | |
83 | \r | |
84 | @param[in] Width The width of the I/O operations.\r | |
85 | @param[in] Address The base address of the I/O operations.\r | |
86 | @param[in] Data A pointer to the data to be OR-ed.\r | |
87 | @param[in] DataMask A pointer to the data mask to be AND-ed with the data\r | |
88 | read from the register.\r | |
89 | \r | |
90 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
91 | the operation.\r | |
92 | @retval RETURN_SUCCESS The opcode was added.\r | |
93 | \r | |
94 | **/\r | |
95 | RETURN_STATUS\r | |
96 | EFIAPI\r | |
97 | S3BootScriptSaveIoReadWrite (\r | |
98 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
99 | IN UINT64 Address,\r | |
100 | IN VOID *Data,\r | |
101 | IN VOID *DataMask\r | |
102 | );\r | |
103 | \r | |
104 | /**\r | |
105 | Adds a record for a memory write operation into a specified boot script table.\r | |
106 | \r | |
107 | @param[in] Width The width of the I/O operations.\r | |
108 | @param[in] Address The base address of the memory operations\r | |
109 | @param[in] Count The number of memory operations to perform.\r | |
110 | @param[in] Buffer The source buffer from which to write the data.\r | |
111 | \r | |
112 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
113 | the operation.\r | |
114 | @retval RETURN_SUCCESS The opcode was added.\r | |
115 | **/\r | |
116 | RETURN_STATUS\r | |
117 | EFIAPI\r | |
118 | S3BootScriptSaveMemWrite (\r | |
119 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
120 | IN UINT64 Address,\r | |
121 | IN UINTN Count,\r | |
122 | IN VOID *Buffer\r | |
123 | );\r | |
124 | \r | |
125 | /**\r | |
126 | Adds a record for a memory modify operation into a specified boot script table.\r | |
127 | \r | |
128 | @param[in] Width The width of the I/O operations.\r | |
129 | @param[in] Address The base address of the memory operations. Address needs\r | |
130 | alignment, if required\r | |
131 | @param[in] Data A pointer to the data to be OR-ed.\r | |
132 | @param[in] DataMask A pointer to the data mask to be AND-ed with the data\r | |
133 | read from the register.\r | |
134 | \r | |
135 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
136 | the operation.\r | |
137 | @retval RETURN_SUCCESS The opcode was added.\r | |
138 | **/\r | |
139 | RETURN_STATUS\r | |
140 | EFIAPI\r | |
141 | S3BootScriptSaveMemReadWrite (\r | |
142 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
143 | IN UINT64 Address,\r | |
144 | IN VOID *Data,\r | |
145 | IN VOID *DataMask\r | |
146 | );\r | |
147 | \r | |
148 | /**\r | |
149 | Adds a record for a PCI configuration space write operation into a specified boot script table.\r | |
150 | \r | |
151 | @param[in] Width The width of the I/O operations.\r | |
152 | @param[in] Address The address within the PCI configuration space.\r | |
153 | @param[in] Count The number of PCI operations to perform.\r | |
154 | @param[in] Buffer The source buffer from which to write the data.\r | |
155 | \r | |
156 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
157 | the operation.\r | |
158 | @retval RETURN_SUCCESS The opcode was added.\r | |
159 | **/\r | |
160 | RETURN_STATUS\r | |
161 | EFIAPI\r | |
162 | S3BootScriptSavePciCfgWrite (\r | |
163 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
164 | IN UINT64 Address,\r | |
165 | IN UINTN Count,\r | |
166 | IN VOID *Buffer\r | |
167 | );\r | |
168 | \r | |
169 | /**\r | |
170 | Adds a record for a PCI configuration space modify operation into a specified boot script table.\r | |
171 | \r | |
172 | @param[in] Width The width of the I/O operations.\r | |
173 | @param[in] Address The address within the PCI configuration space.\r | |
174 | @param[in] Data A pointer to the data to be OR-ed.The size depends on Width.\r | |
175 | @param[in] DataMask A pointer to the data mask to be AND-ed.\r | |
176 | \r | |
177 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
178 | the operation.\r | |
179 | @retval RETURN__SUCCESS The opcode was added.\r | |
180 | **/\r | |
181 | RETURN_STATUS\r | |
182 | EFIAPI\r | |
183 | S3BootScriptSavePciCfgReadWrite (\r | |
184 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
185 | IN UINT64 Address,\r | |
186 | IN VOID *Data,\r | |
187 | IN VOID *DataMask\r | |
188 | );\r | |
189 | \r | |
190 | /**\r | |
191 | Adds a record for a PCI configuration space modify operation into a specified boot script table.\r | |
192 | \r | |
193 | @param[in] Width The width of the I/O operations.\r | |
194 | @param[in] Segment The PCI segment number for Address.\r | |
195 | @param[in] Address The address within the PCI configuration space.\r | |
196 | @param[in] Count The number of PCI operations to perform.\r | |
197 | @param[in] Buffer The source buffer from which to write the data.\r | |
198 | \r | |
199 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
200 | the operation.\r | |
201 | @retval RETURN_SUCCESS The opcode was added.\r | |
202 | **/\r | |
203 | RETURN_STATUS\r | |
204 | EFIAPI\r | |
205 | S3BootScriptSavePciCfg2Write (\r | |
206 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
207 | IN UINT16 Segment,\r | |
208 | IN UINT64 Address,\r | |
209 | IN UINTN Count,\r | |
210 | IN VOID *Buffer\r | |
211 | );\r | |
212 | \r | |
213 | /**\r | |
214 | Adds a record for a PCI configuration space modify operation into a specified boot script table.\r | |
215 | \r | |
216 | @param[in] Width The width of the I/O operations.\r | |
217 | @param[in] Segment The PCI segment number for Address.\r | |
218 | @param[in] Address The address within the PCI configuration space.\r | |
219 | @param[in] Data A pointer to the data to be OR-ed. The size depends on Width.\r | |
220 | @param[in] DataMask A pointer to the data mask to be AND-ed.\r | |
221 | \r | |
222 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
223 | the operation.\r | |
224 | @retval RETURN_SUCCESS The opcode was added.\r | |
225 | **/\r | |
226 | RETURN_STATUS\r | |
227 | EFIAPI\r | |
228 | S3BootScriptSavePciCfg2ReadWrite (\r | |
229 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
230 | IN UINT16 Segment,\r | |
231 | IN UINT64 Address,\r | |
232 | IN VOID *Data,\r | |
233 | IN VOID *DataMask\r | |
234 | );\r | |
235 | \r | |
236 | /**\r | |
237 | Adds a record for an SMBus command execution into a specified boot script table.\r | |
238 | \r | |
239 | @param[in] SmBusAddress Address that encodes the SMBUS Slave Address, SMBUS\r | |
240 | Command, SMBUS Data Length, and PEC.\r | |
241 | @param[in] Operation Indicates which particular SMBus protocol it will use\r | |
242 | to execute the SMBus transactions.\r | |
243 | @param[in] Length A pointer to signify the number of bytes that this\r | |
244 | operation will do.\r | |
245 | @param[in] Buffer Contains the value of data to execute to the SMBUS\r | |
246 | slave device.\r | |
247 | \r | |
248 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
249 | the operation.\r | |
250 | @retval RETURN_SUCCESS The opcode was added.\r | |
251 | **/\r | |
252 | RETURN_STATUS\r | |
253 | EFIAPI\r | |
254 | S3BootScriptSaveSmbusExecute (\r | |
255 | IN UINTN SmBusAddress,\r | |
256 | IN EFI_SMBUS_OPERATION Operation,\r | |
257 | IN UINTN *Length,\r | |
258 | IN VOID *Buffer\r | |
259 | );\r | |
260 | \r | |
261 | /**\r | |
262 | Adds a record for an execution stall on the processor into a specified boot script table.\r | |
263 | \r | |
264 | @param[in] Duration The duration in microseconds of the stall.\r | |
265 | \r | |
266 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
267 | the operation.\r | |
268 | @retval RETURN_SUCCESS The opcode was added.\r | |
269 | **/\r | |
270 | RETURN_STATUS\r | |
271 | EFIAPI\r | |
272 | S3BootScriptSaveStall (\r | |
273 | IN UINTN Duration\r | |
274 | );\r | |
275 | \r | |
276 | /**\r | |
277 | Adds a record for dispatching specified arbitrary code into a specified boot script table.\r | |
278 | \r | |
279 | @param[in] EntryPoint The entry point of the code to be dispatched.\r | |
280 | @param[in] Context The argument to be passed into the EntryPoint of the code\r | |
281 | to be dispatched.\r | |
282 | \r | |
283 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
284 | the operation.\r | |
285 | @retval RETURN_SUCCESS The opcode was added.\r | |
286 | **/\r | |
287 | RETURN_STATUS\r | |
288 | EFIAPI\r | |
289 | S3BootScriptSaveDispatch2 (\r | |
290 | IN VOID *EntryPoint,\r | |
291 | IN VOID *Context\r | |
292 | );\r | |
293 | \r | |
294 | /**\r | |
295 | Adds a record for dispatching specified arbitrary code into a specified boot script table.\r | |
296 | \r | |
297 | @param[in] EntryPoint The entry point of the code to be dispatched.\r | |
298 | \r | |
299 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
300 | the operation.\r | |
301 | @retval RETURN_SUCCESS The opcode was added.\r | |
302 | **/\r | |
303 | RETURN_STATUS\r | |
304 | EFIAPI\r | |
305 | S3BootScriptSaveDispatch (\r | |
306 | IN VOID *EntryPoint\r | |
307 | );\r | |
308 | \r | |
309 | /**\r | |
310 | Adds a record for memory reads of the memory location and continues when the exit\r | |
311 | criteria is satisfied, or after a defined duration.\r | |
312 | \r | |
313 | Please aware, below interface is different with PI specification, Vol 5:\r | |
314 | EFI_S3_SAVE_STATE_PROTOCOL.Write() for EFI_BOOT_SCRIPT_MEM_POLL_OPCODE.\r | |
315 | "Duration" below is microseconds, while "Delay" in PI specification means\r | |
316 | the number of 100ns units to poll.\r | |
317 | \r | |
318 | @param[in] Width The width of the memory operations.\r | |
319 | @param[in] Address The base address of the memory operations.\r | |
320 | @param[in] BitMask A pointer to the bit mask to be AND-ed with the data read\r | |
321 | from the register.\r | |
322 | @param[in] BitValue A pointer to the data value after to be Masked.\r | |
323 | @param[in] Duration The duration in microseconds of the stall.\r | |
324 | @param[in] LoopTimes The times of the register polling.\r | |
325 | \r | |
326 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
327 | the operation.\r | |
328 | @retval RETURN_SUCCESS The opcode was added.\r | |
329 | \r | |
330 | **/\r | |
331 | RETURN_STATUS\r | |
332 | EFIAPI\r | |
333 | S3BootScriptSaveMemPoll (\r | |
334 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
335 | IN UINT64 Address,\r | |
336 | IN VOID *BitMask,\r | |
337 | IN VOID *BitValue,\r | |
338 | IN UINTN Duration,\r | |
339 | IN UINT64 LoopTimes\r | |
340 | );\r | |
341 | \r | |
342 | /**\r | |
343 | Store arbitrary information in the boot script table. This opcode is a no-op on\r | |
344 | dispatch and is only used for debugging script issues.\r | |
345 | \r | |
346 | @param[in] InformationLength Length of the data in bytes\r | |
347 | @param[in] Information Information to be logged in the boot scrpit\r | |
348 | \r | |
349 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
350 | the operation.\r | |
351 | @retval RETURN_SUCCESS The opcode was added.\r | |
352 | \r | |
353 | **/\r | |
354 | RETURN_STATUS\r | |
355 | EFIAPI\r | |
356 | S3BootScriptSaveInformation (\r | |
357 | IN UINT32 InformationLength,\r | |
358 | IN VOID *Information\r | |
359 | );\r | |
360 | \r | |
361 | /**\r | |
362 | Adds a record for I/O reads the I/O location and continues when the exit criteria\r | |
363 | is satisfied, or after a defined duration.\r | |
364 | \r | |
365 | @param Width The width of the I/O operations.\r | |
366 | @param Address The base address of the I/O operations.\r | |
367 | @param Data The comparison value used for the polling exit criteria.\r | |
368 | @param DataMask The mask used for the polling criteria. The bits in\r | |
369 | the bytes below Width which are zero in Data are\r | |
370 | ignored when polling the memory address.\r | |
371 | @param Delay The number of 100ns units to poll. Note that timer\r | |
372 | available may be of insufficient granularity, so the\r | |
373 | delay may be longer.\r | |
374 | \r | |
375 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r | |
376 | operation.\r | |
377 | @retval RETURN_SUCCESS The opcode was added.\r | |
378 | @note The FRAMEWORK version implementation does not support this API\r | |
379 | **/\r | |
380 | RETURN_STATUS\r | |
381 | EFIAPI\r | |
382 | S3BootScriptSaveIoPoll (\r | |
383 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
384 | IN UINT64 Address,\r | |
385 | IN VOID *Data,\r | |
386 | IN VOID *DataMask,\r | |
387 | IN UINT64 Delay\r | |
388 | );\r | |
389 | \r | |
390 | /**\r | |
391 | Adds a record for PCI configuration space reads and continues when the exit\r | |
392 | criteria is satisfied ,or after a defined duration.\r | |
393 | \r | |
394 | @param Width The width of the I/O operations.\r | |
395 | @param Address The address within the PCI configuration space.\r | |
396 | @param Data The comparison value used for the polling exit\r | |
397 | criteria.\r | |
398 | @param DataMask Mask used for the polling criteria. The bits in\r | |
399 | the bytes below Width which are zero in Data are\r | |
400 | ignored when polling the memory address.\r | |
401 | @param Delay The number of 100ns units to poll. Note that timer\r | |
402 | available may be of insufficient granularity, so the\r | |
403 | delay may be longer.\r | |
404 | \r | |
405 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r | |
406 | operation.\r | |
407 | @retval RETURN_SUCCESS The opcode was added.\r | |
408 | @note The FRAMEWORK version implementation does not support this API\r | |
409 | **/\r | |
410 | RETURN_STATUS\r | |
411 | EFIAPI\r | |
412 | S3BootScriptSavePciPoll (\r | |
413 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
414 | IN UINT64 Address,\r | |
415 | IN VOID *Data,\r | |
416 | IN VOID *DataMask,\r | |
417 | IN UINT64 Delay\r | |
418 | );\r | |
419 | \r | |
420 | /**\r | |
421 | Adds a record for PCI configuration space reads and continues when the exit criteria\r | |
422 | is satisfied, or after a defined duration.\r | |
423 | \r | |
424 | @param Width The width of the I/O operations.\r | |
425 | @param Segment The PCI segment number for Address.\r | |
426 | @param Address The address within the PCI configuration space.\r | |
427 | @param Data The comparison value used for the polling exit\r | |
428 | criteria.\r | |
429 | @param DataMask Mask used for the polling criteria. The bits in\r | |
430 | the bytes below Width which are zero\r | |
431 | in Data are ignored when polling the memory address\r | |
432 | @param Delay The number of 100ns units to poll. Note that timer\r | |
433 | available may be of insufficient granularity so the delay\r | |
434 | may be longer.\r | |
435 | \r | |
436 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform the\r | |
437 | operation.\r | |
438 | @retval RETURN_SUCCESS The opcode was added.\r | |
439 | @note A known Limitations in the implementation: When interpreting the opcode\r | |
440 | EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE, EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE\r | |
441 | and EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE, the 'Segment' parameter is assumed as\r | |
442 | Zero, or else, assert.\r | |
443 | The FRAMEWORK version implementation does not support this API.\r | |
444 | \r | |
445 | **/\r | |
446 | RETURN_STATUS\r | |
447 | EFIAPI\r | |
448 | S3BootScriptSavePci2Poll (\r | |
449 | IN S3_BOOT_SCRIPT_LIB_WIDTH Width,\r | |
450 | IN UINT16 Segment,\r | |
451 | IN UINT64 Address,\r | |
452 | IN VOID *Data,\r | |
453 | IN VOID *DataMask,\r | |
454 | IN UINT64 Delay\r | |
455 | );\r | |
456 | \r | |
457 | /**\r | |
458 | Save ASCII string information specified by Buffer to boot script with opcode\r | |
459 | EFI_BOOT_SCRIPT_INFORMATION_OPCODE.\r | |
460 | \r | |
461 | @param[in] String The Null-terminated ASCII string to store into the S3 boot\r | |
462 | script table.\r | |
463 | \r | |
464 | @retval RETURN_OUT_OF_RESOURCES Not enough memory for the table to perform\r | |
465 | the operation.\r | |
466 | @retval RETURN_SUCCESS The opcode was added.\r | |
467 | \r | |
468 | **/\r | |
469 | RETURN_STATUS\r | |
470 | EFIAPI\r | |
471 | S3BootScriptSaveInformationAsciiString (\r | |
472 | IN CONST CHAR8 *String\r | |
473 | );\r | |
474 | \r | |
475 | /**\r | |
476 | This is an function to close the S3 boot script table. The function could only\r | |
477 | be called in BOOT time phase. To comply with the Framework spec definition on\r | |
478 | EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable(), this function will fulfill following things:\r | |
479 | 1. Closes the specified boot script table\r | |
480 | 2. It allocates a new memory pool to duplicate all the boot scripts in the specified table.\r | |
481 | Once this function is called, the table maintained by the library will be destroyed\r | |
482 | after it is copied into the allocated pool.\r | |
483 | 3. Any attempts to add a script record after calling this function will cause a\r | |
484 | new table to be created by the library.\r | |
485 | 4. The base address of the allocated pool will be returned in Address. Note that\r | |
486 | after using the boot script table, the CALLER is responsible for freeing the\r | |
487 | pool that is allocated by this function.\r | |
488 | \r | |
489 | In Spec PI1.1, this EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is retired. This\r | |
490 | API is supplied here to meet the requirements of the Framework Spec.\r | |
491 | \r | |
492 | If anyone does call CloseTable() on a real platform, then the caller is responsible\r | |
493 | for figuring out how to get the script to run on an S3 resume because the boot script\r | |
494 | maintained by the lib will be destroyed.\r | |
495 | \r | |
496 | @return the base address of the new copy of the boot script table.\r | |
497 | \r | |
498 | **/\r | |
499 | UINT8 *\r | |
500 | EFIAPI\r | |
501 | S3BootScriptCloseTable (\r | |
502 | VOID\r | |
503 | );\r | |
504 | \r | |
505 | /**\r | |
506 | Executes the S3 boot script table.\r | |
507 | \r | |
508 | @retval RETURN_SUCCESS The boot script table was executed successfully.\r | |
509 | @retval RETURN_UNSUPPORTED Invalid script table or opcode.\r | |
510 | \r | |
511 | **/\r | |
512 | RETURN_STATUS\r | |
513 | EFIAPI\r | |
514 | S3BootScriptExecute (\r | |
515 | VOID\r | |
516 | );\r | |
517 | \r | |
518 | /**\r | |
519 | Move the last boot script entry to the position\r | |
520 | \r | |
521 | @param BeforeOrAfter Specifies whether the opcode is stored before\r | |
522 | (TRUE) or after (FALSE) the positionin the boot\r | |
523 | script table specified by Position. If Position\r | |
524 | is NULL or points to NULL then the new opcode is\r | |
525 | inserted at the beginning of the table (if TRUE)\r | |
526 | or end of the table (if FALSE).\r | |
527 | @param Position On entry, specifies the position in the boot script\r | |
528 | table where the opcode will be inserted, either\r | |
529 | before or after, depending on BeforeOrAfter. On\r | |
530 | exit, specifies the position of the inserted opcode\r | |
531 | in the boot script table.\r | |
532 | \r | |
533 | @retval RETURN_OUT_OF_RESOURCES The table is not available.\r | |
534 | @retval RETURN_INVALID_PARAMETER The Position is not a valid position in the\r | |
535 | boot script table.\r | |
536 | @retval RETURN_SUCCESS The opcode was inserted.\r | |
537 | @note The FRAMEWORK version implementation does not support this API.\r | |
538 | **/\r | |
539 | RETURN_STATUS\r | |
540 | EFIAPI\r | |
541 | S3BootScriptMoveLastOpcode (\r | |
542 | IN BOOLEAN BeforeOrAfter,\r | |
543 | IN OUT VOID **Position OPTIONAL\r | |
544 | );\r | |
545 | \r | |
546 | /**\r | |
547 | Find a label within the boot script table and, if not present, optionally create it.\r | |
548 | \r | |
549 | @param BeforeOrAfter Specifies whether the opcode is stored before (TRUE)\r | |
550 | or after (FALSE) the position in the boot script table\r | |
551 | specified by Position.\r | |
552 | @param CreateIfNotFound Specifies whether the label will be created if the\r | |
553 | label does not exists (TRUE) or not (FALSE).\r | |
554 | @param Position On entry, specifies the position in the boot script\r | |
555 | table where the opcode will be inserted, either\r | |
556 | before or after, depending on BeforeOrAfter. On exit,\r | |
557 | specifies the positionof the inserted opcode in\r | |
558 | the boot script table.\r | |
559 | @param Label Points to the label which will be inserted in the\r | |
560 | boot script table.\r | |
561 | @retval EFI_SUCCESS The operation succeeded. A record was added into\r | |
562 | the specified script table.\r | |
563 | @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script\r | |
564 | is not supported. If the opcode is unknow or not\r | |
565 | supported because of the PCD Feature Flags.\r | |
566 | @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r | |
567 | @note The FRAMEWORK version implementation does not support this API\r | |
568 | \r | |
569 | **/\r | |
570 | RETURN_STATUS\r | |
571 | EFIAPI\r | |
572 | S3BootScriptLabel (\r | |
573 | IN BOOLEAN BeforeOrAfter,\r | |
574 | IN BOOLEAN CreateIfNotFound,\r | |
575 | IN OUT VOID **Position OPTIONAL,\r | |
576 | IN CONST CHAR8 *Label\r | |
577 | );\r | |
578 | \r | |
579 | /**\r | |
580 | Compare two positions in the boot script table and return their relative position.\r | |
581 | @param Position1 The positions in the boot script table to compare\r | |
582 | @param Position2 The positions in the boot script table to compare\r | |
583 | @param RelativePosition On return, points to the result of the comparison\r | |
584 | \r | |
585 | @retval EFI_SUCCESS The operation succeeded. A record was added into the\r | |
586 | specified script table.\r | |
587 | @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script\r | |
588 | is not supported. If the opcode is unknow or not s\r | |
589 | upported because of the PCD Feature Flags.\r | |
590 | @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r | |
591 | @note The FRAMEWORK version implementation does not support this API\r | |
592 | **/\r | |
593 | RETURN_STATUS\r | |
594 | EFIAPI\r | |
595 | S3BootScriptCompare (\r | |
596 | IN UINT8 *Position1,\r | |
597 | IN UINT8 *Position2,\r | |
598 | OUT UINTN *RelativePosition\r | |
599 | );\r | |
600 | \r | |
601 | #endif\r |