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