diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-18 03:09:54 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-18 03:09:54 +0000 |
commit | 9071550e8697ed9df3d24b369bd30e3f0e190d1f (patch) | |
tree | ae93a60e5311a6864330e72daee092255a2e64fb /DuetPkg/FSVariable/VariableStorage.h | |
parent | 25ab7ab110193a0b5fc468fd3839acb8ae4d93df (diff) | |
download | edk2-platforms-9071550e8697ed9df3d24b369bd30e3f0e190d1f.tar.xz |
Add missing module for duet package.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5088 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/FSVariable/VariableStorage.h')
-rw-r--r-- | DuetPkg/FSVariable/VariableStorage.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/DuetPkg/FSVariable/VariableStorage.h b/DuetPkg/FSVariable/VariableStorage.h new file mode 100644 index 0000000000..3ebfaeb5db --- /dev/null +++ b/DuetPkg/FSVariable/VariableStorage.h @@ -0,0 +1,111 @@ +/*++
+
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ VariableStorage.h
+
+Abstract:
+
+ handles variable store/reads with memory and file
+
+Revision History
+
+--*/
+#ifndef _VARIABLE_STORAGE_H_
+#define _VARIABLE_STORAGE_H_
+
+#define VAR_DEFAULT_VALUE (0xff)
+#define VAR_DEFAULT_VALUE_16 EFI_SIGNATURE_16 (VAR_DEFAULT_VALUE, VAR_DEFAULT_VALUE)
+#define VAR_DEFAULT_VALUE_32 EFI_SIGNATURE_32 (VAR_DEFAULT_VALUE, VAR_DEFAULT_VALUE, \
+ VAR_DEFAULT_VALUE, VAR_DEFAULT_VALUE)
+
+typedef struct _VARIABLE_STORAGE VARIABLE_STORAGE;
+
+EFI_STATUS
+FileStorageConstructor (
+ OUT VARIABLE_STORAGE **VarStore,
+ OUT EFI_EVENT_NOTIFY *GoVirtualEvent,
+ IN EFI_PHYSICAL_ADDRESS NvStorageBase,
+ IN UINTN Size,
+ IN UINT32 VolumeId,
+ IN CHAR16 *FilePath
+ );
+
+EFI_STATUS
+MemStorageConstructor (
+ OUT VARIABLE_STORAGE **VarStore,
+ OUT EFI_EVENT_NOTIFY *GoVirtualEvent,
+ IN UINTN Size
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *ERASE_STORE) (
+ IN VARIABLE_STORAGE *This
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *WRITE_STORE) (
+ IN VARIABLE_STORAGE *This,
+ IN UINTN Offset,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+struct _VARIABLE_STORAGE {
+
+ //
+ // Functions to access the storage
+ //
+ ERASE_STORE Erase;
+ WRITE_STORE Write;
+};
+
+typedef struct _VS_FILE_INFO {
+ UINT8 *FileData; // local buffer for reading acceleration
+
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath; // device having storage file
+ UINT32 VolumeId;
+ CHAR16 FilePath[256];
+} VS_FILE_INFO;
+
+typedef struct _VS_MEM_INFO {
+ UINT8 *MemData;
+} VS_MEM_INFO;
+
+typedef struct _VS_DEV {
+ UINT32 Signature;
+ VARIABLE_STORAGE VarStore;
+ UINTN Size;
+
+ union {
+ //
+ // finally visit FileInfo.FileData or MemInfo.MemData
+ //
+ UINT8 *Data;
+
+ VS_FILE_INFO FileInfo;
+ VS_MEM_INFO MemInfo;
+ } Info;
+
+} VS_DEV;
+
+#define DEV_FROM_THIS(a) CR (a, VS_DEV, VarStore, VARIABLE_STORE_SIGNATURE)
+
+#define VAR_DATA_PTR(a) ((a)->Info.Data)
+#define VAR_FILE_DEVICEPATH(a) ((a)->Info.FileInfo.DevicePath)
+#define VAR_FILE_VOLUMEID(a) ((a)->Info.FileInfo.VolumeId)
+#define VAR_FILE_FILEPATH(a) ((a)->Info.FileInfo.FilePath)
+
+
+#endif
|