]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/PiSmmCore/Smi.c
MdeModulePkg PiSmmCore: Retrieve Smram base address from system table
[mirror_edk2.git] / MdeModulePkg / Core / PiSmmCore / Smi.c
index 1868bbf9e195be969ba07a220ea3b3bdd34ad6b0..816d0f51936042bbf1c98b0b72ca3c8169e40a75 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   SMI management.\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 are licensed and made available \r
   under the terms and conditions of the BSD License which accompanies this \r
   distribution.  The full text of the license may be found at        \r
@@ -128,11 +128,11 @@ SmiManage (
   LIST_ENTRY   *Head;\r
   SMI_ENTRY    *SmiEntry;\r
   SMI_HANDLER  *SmiHandler;\r
-  BOOLEAN      InterruptQuiesced;\r
+  BOOLEAN      SuccessReturn;\r
   EFI_STATUS   Status;\r
   \r
   Status = EFI_NOT_FOUND;\r
-  InterruptQuiesced = FALSE;\r
+  SuccessReturn = FALSE;\r
   if (HandlerType == NULL) {\r
     //\r
     // Root SMI handler\r
@@ -167,24 +167,32 @@ SmiManage (
     switch (Status) {\r
     case EFI_INTERRUPT_PENDING:\r
       //\r
-      // If a handler returns EFI_INTERRUPT_PENDING then no additional handlers \r
-      // will be processed and EFI_INTERRUPT_PENDING will be returned.\r
+      // If a handler returns EFI_INTERRUPT_PENDING and HandlerType is not NULL then\r
+      // no additional handlers will be processed and EFI_INTERRUPT_PENDING will be returned.\r
       //\r
-      return EFI_INTERRUPT_PENDING;\r
+      if (HandlerType != NULL) {\r
+        return EFI_INTERRUPT_PENDING;\r
+      }\r
+      break;\r
 \r
     case EFI_SUCCESS:\r
       //\r
-      // If a handler returns EFI_SUCCESS then no additional handlers will be processed.\r
-      // then the function will return EFI_SUCCESS.\r
+      // If at least one of the handlers returns EFI_SUCCESS then the function will return\r
+      // EFI_SUCCESS. If a handler returns EFI_SUCCESS and HandlerType is not NULL then no\r
+      // additional handlers will be processed.\r
       //\r
-      return EFI_SUCCESS;\r
+      if (HandlerType != NULL) {\r
+        return EFI_SUCCESS;\r
+      }\r
+      SuccessReturn = TRUE;\r
+      break;\r
 \r
     case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:\r
       //\r
       // If at least one of the handlers returns EFI_WARN_INTERRUPT_SOURCE_QUIESCED\r
       // then the function will return EFI_SUCCESS. \r
       //\r
-      InterruptQuiesced = TRUE;\r
+      SuccessReturn = TRUE;\r
       break;\r
 \r
     case EFI_WARN_INTERRUPT_SOURCE_PENDING:\r
@@ -203,7 +211,7 @@ SmiManage (
     }\r
   }\r
 \r
-  if (InterruptQuiesced) {\r
+  if (SuccessReturn) {\r
     Status = EFI_SUCCESS;\r
   }\r
 \r