Revision: 16685
          http://sourceforge.net/p/edk2/code/16685
Author:   lzeng14
Date:     2015-02-02 03:18:10 +0000 (Mon, 02 Feb 2015)
Log Message:
-----------
SecurityPkg Variable: Before EndOfDxe, just record the current boot 
VarErrorFlag to local variable.

And leave the variable error flag in NV flash as the last boot variable error 
flag.
After EndOfDxe in InitializeVarErrorFlag (), the variable error flag in NV flash
will be initialized to this local current boot variable error flag.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c

Modified: trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c
===================================================================
--- trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c  
2015-02-02 03:17:27 UTC (rev 16684)
+++ trunk/edk2/SecurityPkg/VariableAuthenticated/RuntimeDxe/Variable.c  
2015-02-02 03:18:10 UTC (rev 16685)
@@ -58,7 +58,10 @@
 ///
 BOOLEAN                mEnableLocking         = TRUE;
 
-/**
+//
+// It will record the current boot error flag before EndOfDxe.
+//
+VAR_ERROR_FLAG         mCurrentBootVarErrFlag = VAR_ERROR_FLAG_NO_ERROR;
 
   SecureBoot Hook for auth variable update.
 
@@ -579,6 +582,17 @@
     }
   );
 
+  if (!mEndOfDxe) {
+    //
+    // Before EndOfDxe, just record the current boot variable error flag to 
local variable,
+    // and leave the variable error flag in NV flash as the last boot variable 
error flag.
+    // After EndOfDxe in InitializeVarErrorFlag (), the variable error flag in 
NV flash
+    // will be initialized to this local current boot variable error flag.
+    //
+    mCurrentBootVarErrFlag &= Flag;
+    return;
+  }
+
   //
   // Record error flag (it should have be initialized).
   //
@@ -637,7 +651,7 @@
     return;
   }
 
-  Flag = VAR_ERROR_FLAG_NO_ERROR;
+  Flag = mCurrentBootVarErrFlag;
   DEBUG ((EFI_D_INFO, "Initialize variable error flag (%02x)\n", Flag));
 
   Status = FindVariable (


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to