]>
Commit | Line | Data |
---|---|---|
52cbe449 | 1 | /** @file\r |
2 | Header file for S3 Boot Script Saver thunk driver.\r | |
3 | \r | |
4 | Copyright (c) 2010 Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | #ifndef __BOOT_SCRIPT_SAVE_ON_S3_SAVE_STATE_H__\r | |
15 | #define __BOOT_SCRIPT_SAVE_ON_S3_SAVE_STATE_H__\r | |
16 | #include <FrameworkDxe.h>\r | |
17 | \r | |
18 | #include <Protocol/BootScriptSave.h>\r | |
19 | #include <Protocol/S3SaveState.h>\r | |
20 | \r | |
21 | #include <Library/BaseLib.h>\r | |
22 | #include <Library/DebugLib.h>\r | |
23 | #include <Library/UefiBootServicesTableLib.h>\r | |
24 | #include <Library/SmbusLib.h>\r | |
25 | #include <IndustryStandard/SmBus.h>\r | |
26 | \r | |
27 | /**\r | |
28 | Adds a record into a specified Framework boot script table.\r | |
29 | \r | |
30 | This function is used to store a boot script record into a given boot\r | |
31 | script table. If the table specified by TableName is nonexistent in the \r | |
32 | system, a new table will automatically be created and then the script record \r | |
33 | will be added into the new table. A boot script table can add new script records\r | |
34 | until EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is called. Currently, the only \r | |
35 | meaningful table name is EFI_ACPI_S3_RESUME_SCRIPT_TABLE. This function is\r | |
36 | responsible for allocating necessary memory for the script.\r | |
37 | \r | |
38 | This function has a variable parameter list. The exact parameter list depends on \r | |
39 | the OpCode that is passed into the function. If an unsupported OpCode or illegal \r | |
40 | parameter list is passed in, this function returns EFI_INVALID_PARAMETER.\r | |
41 | If there are not enough resources available for storing more scripts, this function returns\r | |
42 | EFI_OUT_OF_RESOURCES.\r | |
43 | \r | |
44 | @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
45 | @param TableName Name of the script table. Currently, the only meaningful value is\r | |
46 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
47 | @param OpCode The operation code (opcode) number.\r | |
48 | \r | |
49 | @retval EFI_SUCCESS The operation succeeded. A record was added into the\r | |
50 | specified script table.\r | |
51 | @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r | |
52 | If the opcode is unknow or not supported because of the PCD \r | |
53 | Feature Flags.\r | |
54 | @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r | |
55 | \r | |
56 | **/\r | |
57 | EFI_STATUS\r | |
58 | EFIAPI\r | |
59 | BootScriptWrite (\r | |
60 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
61 | IN UINT16 TableName,\r | |
62 | IN UINT16 OpCode,\r | |
63 | ...\r | |
64 | );\r | |
65 | \r | |
66 | /**\r | |
67 | Closes the specified script table.\r | |
68 | \r | |
69 | This function closes the specified boot script table and returns the base address \r | |
70 | of the table. It allocates a new pool to duplicate all the boot scripts in the specified \r | |
71 | table. Once this function is called, the specified table will be destroyed after it is \r | |
72 | copied into the allocated pool. As a result, any attempts to add a script record into a \r | |
73 | closed table will cause a new table to be created. The base address of the allocated pool \r | |
74 | will be returned in Address. After using the boot script table, the caller is responsible \r | |
75 | for freeing the pool that is allocated by this function. If the boot script table,\r | |
76 | such as EFI_ACPI_S3_RESUME_SCRIPT_TABLE, is required to be stored in a nonperturbed\r | |
77 | memory region, the caller should copy the table into the nonperturbed memory region by itself.\r | |
78 | \r | |
79 | @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
80 | @param TableName Name of the script table. Currently, the only meaningful value is\r | |
81 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
82 | @param Address A pointer to the physical address where the table begins. \r | |
83 | \r | |
84 | @retval EFI_SUCCESS The table was successfully returned.\r | |
85 | @retval EFI_NOT_FOUND The specified table was not created previously.\r | |
86 | @retval EFI_OUT_OF_RESOURCE Memory is insufficient to hold the reorganized boot script table.\r | |
87 | @retval EFI_UNSUPPORTED the table type is not EFI_ACPI_S3_RESUME_SCRIPT_TABLE\r | |
88 | \r | |
89 | **/\r | |
90 | EFI_STATUS\r | |
91 | EFIAPI\r | |
92 | BootScriptCloseTable (\r | |
93 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
94 | IN UINT16 TableName,\r | |
95 | OUT EFI_PHYSICAL_ADDRESS *Address\r | |
96 | );\r | |
97 | \r | |
98 | #endif\r |