EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiScriptLib.h

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
00004 This program and the accompanying materials                          
00005 are licensed and made available under the terms and conditions of the BSD License         
00006 which accompanies this distribution.  The full text of the license may be found at        
00007 http://opensource.org/licenses/bsd-license.php                                            
00008                                                                                           
00009 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
00010 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
00011 
00012 Module Name:
00013   
00014     EfiScriptLib.h
00015 
00016 Abstract:
00017 
00018  
00019 --*/
00020 
00021 #ifndef _EFI_SCRIPT_LIB_H_
00022 #define _EFI_SCRIPT_LIB_H_
00023 
00024 #include "Tiano.h"
00025 #include "EfiCommonLib.h"
00026 #include "EfiBootScript.h"
00027 #include EFI_PROTOCOL_DEFINITION (BootScriptSave)
00028 
00029 
00030 EFI_STATUS
00031 EFIAPI
00032 BootScriptSaveInitialize (
00033   IN EFI_HANDLE           ImageHandle,
00034   IN EFI_SYSTEM_TABLE     *SystemTable
00035   )
00036 /*++
00037 
00038 Routine Description:
00039 
00040   Intialize Boot Script Lib if it has not yet been initialized. 
00041 
00042 Arguments:
00043 
00044   ImageHandle     - The firmware allocated handle for the EFI image.
00045   
00046   SystemTable     - A pointer to the EFI System Table.
00047 
00048 Returns: 
00049 
00050   EFI_STATUS always returns EFI_SUCCESS
00051 
00052 --*/
00053 ;
00054 
00055 EFI_STATUS
00056 EFIAPI
00057 BootScriptSaveIoWrite (
00058   IN  UINT16                            TableName,
00059   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00060   IN  UINT64                            Address,
00061   IN  UINTN                             Count,
00062   IN  VOID                              *Buffer
00063   )
00064 /*++
00065 
00066 Routine Description:
00067 
00068   Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE
00069 
00070 Arguments:
00071 
00072   TableName - Desired boot script table
00073 
00074   Width   - The width of the I/O operations.
00075   
00076   Address - The base address of the I/O operations.
00077   
00078   Count   - The number of I/O operations to perform.
00079   
00080   Buffer  - The source buffer from which to write data. 
00081 
00082 Returns: 
00083   
00084   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00085   
00086   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00087 
00088 --*/
00089 ;
00090 
00091 EFI_STATUS
00092 EFIAPI
00093 BootScriptSaveIoReadWrite (
00094   IN  UINT16                            TableName,
00095   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00096   IN  UINT64                            Address,
00097   IN  VOID                              *Data,
00098   IN  VOID                              *DataMask
00099   )
00100 /*++
00101 
00102 Routine Description:
00103 
00104   Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE
00105 
00106 Arguments:
00107 
00108   TableName - Desired boot script table
00109 
00110   Width   - The width of the I/O operations.
00111   
00112   Address - The base address of the I/O operations.
00113   
00114   Data    - A pointer to the data to be OR-ed.
00115   
00116   DataMask  - A pointer to the data mask to be AND-ed with the data read from the register.
00117 
00118 Returns: 
00119   
00120   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00121   
00122   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00123 
00124 --*/
00125 ;
00126 
00127 EFI_STATUS
00128 EFIAPI
00129 BootScriptSaveMemWrite (
00130   IN  UINT16                            TableName,
00131   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00132   IN  UINT64                            Address,
00133   IN  UINTN                             Count,
00134   IN  VOID                              *Buffer
00135   )
00136 /*++
00137 
00138 Routine Description:
00139 
00140   Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE
00141 
00142 Arguments:
00143 
00144   TableName - Desired boot script table
00145 
00146   Width   - The width of the memory operations.
00147   
00148   Address - The base address of the memory operations.
00149   
00150   Count   - The number of memory operations to perform.
00151   
00152   Buffer  - The source buffer from which to write the data. 
00153 
00154 Returns: 
00155   
00156   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00157   
00158   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00159 
00160 --*/
00161 ;
00162 
00163 EFI_STATUS
00164 EFIAPI
00165 BootScriptSaveMemReadWrite (
00166   IN  UINT16                            TableName,
00167   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00168   IN  UINT64                            Address,
00169   IN  VOID                              *Data,
00170   IN  VOID                              *DataMask
00171   )
00172 /*++
00173 
00174 Routine Description:
00175 
00176   Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE
00177 
00178 Arguments:
00179 
00180   TableName - Desired boot script table
00181 
00182   Width   - The width of the memory operations.
00183   
00184   Address - The base address of the memory operations.
00185   
00186   Data    - A pointer to the data to be OR-ed.
00187   
00188   DataMask  - A pointer to the data mask to be AND-ed with the data read from the register.
00189 
00190 Returns: 
00191   
00192   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00193   
00194   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00195 
00196 --*/
00197 ;
00198 
00199 EFI_STATUS
00200 EFIAPI
00201 BootScriptSavePciCfgWrite (
00202   IN  UINT16                            TableName,
00203   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00204   IN  UINT64                            Address,
00205   IN  UINTN                             Count,
00206   IN  VOID                              *Buffer
00207   )
00208 /*++
00209 
00210 Routine Description:
00211 
00212   Save PCI configuration space write operation to boot script with opcode 
00213   EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE
00214 
00215 Arguments:
00216 
00217   TableName - Desired boot script table
00218 
00219   Width   - The width of the PCI operations
00220   
00221   Address - The address within the PCI configuration space.
00222   
00223   Count   - The number of PCI operations to perform.
00224   
00225   Buffer  - The source buffer from which to write the data.
00226 
00227 Returns: 
00228   
00229   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00230   
00231   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00232 
00233 --*/
00234 ;
00235 
00236 EFI_STATUS
00237 EFIAPI
00238 BootScriptSavePciCfgReadWrite (
00239   IN  UINT16                            TableName,
00240   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00241   IN  UINT64                            Address,
00242   IN  VOID                              *Data,
00243   IN  VOID                              *DataMask
00244   )
00245 /*++
00246 
00247 Routine Description:
00248 
00249   Save PCI configuration space modify operation to boot script with opcode 
00250   EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE
00251 
00252 Arguments:
00253 
00254   TableName - Desired boot script table
00255 
00256   Width   - The width of the PCI operations
00257   
00258   Address - The address within the PCI configuration space.
00259   
00260   Data    - A pointer to the data to be OR-ed.
00261   
00262   DataMask  - A pointer to the data mask to be AND-ed with the data read from the register.
00263 
00264 Returns: 
00265   
00266   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00267   
00268   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00269 
00270 --*/
00271 ;
00272 ;
00273 
00274 EFI_STATUS
00275 EFIAPI
00276 BootScriptSaveSmbusExecute (
00277   IN  UINT16                            TableName,
00278   IN  EFI_SMBUS_DEVICE_ADDRESS          SlaveAddress,
00279   IN  EFI_SMBUS_DEVICE_COMMAND          Command,
00280   IN  EFI_SMBUS_OPERATION               Operation,
00281   IN  BOOLEAN                           PecCheck,
00282   IN  UINTN                             *Length,
00283   IN  VOID                              *Buffer
00284   )
00285 /*++
00286 
00287 Routine Description:
00288 
00289   Save SMBus command execution to boot script with opcode 
00290   EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE
00291 
00292 Arguments:
00293 
00294   TableName     - Desired boot script table
00295   SlaveAddress  - The SMBus address for the slave device that the operation is targeting.
00296   Command       - The command that is transmitted by the SMBus host controller to the 
00297                   SMBus slave device.
00298   Operation     - Indicates which particular SMBus protocol it will use to execute the 
00299                   SMBus transactions.
00300   PecCheck      - Defines if Packet Error Code (PEC) checking is required for this operation.
00301   Length        - A pointer to signify the number of bytes that this operation will do.
00302   Buffer        - Contains the value of data to execute to the SMBUS slave device.
00303 
00304 Returns:
00305 
00306   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00307   
00308   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00309 
00310 --*/
00311 ;
00312 
00313 EFI_STATUS
00314 EFIAPI
00315 BootScriptSaveStall (
00316   IN  UINT16                            TableName,
00317   IN  UINTN                             Duration
00318   )
00319 /*++
00320 
00321 Routine Description:
00322 
00323   Save execution stall on the processor to boot script with opcode 
00324   EFI_BOOT_SCRIPT_STALL_OPCODE
00325 
00326 Arguments:
00327 
00328   TableName     - Desired boot script table
00329   
00330   Duration      - Duration in microseconds of the stall.
00331 
00332 Returns:
00333 
00334   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00335   
00336   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00337 
00338 --*/
00339 ;
00340 
00341 EFI_STATUS
00342 EFIAPI
00343 BootScriptSaveDispatch (
00344   IN  UINT16                            TableName,
00345   IN  EFI_PHYSICAL_ADDRESS              EntryPoint
00346   )
00347 /*++
00348 
00349 Routine Description:
00350 
00351   Save dispatching specified arbitrary code to boot script with opcode 
00352   EFI_BOOT_SCRIPT_DISPATCH_OPCODE
00353 
00354 Arguments:
00355 
00356   TableName     - Desired boot script table
00357   
00358   EntryPoint    - Entry point of the code to be dispatched.
00359 
00360 Returns:
00361 
00362   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00363   
00364   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00365 
00366 --*/
00367 ;
00368 
00369 EFI_STATUS
00370 EFIAPI
00371 BootScriptMemPoll (
00372   IN  UINT16                            TableName,
00373   IN  EFI_BOOT_SCRIPT_WIDTH             Width,
00374   IN  UINT64                            Address,
00375   IN  VOID                              *BitMask,
00376   IN  VOID                              *BitValue,
00377   IN  UINTN                             Duration,
00378   IN  UINTN                             LoopTimes
00379   )
00380 /*++
00381 
00382 Routine Description:
00383   Polling one memory mapping register
00384 
00385 Arguments:
00386   TableName - Desired boot script table
00387 
00388   Width     - The width of the memory operations.
00389   
00390   Address   - The base address of the memory operations.
00391   
00392   BitMask   - A pointer to the bit mask to be AND-ed with the data read from the register.
00393 
00394   BitValue  - A pointer to the data value after to be Masked.
00395 
00396   Duration  - Duration in microseconds of the stall.
00397   
00398   LoopTimes - The times of the register polling.
00399 
00400 Returns:
00401 
00402   EFI_SUCCESS           - The operation was executed successfully
00403 
00404 --*/
00405 ;
00406 
00407 EFI_STATUS
00408 EFIAPI
00409 BootScriptSaveInformation (
00410   IN  UINT16                                 TableName,
00411   IN  UINT32                                 Length, 
00412   IN  EFI_PHYSICAL_ADDRESS                   Buffer
00413   )
00414 /*++
00415 
00416 Routine Description:
00417 
00418   Save a Information Opcode record in table specified with TableName
00419 
00420 Arguments:
00421 
00422   TableName   - Desired boot script table
00423   Length         - Length of information in bytes
00424   Buffer          - Content of information that will be saved in script table
00425 
00426 Returns:
00427 
00428   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00429   
00430   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00431 
00432 --*/
00433 ;
00434 
00435 EFI_STATUS
00436 EFIAPI
00437 BootScriptSaveInformationUnicodeString (
00438   IN        UINT16              TableName,
00439   IN        CHAR16              *String
00440   )
00441 /*++
00442 
00443 Routine Description:
00444 
00445   Save a Information Opcode record in table specified with TableName, the information
00446   is a unicode string.
00447 
00448 Arguments:
00449 
00450   TableName   - Desired boot script table
00451   String          - The string that will be saved in script table
00452 
00453 Returns:
00454 
00455   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00456   
00457   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00458 
00459 --*/
00460 ;
00461 
00462 EFI_STATUS
00463 EFIAPI
00464 BootScriptSaveInformationAsciiString (
00465   IN        UINT16              TableName,
00466   IN        CHAR8               *String
00467   )
00468 /*++
00469 
00470 Routine Description:
00471 
00472   Save a Information Opcode record in table specified with TableName, the information
00473   is a ascii string.
00474 
00475 Arguments:
00476 
00477   TableName   - Desired boot script table
00478   String          - The string that will be saved in script table
00479 
00480 Returns:
00481 
00482   EFI_NOT_FOUND - BootScriptSave Protocol not exist.
00483   
00484   EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
00485 
00486 --*/
00487 ;
00488   
00489 #ifdef EFI_S3_RESUME
00490   
00491 #define INITIALIZE_SCRIPT(ImageHandle, SystemTable) \
00492           BootScriptSaveInitialize(ImageHandle, SystemTable)
00493 
00494 #define SCRIPT_IO_WRITE(TableName, Width, Address, Count, Buffer) \
00495           BootScriptSaveIoWrite(TableName, Width, Address, Count, Buffer)
00496 
00497 #define SCRIPT_IO_READ_WRITE(TableName, Width, Address, Data, DataMask) \
00498           BootScriptSaveIoReadWrite(TableName, Width, Address, Data, DataMask)
00499 
00500 #define SCRIPT_MEM_WRITE(TableName, Width, Address, Count, Buffer) \
00501           BootScriptSaveMemWrite(TableName, Width, Address, Count, Buffer)
00502 
00503 #define SCRIPT_MEM_WRITE_THIS(TableName, Width, Address, Count) \
00504           BootScriptSaveMemWrite(TableName, Width, Address, Count, (VOID*)(UINTN)Address)
00505 
00506 #define SCRIPT_MEM_READ_WRITE(TableName, Width, Address, Data, DataMask) \
00507           BootScriptSaveMemReadWrite(TableName, Width, Address, Data, DataMask)
00508 
00509 #define SCRIPT_PCI_CFG_WRITE(TableName, Width, Address, Count, Buffer) \
00510           BootScriptSavePciCfgWrite(TableName, Width, Address, Count, Buffer)
00511 
00512 #define SCRIPT_PCI_CFG_READ_WRITE(TableName, Width, Address, Data, DataMask) \
00513           BootScriptSavePciCfgReadWrite(TableName, Width, Address, Data, DataMask)
00514 
00515 #define SCRIPT_SMBUS_EXECUTE(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer) \
00516           BootScriptSaveSmbusExecute(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer)
00517 
00518 #define SCRIPT_STALL(TableName, Duration) \
00519           BootScriptSaveStall(TableName, Duration)
00520 
00521 #define SCRIPT_DISPATCH(TableName, EntryPoint) \
00522           BootScriptSaveDispatch(TableName, EntryPoint)
00523 
00524 #define SCRIPT_MEM_POLL(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes) \
00525           BootScriptMemPoll(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes)
00526 
00527 #define SCRIPT_INFORMATION(TableName, Length, Buffer) \
00528           BootScriptSaveInformation(TableName, Length, Buffer)
00529 
00530 #define SCRIPT_INFORMATION_UNICODE_STRING(TableName, String) \
00531           BootScriptSaveInformationUnicodeString(TableName, String)
00532 
00533 #define SCRIPT_INFORMATION_ASCII_STRING(TableName, String) \
00534           BootScriptSaveInformationAsciiString(TableName, String)
00535 
00536 //
00537 // For backward compatibility
00538 //
00539 #define SCRIPT_INOFRMATION(TableName, Length, Buffer) \
00540           BootScriptSaveInformation(TableName, Length, Buffer)
00541 
00542 #define SCRIPT_INOFRMATION_UNICODE_STRING(TableName, String) \
00543           BootScriptSaveInformationUnicodeString(TableName, String)
00544 
00545 #define SCRIPT_INOFRMATION_ASCII_STRING(TableName, String) \
00546           BootScriptSaveInformationAsciiString(TableName, String)
00547           
00548 #else
00549 
00550 #define INITIALIZE_SCRIPT(ImageHandle, SystemTable)          
00551 
00552 #define SCRIPT_IO_WRITE(TableName, Width, Address, Count, Buffer) 
00553 
00554 #define SCRIPT_IO_READ_WRITE(TableName, Width, Address, Data, DataMask) 
00555           
00556 #define SCRIPT_MEM_WRITE(TableName, Width, Address, Count, Buffer) 
00557 
00558 #define SCRIPT_MEM_WRITE_THIS(TableName, Width, Address, Count)
00559 
00560 #define SCRIPT_MEM_READ_WRITE(TableName, Width, Address, Data, DataMask) 
00561 
00562 #define SCRIPT_PCI_CFG_WRITE(TableName, Width, Address, Count, Buffer) 
00563 
00564 #define SCRIPT_PCI_CFG_READ_WRITE(TableName, Width, Address, Data, DataMask) 
00565 
00566 #define SCRIPT_SMBUS_EXECUTE(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer) 
00567 
00568 #define SCRIPT_STALL(TableName, Duration)           
00569 
00570 #define SCRIPT_DISPATCH(TableName, EntryPoint) 
00571 
00572 #define SCRIPT_MEM_POLL(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes)
00573 
00574 #define SCRIPT_INFORMATION(TableName, Length, Buffer)
00575 
00576 #define SCRIPT_INFORMATION_UNICODE_STRING(TableName, String)
00577 
00578 #define SCRIPT_INFORMATION_ASCII_STRING(TableName, String)
00579 
00580 //
00581 // For backward compatibility
00582 //
00583 #define SCRIPT_INOFRMATION(TableName, Length, Buffer)
00584 
00585 #define SCRIPT_INOFRMATION_UNICODE_STRING(TableName, String)
00586 
00587 #define SCRIPT_INOFRMATION_ASCII_STRING(TableName, String)
00588 
00589 #endif
00590 
00591 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines