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