]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/Variable.h
remove some comments introduced by tools.
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / EmuRuntimeDxe / Variable.h
1 /*++
2
3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Variable.h
15
16 Abstract:
17
18 --*/
19
20 #ifndef _VARIABLE_H
21 #define _VARIABLE_H
22
23 //
24 // Statements that include other header files
25 //
26
27 #include <PiDxe.h>
28
29 #include <Protocol/VariableWrite.h>
30 #include <Protocol/Variable.h>
31
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/DebugLib.h>
35 #include <Library/UefiRuntimeLib.h>
36 #include <Library/UefiDriverEntryPoint.h>
37 #include <Library/UefiBootServicesTableLib.h>
38 #include <Library/UefiLib.h>
39 #include <Library/BaseLib.h>
40
41 //
42 // BugBug: We need relcate the head file.
43 //
44 #include <Common/Variable.h>
45
46 #define VARIABLE_STORE_SIZE (64 * 1024)
47 #define SCRATCH_SIZE (4 * 1024)
48
49 //
50 // Define GET_PAD_SIZE to optimize compiler
51 //
52 #if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
53 #define GET_PAD_SIZE(a) (0)
54 #else
55 #define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
56 #endif
57
58 #define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
59
60 typedef enum {
61 Physical,
62 Virtual
63 } VARIABLE_POINTER_TYPE;
64
65 typedef struct {
66 VARIABLE_HEADER *CurrPtr;
67 VARIABLE_HEADER *EndPtr;
68 VARIABLE_HEADER *StartPtr;
69 BOOLEAN Volatile;
70 } VARIABLE_POINTER_TRACK;
71
72 typedef struct {
73 EFI_PHYSICAL_ADDRESS VolatileVariableBase;
74 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;
75 EFI_LOCK VariableServicesLock;
76 } VARIABLE_GLOBAL;
77
78 typedef struct {
79 VARIABLE_GLOBAL VariableGlobal[2];
80 UINTN VolatileLastVariableOffset;
81 UINTN NonVolatileLastVariableOffset;
82 UINT32 FvbInstance;
83 } ESAL_VARIABLE_GLOBAL;
84
85 extern ESAL_VARIABLE_GLOBAL *mVariableModuleGlobal;
86
87 //
88 // Functions
89 //
90 EFI_STATUS
91 EFIAPI
92 VariableCommonInitialize (
93 IN EFI_HANDLE ImageHandle,
94 IN EFI_SYSTEM_TABLE *SystemTable
95 )
96 ;
97
98 EFI_STATUS
99 EFIAPI
100 VariableServiceInitialize (
101 IN EFI_HANDLE ImageHandle,
102 IN EFI_SYSTEM_TABLE *SystemTable
103 )
104 ;
105
106 VOID
107 EFIAPI
108 VariableClassAddressChangeEvent (
109 IN EFI_EVENT Event,
110 IN VOID *Context
111 )
112 ;
113
114 EFI_STATUS
115 EFIAPI
116 GetVariable (
117 IN CHAR16 *VariableName,
118 IN EFI_GUID * VendorGuid,
119 OUT UINT32 *Attributes OPTIONAL,
120 IN OUT UINTN *DataSize,
121 OUT VOID *Data,
122 IN VARIABLE_GLOBAL * Global,
123 IN UINT32 Instance
124 )
125 ;
126
127 EFI_STATUS
128 EFIAPI
129 GetNextVariableName (
130 IN OUT UINTN *VariableNameSize,
131 IN OUT CHAR16 *VariableName,
132 IN OUT EFI_GUID *VendorGuid,
133 IN VARIABLE_GLOBAL *Global,
134 IN UINT32 Instance
135 )
136 ;
137
138 EFI_STATUS
139 EFIAPI
140 SetVariable (
141 IN CHAR16 *VariableName,
142 IN EFI_GUID *VendorGuid,
143 IN UINT32 Attributes,
144 IN UINTN DataSize,
145 IN VOID *Data,
146 IN VARIABLE_GLOBAL *Global,
147 IN UINTN *VolatileOffset,
148 IN UINTN *NonVolatileOffset,
149 IN UINT32 Instance
150 )
151 ;
152
153 EFI_STATUS
154 EFIAPI
155 QueryVariableInfo (
156 IN UINT32 Attributes,
157 OUT UINT64 *MaximumVariableStorageSize,
158 OUT UINT64 *RemainingVariableStorageSize,
159 OUT UINT64 *MaximumVariableSize,
160 IN VARIABLE_GLOBAL *Global,
161 IN UINT32 Instance
162 )
163 ;
164
165 #endif