]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update SmiManager() comments and implementation to follow the new rule clarified...
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Feb 2013 03:38:10 +0000 (03:38 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Feb 2013 03:38:10 +0000 (03:38 +0000)
1. 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.
2. 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.

Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14136 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/PiSmmCore/Smi.c

index 1111959c3a40f34332caddc30e7e59ed93508612..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,8 +167,8 @@ 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
       if (HandlerType != NULL) {\r
         return EFI_INTERRUPT_PENDING;\r
@@ -177,12 +177,14 @@ SmiManage (
 \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
       if (HandlerType != NULL) {\r
         return EFI_SUCCESS;\r
       }\r
+      SuccessReturn = TRUE;\r
       break;\r
 \r
     case EFI_WARN_INTERRUPT_SOURCE_QUIESCED:\r
@@ -190,7 +192,7 @@ SmiManage (
       // 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
@@ -209,7 +211,7 @@ SmiManage (
     }\r
   }\r
 \r
-  if (InterruptQuiesced) {\r
+  if (SuccessReturn) {\r
     Status = EFI_SUCCESS;\r
   }\r
 \r