]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.h
Fix a bug that the invalid public key will never be removed from public key database.
[mirror_edk2.git] / SecurityPkg / VariableAuthenticated / RuntimeDxe / Variable.h
index 563485f9293587f9493a56c800e5e9426d0e9ec6..427245abcecfdb291cfd8ecc9574c04eebef7266 100644 (file)
@@ -2,7 +2,7 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by Variable modules.\r
 \r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2013, 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
@@ -99,6 +99,19 @@ typedef struct {
   VOID        *Data;\r
 } VARIABLE_CACHE_ENTRY;\r
 \r
+/**\r
+  Flush the HOB variable to flash.\r
+\r
+  @param[in] VariableName       Name of variable has been updated or deleted.\r
+  @param[in] VendorGuid         Guid of variable has been updated or deleted.\r
+\r
+**/\r
+VOID\r
+FlushHobVariableToFlash (\r
+  IN CHAR16                     *VariableName,\r
+  IN EFI_GUID                   *VendorGuid\r
+  );\r
+\r
 /**\r
   Writes a buffer to variable storage space, in the working block.\r
 \r
@@ -353,6 +366,37 @@ VariableCommonInitialize (
   VOID\r
   );\r
 \r
+/**\r
+\r
+  Variable store garbage collection and reclaim operation.\r
+\r
+  If ReclaimPubKeyStore is FALSE, reclaim variable space by deleting the obsoleted varaibles.\r
+  If ReclaimPubKeyStore is TRUE, reclaim invalid key in public key database and update the PubKeyIndex\r
+  for all the count-based authenticate variable in NV storage.\r
+\r
+  @param[in]   VariableBase            Base address of variable store.\r
+  @param[out]  LastVariableOffset      Offset of last variable.\r
+  @param[in]   IsVolatile              The variable store is volatile or not;\r
+                                       if it is non-volatile, need FTW.\r
+  @param[in]   UpdatingVariable        Pointer to updating variable.\r
+  @param[in]   ReclaimPubKeyStore      Reclaim for public key database or not.\r
+  @param[in]   ReclaimAnyway           If TRUE, do reclaim anyway.\r
+  \r
+  @return EFI_OUT_OF_RESOURCES         No enough memory resources.\r
+  @return EFI_SUCCESS                  Reclaim operation has finished successfully.\r
+  @return Others                       Unexpect error happened during reclaim operation.\r
+\r
+**/\r
+EFI_STATUS\r
+Reclaim (\r
+  IN  EFI_PHYSICAL_ADDRESS  VariableBase,\r
+  OUT UINTN                 *LastVariableOffset,\r
+  IN  BOOLEAN               IsVolatile,\r
+  IN  VARIABLE_HEADER       *UpdatingVariable,\r
+  IN  BOOLEAN               ReclaimPubKeyStore,\r
+  IN  BOOLEAN               ReclaimAnyway\r
+  );\r
+\r
 /**\r
   This function reclaims variable storage if free size is below the threshold.\r
   \r