]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Dependency/Dependency.c
Update PEI/DXE/SMM dispatchers to include DEBUG ((DEBUG_DISPATCH, )) macros to log...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Dependency / Dependency.c
index 1ef14086bab2508c56073b3deee95369b84bd7b6..eea0feba96bf6fffd2fdf7e1ff291400b85bce2c 100644 (file)
@@ -5,7 +5,7 @@
   if a driver can be scheduled for execution.  The criteria for\r
   schedulability is that the dependency expression is satisfied.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, 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
@@ -123,6 +123,7 @@ PeimDispatchReadiness (
         // EvalStack on the push\r
         //\r
         if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {\r
+          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Underflow Error)\n"));\r
           return FALSE;\r
         }\r
 \r
@@ -132,11 +133,17 @@ PeimDispatchReadiness (
         //\r
         StackPtr->Operator = (VOID *) Iterator;\r
         Iterator = Iterator + sizeof (EFI_GUID);\r
+        DEBUG ((DEBUG_DISPATCH, "  PUSH GUID(%g) = %a\n", StackPtr->Operator, IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));\r
         StackPtr++;\r
         break;\r
 \r
       case (EFI_DEP_AND):    \r
       case (EFI_DEP_OR):     \r
+        if (*(Iterator - 1) == EFI_DEP_AND) {\r
+          DEBUG ((DEBUG_DISPATCH, "  AND\n"));\r
+        } else {\r
+          DEBUG ((DEBUG_DISPATCH, "  OR\n"));\r
+        }\r
         //\r
         // Check to make sure the dependency grammar doesn't underflow the\r
         // EvalStack on the two POPs for the AND operation.  Don't need to\r
@@ -144,6 +151,7 @@ PeimDispatchReadiness (
         // did two POPs.\r
         //\r
         if (StackPtr < &EvalStack[2]) {\r
+          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Underflow Error)\n"));\r
           return FALSE;\r
         }\r
 \r
@@ -176,18 +184,22 @@ PeimDispatchReadiness (
         break;\r
         \r
       case (EFI_DEP_END):\r
+        DEBUG ((DEBUG_DISPATCH, "  END\n"));\r
         StackPtr--;\r
         //\r
         // Check to make sure EvalStack is balanced.  If not, then there is\r
         // an error in the dependency grammar, so return EFI_INVALID_PARAMETER.\r
         //\r
         if (StackPtr != &EvalStack[0]) {\r
+          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Underflow Error)\n"));\r
           return FALSE;\r
         }\r
+        DEBUG ((DEBUG_DISPATCH, "  RESULT = %a\n", IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));\r
         return IsPpiInstalled (PeiServices, StackPtr);\r
         break;\r
 \r
       case (EFI_DEP_NOT):    \r
+        DEBUG ((DEBUG_DISPATCH, "  NOT\n"));\r
         //\r
         // Check to make sure the dependency grammar doesn't underflow the\r
         // EvalStack on the POP for the NOT operation.  Don't need to\r
@@ -195,6 +207,7 @@ PeimDispatchReadiness (
         // did a POP.\r
         //\r
         if (StackPtr < &EvalStack[1]) {\r
+          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Underflow Error)\n"));\r
           return FALSE;\r
         }\r
         (StackPtr-1)->Result = (BOOLEAN) !IsPpiInstalled (PeiServices, (StackPtr-1));\r
@@ -203,11 +216,17 @@ PeimDispatchReadiness (
 \r
       case (EFI_DEP_TRUE):\r
       case (EFI_DEP_FALSE):\r
+        if (*(Iterator - 1) == EFI_DEP_TRUE) {\r
+          DEBUG ((DEBUG_DISPATCH, "  TRUE\n"));\r
+        } else {\r
+          DEBUG ((DEBUG_DISPATCH, "  FALSE\n"));\r
+        }\r
         //\r
         // Check to make sure the dependency grammar doesn't overflow the\r
         // EvalStack on the push\r
         //\r
         if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {\r
+          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Underflow Error)\n"));\r
           return FALSE;\r
         }\r
         //\r
@@ -225,6 +244,7 @@ PeimDispatchReadiness (
         break;\r
 \r
       default:\r
+        DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Invalid opcode)\n"));\r
         //\r
         // The grammar should never arrive here\r
         //\r