Revision: 14233
          http://edk2.svn.sourceforge.net/edk2/?rev=14233&view=rev
Author:   vanjeff
Date:     2013-04-01 08:28:05 +0000 (Mon, 01 Apr 2013)
Log Message:
-----------
Sync patches r14074, r14113, r14118, r14136, r14140, r14147, r14150, r14161, 
r14217, r14218 from main trunk.
1. Take the highest horizontal resolution as highest video resolution.
2. Update DxeCore to get correct AuthenticationStatus and invoke gSecurity 
after FV image file is extracted by ReadSection(), and remove the gSecurity 
invoking in SmmDriverDispatchHandler() in SmmCore since FV has been verified in 
DxeCore.
   Update SmmLoadImage() to return EFI_SECURITY_VIOLATION when gSecurity 
returns EFI_SECURITY_VIOLATION.
3. Update SecurityStub SAP protocol to support SecureHandler and SecureHandler2 
both.
4. Update SmiManager() comments and implementation to follow the new rule 
clarified by PI 1.2.1 errata A. 
   a. If at least one of the handlers returns 
EFI_WARN_INTERRUPT_SOURCE_QUIESCED or EFI_SUCCESS then the function will return 
EFI_SUCCESS.
      If a handler returns EFI_SUCCESS and HandlerType is not NULL then no 
additional handlers will be processed.
   b. If a handler returns EFI_INTERRUPT_PENDING and HandlerType is not NULL 
then no additional handlers will be processed and EFI_INTERRUPT_PENDING will be 
returned.
5. Shouldn't free the PciDev structure because the PciDev needs to be saved to 
RemovedPciDev array.
6. Adds ASSERT check in DxePcd driver when error status of read DynamicHii PCD 
is not EFI_NOT_FOUND to avoid the incorrect value is used.
7. Not close gEfiEndOfDxeEventGroupGuid event in ReadyToLock event notify 
because PI spec doesn't say gEfiEndOfDxeEventGroupGuid must be notified before 
ReadyToLock event.
8. Enhance the ConPlatform driver to take care of the optional Controller 
device path node when comparing the GOP device path.
9. Fix a bug in the DXE Core that generates an ASSERT() when the page at 
address zero is freed and DEBUG_CLEAR_MEMORY() macros are enabled.
10. Guarantee that free memory in the 4K page starting at address 0 is always 
cleared to 0.

Revision Links:
--------------
    http://edk2.svn.sourceforge.net/edk2/?rev=14074&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14113&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14118&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14136&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14140&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14147&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14150&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14161&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14217&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=14218&view=rev

Modified Paths:
--------------
    branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
    branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
    branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Mem/Page.c
    branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
    branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
    branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Smi.c
    
branches/UDK2010.SR1/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
    
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
    
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
    branches/UDK2010.SR1/MdeModulePkg/Universal/PCD/Dxe/Service.c
    branches/UDK2010.SR1/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c

Modified: branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c 
2013-04-01 07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c 
2013-04-01 08:28:05 UTC (rev 14233)
@@ -794,7 +794,6 @@
     if (Temp == PciDevice) {
       InitializePciDevice (Temp);
       RemoveEntryList (CurrentLink);
-      FreePciDevice (Temp);
       return EFI_SUCCESS;
     }
 

Modified: branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c  
2013-04-01 07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c  
2013-04-01 08:28:05 UTC (rev 14233)
@@ -26,7 +26,7 @@
   Depex - Dependency Expresion.
   SOR   - Schedule On Request - Don't schedule if this bit is set.
 
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -984,6 +984,7 @@
   UINTN                               BufferSize;
   EFI_FIRMWARE_VOLUME_HEADER          *FvHeader;
   UINT32                              FvAlignment;
+  EFI_DEVICE_PATH_PROTOCOL            *FvFileDevicePath;
 
   //
   // Read the first (and only the first) firmware volume section
