summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/PCD/Dxe
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-03 15:40:49 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-03 15:40:49 +0000
commitbb5545b663e1d8ac4fd37003d5ba26fafdad5831 (patch)
treecfc7c990d6c40fa4be7996e1609af57f05edb7b8 /EdkModulePkg/Universal/PCD/Dxe
parenta15bb0d31f5345dd81dde0e978a3cbdc54fa27e7 (diff)
downloadedk2-platforms-bb5545b663e1d8ac4fd37003d5ba26fafdad5831.tar.xz
Add PcdDxe and PcdPEIM to all-arch for EdkModulePkg-All-Archs.fpd
Fix a few bugs in PcdDxe and PcdPEIM git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@722 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/PCD/Dxe')
-rw-r--r--EdkModulePkg/Universal/PCD/Dxe/Service.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/EdkModulePkg/Universal/PCD/Dxe/Service.c b/EdkModulePkg/Universal/PCD/Dxe/Service.c
index 97518510d6..717a4345ea 100644
--- a/EdkModulePkg/Universal/PCD/Dxe/Service.c
+++ b/EdkModulePkg/Universal/PCD/Dxe/Service.c
@@ -742,19 +742,23 @@ GetExPcdTokenNumber (
EFI_GUID *MatchGuid;
UINTN MatchGuidIdx;
- ExMap = mPcdDatabase->PeiDb.Init.ExMapTable;
- GuidTable = mPcdDatabase->PeiDb.Init.GuidTable;
-
- MatchGuid = ScanGuid (GuidTable, sizeof(mPcdDatabase->PeiDb.Init.GuidTable), Guid);
- ASSERT (MatchGuid != NULL);
+ if (!PEI_DATABASE_EMPTY) {
+ ExMap = mPcdDatabase->PeiDb.Init.ExMapTable;
+ GuidTable = mPcdDatabase->PeiDb.Init.GuidTable;
+
+ MatchGuid = ScanGuid (GuidTable, sizeof(mPcdDatabase->PeiDb.Init.GuidTable), Guid);
+
+ if (MatchGuid != NULL) {
- MatchGuidIdx = MatchGuid - GuidTable;
-
- for (i = 0; i < PEI_EXMAPPING_TABLE_SIZE; i++) {
- if ((ExTokenNumber == ExMap[i].ExTokenNumber) &&
- (MatchGuidIdx == ExMap[i].ExGuidIndex)) {
- return ExMap[i].LocalTokenNumber;
+ MatchGuidIdx = MatchGuid - GuidTable;
+
+ for (i = 0; i < PEI_EXMAPPING_TABLE_SIZE; i++) {
+ if ((ExTokenNumber == ExMap[i].ExTokenNumber) &&
+ (MatchGuidIdx == ExMap[i].ExGuidIndex)) {
+ return ExMap[i].LocalTokenNumber;
+ }
+ }
}
}
@@ -762,6 +766,10 @@ GetExPcdTokenNumber (
GuidTable = mPcdDatabase->DxeDb.Init.GuidTable;
MatchGuid = ScanGuid (GuidTable, sizeof(mPcdDatabase->DxeDb.Init.GuidTable), Guid);
+ //
+ // We need to ASSERT here. If GUID can't be found in GuidTable, this is a
+ // error in the BUILD system.
+ //
ASSERT (MatchGuid != NULL);
MatchGuidIdx = MatchGuid - GuidTable;
@@ -769,7 +777,7 @@ GetExPcdTokenNumber (
for (i = 0; i < DXE_EXMAPPING_TABLE_SIZE; i++) {
if ((ExTokenNumber == ExMap[i].ExTokenNumber) &&
(MatchGuidIdx == ExMap[i].ExGuidIndex)) {
- return ExMap[i].LocalTokenNumber + PEI_LOCAL_TOKEN_NUMBER;
+ return ExMap[i].LocalTokenNumber;
}
}