]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Library/BootScriptLib.h
fixed memcpy link issue.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Library / BootScriptLib.h
CommitLineData
c3902377 1/*++\r
2\r
3e0578d2 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
c3902377 11\r
12Module Name:\r
13 \r
14 EfiScriptLib.h\r
15\r
16Abstract:\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
29EFI_STATUS\r
30EFIAPI\r
31BootScriptSaveIoWrite (\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
40Routine Description:\r
41\r
42 Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE\r
43\r
44Arguments:\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
56Returns: \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
65EFI_STATUS\r
66EFIAPI\r
67BootScriptSaveIoReadWrite (\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
76Routine Description:\r
77\r
78 Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE\r
79\r
80Arguments:\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
92Returns: \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
101EFI_STATUS\r
102EFIAPI\r
103BootScriptSaveMemWrite (\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
112Routine Description:\r
113\r
114 Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE\r
115\r
116Arguments:\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
128Returns: \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
137EFI_STATUS\r
138EFIAPI\r
139BootScriptSaveMemReadWrite (\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
148Routine Description:\r
149\r
150 Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE\r
151\r
152Arguments:\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
164Returns: \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
173EFI_STATUS\r
174EFIAPI\r
175BootScriptSavePciCfgWrite (\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
184Routine 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
189Arguments:\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
201Returns: \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
210EFI_STATUS\r
211EFIAPI\r
212BootScriptSavePciCfgReadWrite (\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
221Routine 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
226Arguments:\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
238Returns: \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
247EFI_STATUS\r
248EFIAPI\r
249BootScriptSaveSmbusExecute (\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
260Routine 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
265Arguments:\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
277Returns:\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
286EFI_STATUS\r
287EFIAPI\r
288BootScriptSaveStall (\r
289 IN UINT16 TableName,\r
290 IN UINTN Duration\r
291 )\r
292/*++\r
293\r
294Routine 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
299Arguments:\r
300\r
301 TableName - Desired boot script table\r
302 \r
303 Duration - Duration in microseconds of the stall.\r
304\r
305Returns:\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
314EFI_STATUS\r
315EFIAPI\r
316BootScriptSaveDispatch (\r
317 IN UINT16 TableName,\r
318 IN EFI_PHYSICAL_ADDRESS EntryPoint\r
319 )\r
320/*++\r
321\r
322Routine 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
327Arguments:\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
333Returns:\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
342EFI_STATUS\r
343EFIAPI\r
344BootScriptSaveDispatch2 (\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
351Routine 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
356Arguments:\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
364Returns:\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
373EFI_STATUS\r
374EFIAPI\r
375BootScriptSaveDispatch2Image (\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
383Routine 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
388Arguments:\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
398Returns:\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
407EFI_STATUS\r
408EFIAPI\r
409BootScriptSaveInformation (\r
410 IN UINT16 TableName,\r
411 IN UINT32 Length, \r
412 IN EFI_PHYSICAL_ADDRESS Buffer\r
413 )\r
414 /*++\r
415\r
416Routine 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
421Arguments:\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
431Returns:\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
440EFI_STATUS\r
441EFIAPI\r
442BootScriptSaveInformationUnicodeString (\r
443 IN UINT16 TableName,\r
444 IN CONST CHAR16 *String\r
445 )\r
446 /*++\r
447\r
448Routine 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
453Arguments:\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
463Returns:\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
472EFI_STATUS\r
473EFIAPI\r
474BootScriptSaveInformationAsciiString (\r
475 IN UINT16 TableName,\r
476 IN CONST CHAR8 *String\r
477 )\r
478 /*++\r
479\r
480Routine 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
485Arguments:\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
495Returns:\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
504EFI_STATUS\r
505EFIAPI\r
506BootScriptSaveInitialize (\r
507 IN EFI_HANDLE ImageHandle,\r
508 IN EFI_SYSTEM_TABLE *SystemTable\r
509 )\r
510/*++\r
511\r
512Routine Description:\r
513\r
514 Intialize Boot Script Lib if it has not yet been initialized. \r
515\r
516Arguments:\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
522Returns: \r
523\r
524 EFI_STATUS always returns EFI_SUCCESS\r
525\r
526--*/\r
527; \r
528#endif\r
529\r
530\r