@@ -1004,7 +1005,33 @@
                  &AuthenticationStatus
                  );
   if (!EFI_ERROR (Status)) {
+     //
+    // Evaluate the authentication status of the Firmware Volume through
+    // Security Architectural Protocol
     //
+    if (gSecurity != NULL) {
+      FvFileDevicePath = CoreFvToDevicePath (Fv, FvHandle, DriverName);
+      Status = gSecurity->FileAuthenticationState (
+                            gSecurity,
+                            AuthenticationStatus,
+                            FvFileDevicePath
+                            );
+      if (FvFileDevicePath != NULL) {
+        FreePool (FvFileDevicePath);
+      }
+
+      if (Status != EFI_SUCCESS) {
+        //
+        // Security check failed. The firmware volume should not be used for 
any purpose.
+        //
+        if (Buffer != NULL) {
+          FreePool (Buffer);
+        }
+        return Status;
+      }
+    }
+
+    //
     // FvImage should be at its required alignment.
     //
     FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) Buffer;
@@ -1087,7 +1114,6 @@
 {
   EFI_STATUS                    Status;
   EFI_STATUS                    GetNextFileStatus;
-  EFI_STATUS                    SecurityStatus;
   EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
   EFI_DEVICE_PATH_PROTOCOL      *FvDevicePath;
   EFI_HANDLE                    FvHandle;
@@ -1160,24 +1186,6 @@
     }
 
     //
-    // Evaluate the authentication status of the Firmware Volume through
-    // Security Architectural Protocol
-    //
-    if (gSecurity != NULL) {
-      SecurityStatus = gSecurity->FileAuthenticationState (
-                                    gSecurity,
-                                    0,
-                                    FvDevicePath
-                                    );
-      if (SecurityStatus != EFI_SUCCESS) {
-        //
-        // Security check failed. The firmware volume should not be used for 
any purpose.
-        //
-        continue;
-      }
-    }
-
-    //
     // Discover Drivers in FV and add them to the Discovered Driver List.
     // Process EFI_FV_FILETYPE_DRIVER type and then 
EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER
     //  EFI_FV_FILETYPE_DXE_CORE is processed to produce a Loaded Image 
protocol for the core

Modified: branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Mem/Page.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Mem/Page.c       2013-04-01 
07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Core/Dxe/Mem/Page.c       2013-04-01 
08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   UEFI Memory page management functions.
 
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -177,8 +177,21 @@
   ASSERT_LOCKED (&gMemoryLock);
 
   DEBUG ((DEBUG_PAGE, "AddRange: %lx-%lx to %d\n", Start, End, Type));
-
+  
   //
+  // If memory of type EfiConventionalMemory is being added that includes the 
page 
+  // starting at address 0, then zero the page starting at address 0.  This 
has 
+  // two benifits.  It helps find NULL pointer bugs and it also maximizes 
+  // compatibility with operating systems that may evaluate memory in this 
page 
+  // for legacy data structures.  If memory of any other type is added 
starting 
+  // at address 0, then do not zero the page at address 0 because the page is 
being 
+  // used for other purposes.
+  //  
+  if (Type == EfiConventionalMemory && Start == 0 && (End >= EFI_PAGE_SIZE - 
1)) {
+    SetMem ((VOID *)(UINTN)Start, EFI_PAGE_SIZE, 0);
+  }
+  
+  //
   // Memory map being altered so updated key
   //
   mMemoryMapKey += 1;
@@ -834,7 +847,18 @@
     //
     CoreAddRange (NewType, Start, RangeEnd, Attribute);
     if (NewType == EfiConventionalMemory) {
-      DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) Start, (UINTN) (RangeEnd - Start + 
1));
+      //
+      // Avoid calling DEBUG_CLEAR_MEMORY() for an address of 0 because this
+      // macro will ASSERT() if address is 0.  Instead, CoreAddRange() 
guarantees
+      // that the page starting at address 0 is always filled with zeros.
+      //
+      if (Start == 0) {
+        if (RangeEnd > EFI_PAGE_SIZE) {
+          DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) EFI_PAGE_SIZE, (UINTN) (RangeEnd 
- EFI_PAGE_SIZE + 1));
+        }
+      } else {
+        DEBUG_CLEAR_MEMORY ((VOID *)(UINTN) Start, (UINTN) (RangeEnd - Start + 
1));
+      }
     }
 
     //

