]>
Commit | Line | Data |
---|---|---|
ba9978cf | 1 | /** @file\r |
2 | Header file for S3 Boot Script Saver thunk driver.\r | |
3 | \r | |
584d5652 HT |
4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
ba9978cf | 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 | |
d766b228 | 24 | #include <Library/UefiRuntimeServicesTableLib.h>\r |
ba9978cf | 25 | #include <Library/SmbusLib.h>\r |
d766b228 JY |
26 | #include <Library/PeCoffLib.h>\r |
27 | #include <Library/PcdLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/DxeServicesLib.h>\r | |
30 | #include <Library/CacheMaintenanceLib.h>\r | |
31 | \r | |
32 | #include <Guid/BootScriptThunkData.h>\r | |
33 | \r | |
ba9978cf | 34 | #include <IndustryStandard/SmBus.h>\r |
35 | \r | |
d766b228 JY |
36 | typedef\r |
37 | EFI_STATUS\r | |
38 | (EFIAPI *DISPATCH_ENTRYPOINT_FUNC) (\r | |
39 | IN EFI_HANDLE ImageHandle,\r | |
40 | IN VOID *Context\r | |
41 | );\r | |
42 | \r | |
ba9978cf | 43 | /**\r |
44 | Adds a record into a specified Framework boot script table.\r | |
45 | \r | |
46 | This function is used to store a boot script record into a given boot\r | |
47 | script table. If the table specified by TableName is nonexistent in the \r | |
48 | system, a new table will automatically be created and then the script record \r | |
49 | will be added into the new table. A boot script table can add new script records\r | |
50 | until EFI_BOOT_SCRIPT_SAVE_PROTOCOL.CloseTable() is called. Currently, the only \r | |
51 | meaningful table name is EFI_ACPI_S3_RESUME_SCRIPT_TABLE. This function is\r | |
52 | responsible for allocating necessary memory for the script.\r | |
53 | \r | |
54 | This function has a variable parameter list. The exact parameter list depends on \r | |
55 | the OpCode that is passed into the function. If an unsupported OpCode or illegal \r | |
56 | parameter list is passed in, this function returns EFI_INVALID_PARAMETER.\r | |
57 | If there are not enough resources available for storing more scripts, this function returns\r | |
58 | EFI_OUT_OF_RESOURCES.\r | |
59 | \r | |
60 | @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
61 | @param TableName Name of the script table. Currently, the only meaningful value is\r | |
62 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
63 | @param OpCode The operation code (opcode) number.\r | |
26a76fbc | 64 | @param ... Argument list that is specific to each opcode. \r |
ba9978cf | 65 | \r |
66 | @retval EFI_SUCCESS The operation succeeded. A record was added into the\r | |
67 | specified script table.\r | |
68 | @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r | |
69 | If the opcode is unknow or not supported because of the PCD \r | |
70 | Feature Flags.\r | |
71 | @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r | |
72 | \r | |
73 | **/\r | |
74 | EFI_STATUS\r | |
75 | EFIAPI\r | |
76 | BootScriptWrite (\r | |
77 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
78 | IN UINT16 TableName,\r | |
79 | IN UINT16 OpCode,\r | |
80 | ...\r | |
81 | );\r | |
82 | \r | |
83 | /**\r | |
84 | Closes the specified script table.\r | |
85 | \r | |
86 | This function closes the specified boot script table and returns the base address \r | |
87 | of the table. It allocates a new pool to duplicate all the boot scripts in the specified \r | |
88 | table. Once this function is called, the specified table will be destroyed after it is \r | |
89 | copied into the allocated pool. As a result, any attempts to add a script record into a \r | |
90 | closed table will cause a new table to be created. The base address of the allocated pool \r | |
91 | will be returned in Address. After using the boot script table, the caller is responsible \r | |
92 | for freeing the pool that is allocated by this function. If the boot script table,\r | |
93 | such as EFI_ACPI_S3_RESUME_SCRIPT_TABLE, is required to be stored in a nonperturbed\r | |
94 | memory region, the caller should copy the table into the nonperturbed memory region by itself.\r | |
95 | \r | |
96 | @param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r | |
97 | @param TableName Name of the script table. Currently, the only meaningful value is\r | |
98 | EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r | |
99 | @param Address A pointer to the physical address where the table begins. \r | |
100 | \r | |
101 | @retval EFI_SUCCESS The table was successfully returned.\r | |
102 | @retval EFI_NOT_FOUND The specified table was not created previously.\r | |
103 | @retval EFI_OUT_OF_RESOURCE Memory is insufficient to hold the reorganized boot script table.\r | |
104 | @retval EFI_UNSUPPORTED the table type is not EFI_ACPI_S3_RESUME_SCRIPT_TABLE\r | |
105 | \r | |
106 | **/\r | |
107 | EFI_STATUS\r | |
108 | EFIAPI\r | |
109 | BootScriptCloseTable (\r | |
110 | IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,\r | |
111 | IN UINT16 TableName,\r | |
112 | OUT EFI_PHYSICAL_ADDRESS *Address\r | |
113 | );\r | |
114 | \r | |
115 | #endif\r |