summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Pei
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-04 20:05:09 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-12-04 20:05:09 +0000
commit6a55eea3eba088eaaad7c7f1f14580016c37406b (patch)
tree7097f7c9370102ec685b154cff8d947f35e46f8b /MdeModulePkg/Core/Pei
parent852b63412859f34e6d541ec586eec573e520af63 (diff)
downloadedk2-6a55eea3eba088eaaad7c7f1f14580016c37406b.zip
edk2-6a55eea3eba088eaaad7c7f1f14580016c37406b.tar.gz
edk2-6a55eea3eba088eaaad7c7f1f14580016c37406b.tar.bz2
Update PEI/DXE/SMM dispatchers to include DEBUG ((DEBUG_DISPATCH, )) macros to log the evaluation of all dependency expressions.
This logging can be enabled by setting the DEBUG_DISPATCH bit(0x80) of the PCD gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11117 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Pei')
-rw-r--r--MdeModulePkg/Core/Pei/Dependency/Dependency.c22
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c10
2 files changed, 31 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.c b/MdeModulePkg/Core/Pei/Dependency/Dependency.c
index 1ef1408..eea0feb 100644
--- a/MdeModulePkg/Core/Pei/Dependency/Dependency.c
+++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.c
@@ -5,7 +5,7 @@
if a driver can be scheduled for execution. The criteria for
schedulability is that the dependency expression is satisfied.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2010, 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
@@ -123,6 +123,7 @@ PeimDispatchReadiness (
// EvalStack on the push
//
if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
@@ -132,11 +133,17 @@ PeimDispatchReadiness (
//
StackPtr->Operator = (VOID *) Iterator;
Iterator = Iterator + sizeof (EFI_GUID);
+ DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) = %a\n", StackPtr->Operator, IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));
StackPtr++;
break;
case (EFI_DEP_AND):
case (EFI_DEP_OR):
+ if (*(Iterator - 1) == EFI_DEP_AND) {
+ DEBUG ((DEBUG_DISPATCH, " AND\n"));
+ } else {
+ DEBUG ((DEBUG_DISPATCH, " OR\n"));
+ }
//
// Check to make sure the dependency grammar doesn't underflow the
// EvalStack on the two POPs for the AND operation. Don't need to
@@ -144,6 +151,7 @@ PeimDispatchReadiness (
// did two POPs.
//
if (StackPtr < &EvalStack[2]) {
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
@@ -176,18 +184,22 @@ PeimDispatchReadiness (
break;
case (EFI_DEP_END):
+ DEBUG ((DEBUG_DISPATCH, " END\n"));
StackPtr--;
//
// Check to make sure EvalStack is balanced. If not, then there is
// an error in the dependency grammar, so return EFI_INVALID_PARAMETER.
//
if (StackPtr != &EvalStack[0]) {
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
+ DEBUG ((DEBUG_DISPATCH, " RESULT = %a\n", IsPpiInstalled (PeiServices, StackPtr) ? "TRUE" : "FALSE"));
return IsPpiInstalled (PeiServices, StackPtr);
break;
case (EFI_DEP_NOT):
+ DEBUG ((DEBUG_DISPATCH, " NOT\n"));
//
// Check to make sure the dependency grammar doesn't underflow the
// EvalStack on the POP for the NOT operation. Don't need to
@@ -195,6 +207,7 @@ PeimDispatchReadiness (
// did a POP.
//
if (StackPtr < &EvalStack[1]) {
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
(StackPtr-1)->Result = (BOOLEAN) !IsPpiInstalled (PeiServices, (StackPtr-1));
@@ -203,11 +216,17 @@ PeimDispatchReadiness (
case (EFI_DEP_TRUE):
case (EFI_DEP_FALSE):
+ if (*(Iterator - 1) == EFI_DEP_TRUE) {
+ DEBUG ((DEBUG_DISPATCH, " TRUE\n"));
+ } else {
+ DEBUG ((DEBUG_DISPATCH, " FALSE\n"));
+ }
//
// Check to make sure the dependency grammar doesn't overflow the
// EvalStack on the push
//
if (StackPtr > &EvalStack[MAX_GRAMMAR_SIZE-1]) {
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Underflow Error)\n"));
return FALSE;
}
//
@@ -225,6 +244,7 @@ PeimDispatchReadiness (
break;
default:
+ DEBUG ((DEBUG_DISPATCH, " RESULT = FALSE (Invalid opcode)\n"));
//
// The grammar should never arrive here
//
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 6198114..3dd7549 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1078,11 +1078,20 @@ DepexSatisfied (
{
EFI_STATUS Status;
VOID *DepexData;
+ EFI_FV_FILE_INFO FileInfo;
+ Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_DISPATCH, "Evaluate PEI DEPEX for FFS(Unknown)\n"));
+ } else {
+ DEBUG ((DEBUG_DISPATCH, "Evaluate PEI DEPEX for FFS(%g)\n", &FileInfo.FileName));
+ }
+
if (PeimCount < Private->AprioriCount) {
//
// If its in the A priori file then we set Depex to TRUE
//
+ DEBUG ((DEBUG_DISPATCH, " RESULT = TRUE (Apriori)\n"));
return TRUE;
}
@@ -1099,6 +1108,7 @@ DepexSatisfied (
//
// If there is no DEPEX, assume the module can be executed
//
+ DEBUG ((DEBUG_DISPATCH, " RESULT = TRUE (No DEPEX)\n"));
return TRUE;
}