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
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.
21 #ifndef _BOOT_SCRIPT_LIB_H_
22 #define _BOOT_SCRIPT_LIB_H_
25 #include <Ppi/BootScriptExecuter.h>
27 #include <IndustryStandard/SmBus.h>
31 BootScriptSaveIoWrite (
33 IN EFI_BOOT_SCRIPT_WIDTH Width
,
42 Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE
46 TableName - Desired boot script table
48 Width - The width of the I/O operations.
50 Address - The base address of the I/O operations.
52 Count - The number of I/O operations to perform.
54 Buffer - The source buffer from which to write data.
58 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
60 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
67 BootScriptSaveIoReadWrite (
69 IN EFI_BOOT_SCRIPT_WIDTH Width
,
78 Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE
82 TableName - Desired boot script table
84 Width - The width of the I/O operations.
86 Address - The base address of the I/O operations.
88 Data - A pointer to the data to be OR-ed.
90 DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
94 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
96 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
103 BootScriptSaveMemWrite (
105 IN EFI_BOOT_SCRIPT_WIDTH Width
,
114 Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE
118 TableName - Desired boot script table
120 Width - The width of the memory operations.
122 Address - The base address of the memory operations.
124 Count - The number of memory operations to perform.
126 Buffer - The source buffer from which to write the data.
130 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
132 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
139 BootScriptSaveMemReadWrite (
141 IN EFI_BOOT_SCRIPT_WIDTH Width
,
150 Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE
154 TableName - Desired boot script table
156 Width - The width of the memory operations.
158 Address - The base address of the memory operations.
160 Data - A pointer to the data to be OR-ed.
162 DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
166 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
168 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
175 BootScriptSavePciCfgWrite (
177 IN EFI_BOOT_SCRIPT_WIDTH Width
,
186 Save PCI configuration space write operation to boot script with opcode
187 EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE
191 TableName - Desired boot script table
193 Width - The width of the PCI operations
195 Address - The address within the PCI configuration space.
197 Count - The number of PCI operations to perform.
199 Buffer - The source buffer from which to write the data.
203 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
205 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
212 BootScriptSavePciCfgReadWrite (
214 IN EFI_BOOT_SCRIPT_WIDTH Width
,
223 Save PCI configuration space modify operation to boot script with opcode
224 EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE
228 TableName - Desired boot script table
230 Width - The width of the PCI operations
232 Address - The address within the PCI configuration space.
234 Data - A pointer to the data to be OR-ed.
236 DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
240 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
242 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
249 BootScriptSaveSmbusExecute (
251 IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress
,
252 IN EFI_SMBUS_DEVICE_COMMAND Command
,
253 IN EFI_SMBUS_OPERATION Operation
,
262 Save SMBus command execution to boot script with opcode
263 EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE
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
271 Operation - Indicates which particular SMBus protocol it will use to execute the
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.
279 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
281 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
288 BootScriptSaveStall (
296 Save execution stall on the processor to boot script with opcode
297 EFI_BOOT_SCRIPT_STALL_OPCODE
301 TableName - Desired boot script table
303 Duration - Duration in microseconds of the stall.
307 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
309 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
316 BootScriptSaveDispatch (
318 IN EFI_PHYSICAL_ADDRESS EntryPoint
324 Save dispatching specified arbitrary code to boot script with opcode
325 EFI_BOOT_SCRIPT_DISPATCH_OPCODE
329 TableName - Desired boot script table
331 EntryPoint - Entry point of the code to be dispatched.
335 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
337 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
344 BootScriptSaveDispatch2 (
346 IN EFI_PHYSICAL_ADDRESS EntryPoint
,
347 IN EFI_PHYSICAL_ADDRESS Context
353 Save dispatching specified arbitrary code to boot script with opcode
354 EFI_BOOT_SCRIPT_DISPATCH_OPCODE
358 TableName - Desired boot script table
360 EntryPoint - Entry point of the code to be dispatched.
362 Context - The data that will be passed into code.
366 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
368 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
375 BootScriptSaveDispatch2Image (
377 IN EFI_GUID
*FfsName
,
378 IN EFI_PHYSICAL_ADDRESS Context
,
379 IN EFI_HANDLE ParentHandle
385 Save dispatching specified arbitrary code to boot script with opcode
386 EFI_BOOT_SCRIPT_DISPATCH_OPCODE
390 TableName - Desired boot script table
392 FfsName - The file name of the code to be dispatched.
394 Context - The data that will be passed into code.
396 ParentHandle - The caller's image handle.
400 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
402 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
409 BootScriptSaveInformation (
412 IN EFI_PHYSICAL_ADDRESS Buffer
418 Save information specified by Buffer, length is specified by Length, to
419 boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
423 TableName - Desired boot script table
425 FfsName - The file name of the code to be dispatched.
427 Context - The data that will be passed into code.
429 ParentHandle - The caller's image handle.
433 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
435 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
442 BootScriptSaveInformationUnicodeString (
444 IN CONST CHAR16
*String
450 Save unicode string information specified by Buffer to
451 boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
455 TableName - Desired boot script table
457 FfsName - The file name of the code to be dispatched.
459 Context - The data that will be passed into code.
461 ParentHandle - The caller's image handle.
465 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
467 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
474 BootScriptSaveInformationAsciiString (
476 IN CONST CHAR8
*String
482 Save ASCII string information specified by Buffer to
483 boot script with opcode EFI_BOOT_SCRIPT_INFORMATION_OPCODE
487 TableName - Desired boot script table
489 FfsName - The file name of the code to be dispatched.
491 Context - The data that will be passed into code.
493 ParentHandle - The caller's image handle.
497 EFI_NOT_FOUND - BootScriptSave Protocol not exist.
499 EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
506 BootScriptSaveInitialize (
507 IN EFI_HANDLE ImageHandle
,
508 IN EFI_SYSTEM_TABLE
*SystemTable
514 Intialize Boot Script Lib if it has not yet been initialized.
518 ImageHandle - The firmware allocated handle for the EFI image.
520 SystemTable - A pointer to the EFI System Table.
524 EFI_STATUS always returns EFI_SUCCESS