Modified: branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Dispatcher.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Dispatcher.c       
2013-04-01 07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Dispatcher.c       
2013-04-01 08:28:05 UTC (rev 14233)
@@ -27,7 +27,7 @@
 
   Depex - Dependency Expresion.
 
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
   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        
@@ -671,6 +671,9 @@
   // used the UEFI Boot Services AllocatePool() function
   //
   Status = gBS->FreePool(Buffer);
+  if (!EFI_ERROR (Status) && EFI_ERROR (SecurityStatus)) {
+    Status = SecurityStatus;
+  }
   return Status;  
 }
 
@@ -1197,7 +1200,6 @@
   UINTN                         HandleCount;
   EFI_HANDLE                    *HandleBuffer;
   EFI_STATUS                    GetNextFileStatus;
-  EFI_STATUS                    SecurityStatus;
   EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
   EFI_DEVICE_PATH_PROTOCOL      *FvDevicePath;
   EFI_HANDLE                    FvHandle;
@@ -1259,31 +1261,6 @@
     }
 
     //
-    // If the Security Architectural Protocol has not been located yet, then 
attempt to locate it
-    //
-    if (mSecurity == NULL) {
-      gBS->LocateProtocol (&gEfiSecurityArchProtocolGuid, NULL, 
(VOID**)&mSecurity);
-    }
-
-    //
-    // Evaluate the authentication status of the Firmware Volume through
-    // Security Architectural Protocol
-    //
-    if (mSecurity != NULL) {
-      SecurityStatus = mSecurity->FileAuthenticationState (
-                                    mSecurity,
-                                    0,
-                                    FvDevicePath
-                                    );
-      if (SecurityStatus != EFI_SUCCESS) {
-        //
-        // Security check failed. The firmware volume should not be used for 
any purpose.
-        //
-        continue;
-      }
-    }
-
-    //
     // Discover Drivers in FV and add them to the Discovered Driver List.
     // Process EFI_FV_FILETYPE_SMM type and then 
EFI_FV_FILETYPE_COMBINED_SMM_DXE
     //

Modified: branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c 2013-04-01 
07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c 2013-04-01 
08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   SMM IPL that produces SMM related runtime protocols and load the SMM Core 
into SMRAM
 
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
   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        
@@ -267,7 +267,7 @@
   // the associated event is immediately signalled, so the notification 
function will be executed and the 
   // SMM End Of Dxe Protocol will be found if it is already in the handle 
database.
   //
-  { FALSE, TRUE,  &gEfiEndOfDxeEventGroupGuid,        SmmIplGuidedEventNotify, 
          &gEfiEndOfDxeEventGroupGuid,        TPL_CALLBACK, NULL },
+  { FALSE, FALSE,  &gEfiEndOfDxeEventGroupGuid,        
SmmIplGuidedEventNotify,           &gEfiEndOfDxeEventGroupGuid,        
TPL_CALLBACK, NULL },
   //
   // Declare event notification on the DXE Dispatch Event Group.  This event 
is signaled by the DXE Core
   // each time the DXE Core dispatcher has completed its work.  When this 
event is signalled, the SMM Core

Modified: branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Smi.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Smi.c      2013-04-01 
07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Core/PiSmmCore/Smi.c      2013-04-01 
08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   SMI management.
 
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
   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        
@@ -128,11 +128,11 @@
   LIST_ENTRY   *Head;
   SMI_ENTRY    *SmiEntry;
   SMI_HANDLER  *SmiHandler;
-  BOOLEAN      InterruptQuiesced;
+  BOOLEAN      SuccessReturn;
   EFI_STATUS   Status;
   
   Status = EFI_NOT_FOUND;
