]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/FSVariable/FileStorage.c
IntelSiliconPkg/VTdDxe: Disable PMR
[mirror_edk2.git] / DuetPkg / FSVariable / FileStorage.c
index 0c25efa8c3c5b30a46a59cef52115c147a874509..d07c0bb25c6d2b6775538184611b629b7f1f38d1 100644 (file)
@@ -1,7 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Caution: This file is used for Duet platform only, do not use them in real platform.\r
+All variable code, variable metadata, and variable data used by Duet platform are on \r
+disk. They can be changed by user. BIOS is not able to protoect those.\r
+Duet trusts all meta data from disk. If variable code, variable metadata and variable\r
+data is modified in inproper way, the behavior is undefined.\r
+\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -55,7 +61,7 @@ OpenStore (
   IN  EFI_DEVICE_PATH_PROTOCOL  *Device,\r
   IN  CHAR16                    *FilePathName,\r
   IN  UINT64                    OpenMode,\r
-  OUT EFI_FILE                  **File\r
+  OUT EFI_FILE_PROTOCOL         **File\r
   );\r
 \r
 //\r
@@ -63,7 +69,7 @@ OpenStore (
 //\r
 VOID\r
 FileClose (\r
-  IN  EFI_FILE                   *File\r
+  IN  EFI_FILE_PROTOCOL          *File\r
   )\r
 {\r
   EFI_STATUS Status;\r
@@ -180,7 +186,7 @@ OnSimpleFileSystemInstall (
   EFI_HANDLE                Handle;\r
   EFI_DEVICE_PATH_PROTOCOL  *Device;\r
   VS_DEV                    *Dev;\r
-  EFI_FILE                  *File;\r
+  EFI_FILE_PROTOCOL         *File;\r
   UINTN                     NumBytes;\r
 \r
   Dev = (VS_DEV *) Context;\r
@@ -223,9 +229,7 @@ OnSimpleFileSystemInstall (
   NumBytes = Dev->Size;\r
   Status = File->Write (File, &NumBytes, VAR_DATA_PTR (Dev));\r
   ASSERT_EFI_ERROR (Status);\r
-  // KEN: bugbug here if closing file, volume handle will be free,\r
-  // and system will be hang when accessing volume handle in future.\r
-  //FileClose (File);\r
+  FileClose (File);\r
   DEBUG ((EFI_D_ERROR, "FileStorage: Mapped to file!\n"));\r
 }\r
 \r
@@ -247,7 +251,7 @@ FileStorageConstructor (
   ASSERT_EFI_ERROR (Status);\r
   ZeroMem (Dev, sizeof(VS_DEV));\r
 \r
-  CopyGuid (&Dev->Signature, &gEfiVariableGuid);\r
+  Dev->Signature          = VS_DEV_SIGNATURE;\r
   Dev->Size               = Size;\r
   VAR_DATA_PTR (Dev)      = (UINT8 *) (UINTN) NvStorageBase;\r
   VAR_FILE_VOLUMEID (Dev) = VolumeId;\r
@@ -288,7 +292,7 @@ FileEraseStore(
 {\r
   EFI_STATUS              Status;\r
   VS_DEV                  *Dev;\r
-  EFI_FILE                *File;\r
+  EFI_FILE_PROTOCOL       *File;\r
   UINTN                   NumBytes;\r
 \r
   Status = EFI_SUCCESS;\r
@@ -324,7 +328,7 @@ FileWriteStore (
 {\r
   EFI_STATUS              Status;\r
   VS_DEV                  *Dev;\r
-  EFI_FILE                *File;\r
+  EFI_FILE_PROTOCOL       *File;\r
 \r
   Status = EFI_SUCCESS;\r
   Dev    = DEV_FROM_THIS(This);\r
@@ -371,7 +375,7 @@ OpenStore (
   IN  EFI_DEVICE_PATH_PROTOCOL  *Device,\r
   IN  CHAR16                    *FilePathName,\r
   IN  UINT64                    OpenMode,\r
-  OUT EFI_FILE                  **File\r
+  OUT EFI_FILE_PROTOCOL         **File\r
   )\r
 {\r
   EFI_HANDLE                        Handle;\r