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