BootScriptSave.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /** @file
  2. This protocol is used to store or record various boot scripts into boot
  3. script tables.
  4. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. @par Revision Reference:
  7. This protocol defined in the Boot Script Specification, Version 0.91.
  8. **/
  9. #ifndef _BOOT_SCRIPT_SAVE_PROTOCOL_H_
  10. #define _BOOT_SCRIPT_SAVE_PROTOCOL_H_
  11. ///
  12. /// S3 Save Protocol GUID.
  13. ///
  14. #define EFI_BOOT_SCRIPT_SAVE_PROTOCOL_GUID \
  15. { \
  16. 0x470e1529, 0xb79e, 0x4e32, {0xa0, 0xfe, 0x6a, 0x15, 0x6d, 0x29, 0xf9, 0xb2 } \
  17. }
  18. typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL;
  19. /**
  20. Adds a record into a specified Framework boot script table.
  21. @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
  22. @param TableName The name of the script table. Currently, the only meaningful
  23. value is EFI_ACPI_S3_RESUME_SCRIPT_TABLE.
  24. @param OpCode The operation code (opcode) number.
  25. @param ... The argument list that is specific to each opcode.
  26. @retval EFI_SUCCESS The operation succeeded. A record was added into the specified script table.
  27. @retval EFI_INVALID_PARAMETER The parameter is illegal, or the given boot script is not supported.
  28. @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
  29. **/
  30. typedef
  31. EFI_STATUS
  32. (EFIAPI *EFI_BOOT_SCRIPT_WRITE)(
  33. IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
  34. IN UINT16 TableName,
  35. IN UINT16 OpCode,
  36. ...
  37. );
  38. /**
  39. Closes the specified script table.
  40. @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
  41. @param TableName The name of the script table.
  42. @param Address A pointer to the physical address where the table begins.
  43. @retval EFI_SUCCESS The table was successfully returned.
  44. @retval EFI_NOT_FOUND The specified table was not created previously.
  45. @retval EFI_OUT_OF_RESOURCES Memory is insufficient to hold the reorganized boot script table.
  46. **/
  47. typedef
  48. EFI_STATUS
  49. (EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE)(
  50. IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
  51. IN UINT16 TableName,
  52. OUT EFI_PHYSICAL_ADDRESS *Address
  53. );
  54. ///
  55. /// The EFI_BOOT_SCRIPT_SAVE_PROTOCOL publishes the Framework boot script abstractions
  56. /// to store or record various boot scripts into boot script tables.
  57. ///
  58. struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL {
  59. EFI_BOOT_SCRIPT_WRITE Write; ///< Writes various boot scripts to a boot script table.
  60. EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable; ///< Retrieves and closes a script table.
  61. };
  62. extern EFI_GUID gEfiBootScriptSaveProtocolGuid;
  63. #endif