]>
Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | /** @file\r |
2 | //\r | |
3 | //\r | |
4 | Internal header file for S3 Boot Script Saver driver.\r | |
5 | \r | |
6 | Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
7 | \r\r | |
9dc8036d MK |
8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
9 | \r | |
3cbfba02 DW |
10 | \r\r |
11 | \r | |
12 | **/\r | |
13 | \r | |
14 | #ifndef _INTERNAL_BOOT_SCRIPT_SAVE_H_\r | |
15 | #define _INTERNAL_BOOT_SCRIPT_SAVE_H_\r | |
16 | #include <FrameworkDxe.h>\r | |
17 | \r | |
18 | #include <Protocol/BootScriptSave.h>\r | |
19 | #include <Protocol/FirmwareVolume.h>\r | |
20 | \r | |
21 | #include <Library/BaseLib.h>\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/UefiDriverEntryPoint.h>\r | |
24 | #include <Library/UefiBootServicesTableLib.h>\r | |
25 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
26 | #include <Library/S3BootScriptLib.h>\r | |
27 | #include <Library/PcdLib.h>\r | |
28 | #include <Library/SmbusLib.h>\r | |
29 | #include <IndustryStandard/SmBus.h>\r | |
30 | \r | |
31 | /**\r | |
32 | Adds a record into a specified Framework boot script table.\r | |
33 | \r | |
34 | This function is used to store a boot script record into a given boot\r | |
35 | script table. If the table specified by TableName is nonexistent in the\r | |
36 | system, a new table will automatically be created and then the script record\r | |
37 | will be added into the new table. A boot script table can add new script records\r | |
38 | until EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is called. Currently, the only\r | |
39 | meaningful table name is EFI_ACPI_S3_RESUME_SCRIPT_TABLE. This function is\r | |
40 | responsible for allocating necessary memory for the script.\r | |
41 | \r | |
42 | This function has a variable parameter list. The exact parameter list depends on\r | |
43 | the OpCode that is passed into the function. If an unsupported OpCode or illegal\r | |
44 | parameter list is passed in, this function returns EFI_INVALID_PARAMETER.\r | |
45 | If there are not enough resources available for storing more scripts, this function returns\r | |
46 | EFI_OUT_OF_RESOURCES.\r | |
47 | \r | |
48 | @param[in] This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
49 | @param[in] TableName Name of the script table. Currently, the only meaningful value is\r | |
50 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
51 | @param[in] OpCode The operation code (opcode) number.\r | |
52 | @param[in] ... Argument list that is specific to each opcode.\r | |
53 | \r | |
54 | @retval EFI_SUCCESS The operation succeeded. A record was added into the\r | |
55 | specified script table.\r | |
56 | @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r | |
57 | If the opcode is unknow or not supported because of the PCD\r | |
58 | Feature Flags.\r | |
59 | @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r | |
60 | \r | |
61 | **/\r | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | BootScriptWrite (\r | |
65 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
66 | IN UINT16 TableName,\r | |
67 | IN UINT16 OpCode,\r | |
68 | ...\r | |
69 | );\r | |
70 | \r | |
71 | /**\r | |
72 | Closes the specified script table.\r | |
73 | \r | |
74 | This function closes the specified boot script table and returns the base address\r | |
75 | of the table. It allocates a new pool to duplicate all the boot scripts in the specified\r | |
76 | table. Once this function is called, the specified table will be destroyed after it is\r | |
77 | copied into the allocated pool. As a result, any attempts to add a script record into a\r | |
78 | closed table will cause a new table to be created. The base address of the allocated pool\r | |
79 | will be returned in Address. After using the boot script table, the caller is responsible\r | |
80 | for freeing the pool that is allocated by this function. If the boot script table,\r | |
81 | such as EFI_ACPI_S3_RESUME_SCRIPT_TABLE, is required to be stored in a nonperturbed\r | |
82 | memory region, the caller should copy the table into the nonperturbed memory region by itself.\r | |
83 | \r | |
84 | @param[in] This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
85 | @param[in] TableName Name of the script table. Currently, the only meaningful value is\r | |
86 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
87 | @param[in] Address A pointer to the physical address where the table begins.\r | |
88 | \r | |
89 | @retval EFI_SUCCESS The table was successfully returned.\r | |
90 | @retval EFI_NOT_FOUND The specified table was not created previously.\r | |
91 | @retval EFI_OUT_OF_RESOURCE Memory is insufficient to hold the reorganized boot script table.\r | |
92 | @retval EFI_UNSUPPORTED The table type is not EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
93 | \r | |
94 | **/\r | |
95 | EFI_STATUS\r | |
96 | EFIAPI\r | |
97 | BootScriptCloseTable (\r | |
98 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
99 | IN UINT16 TableName,\r | |
100 | OUT EFI_PHYSICAL_ADDRESS *Address\r | |
101 | );\r | |
102 | #endif //_INTERNAL_BOOT_SCRIPT_SAVE_H_\r |