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