]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
fix ecc warning
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / Variable.h
1 /** @file
2
3 The internal header file includes the common header files, defines
4 internal structure and functions used by RuntimeVariable module.
5
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #ifndef _VARIABLE_H_
18 #define _VARIABLE_H_
19
20 #include <PiDxe.h>
21 #include <Protocol/VariableWrite.h>
22 #include <Protocol/FaultTolerantWriteLite.h>
23 #include <Protocol/FirmwareVolumeBlock.h>
24 #include <Protocol/Variable.h>
25 #include <Library/PcdLib.h>
26 #include <Library/UefiDriverEntryPoint.h>
27 #include <Library/DxeServicesTableLib.h>
28 #include <Library/UefiRuntimeLib.h>
29 #include <Library/DebugLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/FvbServiceLib.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/UefiLib.h>
34 #include <Library/BaseLib.h>
35 #include <Library/SynchronizationLib.h>
36 #include <Library/MemoryAllocationLib.h>
37 #include <Guid/VariableInfo.h>
38 #include <Guid/GlobalVariable.h>
39 #include <Guid/EventGroup.h>
40 #include <VariableFormat.h>
41
42 #define VARIABLE_RECLAIM_THRESHOLD (1024)
43
44 typedef struct {
45 VARIABLE_HEADER *CurrPtr;
46 VARIABLE_HEADER *EndPtr;
47 VARIABLE_HEADER *StartPtr;
48 BOOLEAN Volatile;
49 } VARIABLE_POINTER_TRACK;
50
51 typedef struct {
52 EFI_PHYSICAL_ADDRESS VolatileVariableBase;
53 EFI_PHYSICAL_ADDRESS NonVolatileVariableBase;
54 EFI_LOCK VariableServicesLock;
55 UINT32 ReentrantState;
56 } VARIABLE_GLOBAL;
57
58 typedef struct {
59 VARIABLE_GLOBAL VariableGlobal;
60 UINTN VolatileLastVariableOffset;
61 UINTN NonVolatileLastVariableOffset;
62 UINT32 FvbInstance;
63 } VARIABLE_MODULE_GLOBAL;
64
65 typedef struct {
66 EFI_GUID *Guid;
67 CHAR16 *Name;
68 UINT32 Attributes;
69 UINTN DataSize;
70 VOID *Data;
71 } VARIABLE_CACHE_ENTRY;
72
73 /**
74 Writes a buffer to variable storage space, in the working block.
75
76 This function writes a buffer to variable storage space into firmware
77 volume block device. The destination is specified by parameter
78 VariableBase. Fault Tolerant Write protocol is used for writing.
79
80 @param VariableBase Base address of variable to write
81 @param Buffer Point to the data buffer
82 @param BufferSize The number of bytes of the data Buffer
83
84 @retval EFI_SUCCESS The function completed successfully
85 @retval EFI_NOT_FOUND Fail to locate Fault Tolerant Write protocol
86 @retval EFI_ABORTED The function could not complete successfully
87
88 **/
89 EFI_STATUS
90 FtwVariableSpace (
91 IN EFI_PHYSICAL_ADDRESS VariableBase,
92 IN UINT8 *Buffer,
93 IN UINTN BufferSize
94 );
95
96
97 #endif