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