-  InterruptQuiesced = FALSE;
+  SuccessReturn = FALSE;
   if (HandlerType == NULL) {
     //
     // Root SMI handler
@@ -167,8 +167,8 @@
     switch (Status) {
     case EFI_INTERRUPT_PENDING:
       //
-      // If a handler returns EFI_INTERRUPT_PENDING then no additional 
handlers 
-      // will be processed and EFI_INTERRUPT_PENDING will be returned.
+      // If a handler returns EFI_INTERRUPT_PENDING and HandlerType is not 
NULL then
+      // no additional handlers will be processed and EFI_INTERRUPT_PENDING 
will be returned.
       //
       if (HandlerType != NULL) {
         return EFI_INTERRUPT_PENDING;
@@ -177,12 +177,14 @@
 
     case EFI_SUCCESS:
       //
-      // If a handler returns EFI_SUCCESS then no additional handlers will be 
processed.
-      // then the function will return EFI_SUCCESS.
+      // If at least one of the handlers returns EFI_SUCCESS then the function 
will return
+      // EFI_SUCCESS. If a handler returns EFI_SUCCESS and HandlerType is not 
NULL then no
+      // additional handlers will be processed.
       //
       if (HandlerType != NULL) {
         return EFI_SUCCESS;
       }
+      SuccessReturn = TRUE;
       break;
 
     case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:
@@ -190,7 +192,7 @@
       // If at least one of the handlers returns 
EFI_WARN_INTERRUPT_SOURCE_QUIESCED
       // then the function will return EFI_SUCCESS. 
       //
-      InterruptQuiesced = TRUE;
+      SuccessReturn = TRUE;
       break;
 
     case EFI_WARN_INTERRUPT_SOURCE_PENDING:
@@ -209,7 +211,7 @@
     }
   }
 
-  if (InterruptQuiesced) {
+  if (SuccessReturn) {
     Status = EFI_SUCCESS;
   }
 

Modified: 
branches/UDK2010.SR1/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
===================================================================
--- 
branches/UDK2010.SR1/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
       2013-04-01 07:43:46 UTC (rev 14232)
+++ 
branches/UDK2010.SR1/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.c
       2013-04-01 08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   Provides generic security measurement functions for DXE module.
 
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -102,7 +102,7 @@
   //
   // Make sure new auth operation can be recognized.
   //
-  ASSERT ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | 
EFI_AUTH_OPERATION_IMAGE_REQUIRED)) == 0);
+  ASSERT ((CheckAuthOperation & ~(EFI_AUTH_IMAGE_OPERATION_MASK | 
EFI_AUTH_OPERATION_AUTHENTICATION_STATE | EFI_AUTH_OPERATION_IMAGE_REQUIRED)) 
== 0);
   
   //
   // When current operation includes measure image operation, 

Modified: 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
===================================================================
--- 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
    2013-04-01 07:43:46 UTC (rev 14232)
+++ 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatform.c
    2013-04-01 08:28:05 UTC (rev 14233)
