]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.h
0a50afe9fc1547a650edc2534a1c6714370fde46
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Smm / SmmScriptLib / SmmScriptLib.h
1 /** @file
2 This is an thunk implementation of the BootScript at run time.
3
4 SmmScriptLib in Framework implementation is to save S3 Boot Script in SMM runtime.
5 Here is the header file to define the API in this thunk library.
6
7 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
8
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions
11 of the BSD License which accompanies this distribution. The
12 full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
14
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17
18 **/
19
20 #ifndef _SMM_SCRIPT_SAVE_H_
21 #define _SMM_SCRIPT_SAVE_H_
22
23 #include "Tiano.h"
24 #include "EfiBootScript.h"
25 #include "PiSmmDefinition.h"
26 #include "PiSmmS3SaveState.h"
27
28
29 typedef EFI_PHYSICAL_ADDRESS EFI_SMM_SCRIPT_TABLE;
30 /**
31 Intialize Boot Script table.
32
33 This function should be called in SMM mode. The Thunk implementation is try to
34 locate SmmSaveState protocol.
35
36 @param SystemTable Pointer to the EFI sytem table
37 @param SmmScriptTablePages The expected ScriptTable page number
38 @param SmmScriptTableBase The returned ScriptTable base address
39
40 @retval EFI_OUT_OF_RESOURCES No resource to do the initialization.
41 @retval EFI_SUCCESS Function has completed successfully.
42
43 **/
44 EFI_STATUS
45 EFIAPI
46 InitializeSmmScriptLib (
47 IN EFI_SYSTEM_TABLE *SystemTable,
48 IN UINTN SmmScriptTablePages,
49 OUT EFI_PHYSICAL_ADDRESS *SmmScriptTableBase
50 );
51 /**
52 Create Boot Script table.
53
54 It will be ignore and just return EFI_SUCCESS since the boot script table is
55 maintained by DxeBootScriptLib. Create Table is not needed.
56
57 @param ScriptTable Pointer to the boot script table to create.
58 @param Type The type of table to creat.
59
60
61 @retval EFI_SUCCESS Function has completed successfully.
62
63 **/
64 EFI_STATUS
65 EFIAPI
66 SmmBootScriptCreateTable (
67 IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
68 IN UINTN Type
69 );
70 /**
71 Adds a record into a specified Framework boot script table.
72
73 This function is used to store a boot script record into a given boot
74 script table in SMM runtime. The parameter is the same with definitionin BootScriptSave Protocol.
75
76 @param ScriptTable Pointer to the script table to write to. In the thunk implementation, this parameter is ignored
77 since the boot script table is maintained by BootScriptLib.
78 @param Type Not used.
79 @param OpCode The operation code (opcode) number.
80 @param ... Argument list that is specific to each opcode.
81
82 @retval EFI_SUCCESS The operation succeeded. A record was added into the
83 specified script table.
84 @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
85 If the opcode is unknow or not supported because of the PCD
86 Feature Flags.
87 @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
88 **/
89 EFI_STATUS
90 EFIAPI
91 SmmBootScriptWrite (
92 IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
93 IN UINTN Type,
94 IN UINT16 OpCode,
95 ...
96 );
97 /**
98 Close Boot Script table.
99
100 It will be ignore and just return EFI_SUCCESS since the boot script table
101 is maintained by DxeBootScriptLib.
102
103 @param ScriptTableBase Pointer to the boot script table to create.
104 @param ScriptTablePtr Pointer to the script table to write to.
105 @param Type The type of table to creat.
106
107 @retval EFI_SUCCESS - Function has completed successfully.
108
109 **/
110 EFI_STATUS
111 EFIAPI
112 SmmBootScriptCloseTable (
113 IN EFI_SMM_SCRIPT_TABLE ScriptTableBase,
114 IN EFI_SMM_SCRIPT_TABLE ScriptTablePtr,
115 IN UINTN Type
116 );
117
118
119 #endif