@@ -2,7 +2,7 @@
   Console Platform DXE Driver, install Console Device Guids and update Console
   Environment Variables.
 
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -792,7 +792,9 @@
   EFI_DEVICE_PATH_PROTOCOL  *NodeRight;
 
   for (NodeLeft = Left; !IsDevicePathEndType (NodeLeft); NodeLeft = 
NextDevicePathNode (NodeLeft)) {
-    if (DevicePathType (NodeLeft) == ACPI_DEVICE_PATH && DevicePathSubType 
(NodeLeft) == ACPI_ADR_DP) {
+    if ((DevicePathType (NodeLeft) == ACPI_DEVICE_PATH && DevicePathSubType 
(NodeLeft) == ACPI_ADR_DP) ||
+        (DevicePathType (NodeLeft) == HARDWARE_DEVICE_PATH && 
DevicePathSubType (NodeLeft) == HW_CONTROLLER_DP &&
+         DevicePathType (NextDevicePathNode (NodeLeft)) == ACPI_DEVICE_PATH && 
DevicePathSubType (NextDevicePathNode (NodeLeft)) == ACPI_ADR_DP)) {
       break;
     }
   }
@@ -802,7 +804,9 @@
   }
 
   for (NodeRight = Right; !IsDevicePathEndType (NodeRight); NodeRight = 
NextDevicePathNode (NodeRight)) {
-    if (DevicePathType (NodeRight) == ACPI_DEVICE_PATH && DevicePathSubType 
(NodeRight) == ACPI_ADR_DP) {
+    if ((DevicePathType (NodeRight) == ACPI_DEVICE_PATH && DevicePathSubType 
(NodeRight) == ACPI_ADR_DP) ||
+        (DevicePathType (NodeRight) == HARDWARE_DEVICE_PATH && 
DevicePathSubType (NodeRight) == HW_CONTROLLER_DP &&
+         DevicePathType (NextDevicePathNode (NodeRight)) == ACPI_DEVICE_PATH 
&& DevicePathSubType (NextDevicePathNode (NodeRight)) == ACPI_ADR_DP)) {
       break;
     }
   }

Modified: 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
===================================================================
--- 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
    2013-04-01 07:43:46 UTC (rev 14232)
+++ 
branches/UDK2010.SR1/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
    2013-04-01 08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   This is the main routine for initializing the Graphics Console support 
routines.
 
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -453,8 +453,8 @@
                            &Info
                            );
         if (!EFI_ERROR (Status)) {
-          if ((Info->HorizontalResolution >= HorizontalResolution) &&
-              (Info->VerticalResolution >= VerticalResolution)) {
+          if ((Info->HorizontalResolution > HorizontalResolution) ||
+              ((Info->HorizontalResolution == HorizontalResolution) && 
(Info->VerticalResolution > VerticalResolution))) {
             HorizontalResolution = Info->HorizontalResolution;
             VerticalResolution   = Info->VerticalResolution;
             ModeNumber           = ModeIndex;

Modified: branches/UDK2010.SR1/MdeModulePkg/Universal/PCD/Dxe/Service.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Universal/PCD/Dxe/Service.c       
2013-04-01 07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Universal/PCD/Dxe/Service.c       
2013-04-01 08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
     Help functions used by PCD DXE driver.
 
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
 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
@@ -150,6 +150,11 @@
             //
             GetPtrTypeSize (TmpTokenNumber, &GetSize);
           }
+          //
+          // If the operation is successful, we copy the data
+          // to the default value buffer in the PCD Database.
+          // So that we can free the Data allocated in GetHiiVariable.
+          //
           CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, 
GetSize);
           FreePool (Data);
         }
@@ -166,19 +171,14 @@
             //
             GetPtrTypeSize (TmpTokenNumber, &GetSize);
           }
+          //
+          // If the operation is successful, we copy the data
+          // to the default value buffer in the PCD Database.
+          // So that we can free the Data allocated in GetHiiVariable.
+          //
           CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, 
GetSize);
           FreePool (Data);
         }
-        //
-        // If the operation is successful, we copy the data
-        // to the default value buffer in the PCD Database.
-        // So that we can free the Data allocated in GetHiiVariable.
-        //
-        //
-        // If the operation is not successful, 
-        // Return 1) either the default value specified by Platform Integrator 
-        //        2) Or the value Set by a PCD set operation.
-        //
         RetPtr = (VOID *) VaraiableDefaultBuffer;
       }
       break;
@@ -535,6 +535,12 @@
     ASSERT (Status == EFI_SUCCESS);
     *VariableData = Buffer;
     *VariableSize = Size;
+  } else {
+    //
+    // Use Default Data only when variable is not found. 
+    // For other error status, correct data can't be got, and trig ASSERT().
+    //
+    ASSERT (Status == EFI_NOT_FOUND);
   }
 
   return Status;

Modified: 
branches/UDK2010.SR1/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c  
2013-04-01 07:43:46 UTC (rev 14232)
+++ branches/UDK2010.SR1/MdeModulePkg/Universal/SecurityStubDxe/SecurityStub.c  
2013-04-01 08:28:05 UTC (rev 14233)
@@ -1,7 +1,7 @@
 /** @file
   This driver produces Security2 and Security architectural protocol based on 
SecurityManagementLib.
  
-  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
   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        
@@ -69,13 +69,20 @@
   IN CONST EFI_DEVICE_PATH_PROTOCOL    *File
   )
 {
-  return ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_AUTHENTICATION_STATE, 
+  EFI_STATUS Status;
+  
+  Status = ExecuteSecurity2Handlers (EFI_AUTH_OPERATION_AUTHENTICATION_STATE, 
                                    AuthenticationStatus, 
                                    File,
                                    NULL, 
                                    0, 
                                    FALSE
                                    );
+  if (Status == EFI_SUCCESS) {
+    Status = ExecuteSecurityHandlers (AuthenticationStatus, File);
+  }
+  
+  return Status;
 }
 
 /**

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to