diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-12-03 05:59:57 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-12-03 05:59:57 +0000 |
commit | 86714ccd8e20acb7ac475c1fbd1338d3a918bc92 (patch) | |
tree | 02413bb405334d6ca346f9292b66acb7d76b1b06 | |
parent | dc6f9b3542045c8c8a19e9710f426d7a7d2effc9 (diff) | |
download | edk2-platforms-86714ccd8e20acb7ac475c1fbd1338d3a918bc92.tar.xz |
According to PI specification, if token number can not be found for dynamic-ex type PCD, return EFI_NOT_FOUND but not ASSERT().
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9511 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Universal/PCD/Pei/Service.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index 200c0d4639..a791ef725a 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -2,7 +2,7 @@ The driver internal functions are implmented here.
They build Pei PCD database, and provide access service to PCD database.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. 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
@@ -57,7 +57,10 @@ PeiRegisterCallBackWorker ( ASSERT (TokenNumber + 1 < PEI_NEX_TOKEN_NUMBER + 1);
} else {
TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);
-
+ if (TokenNumber == PCD_INVALID_TOKEN_NUMBER) {
+ return EFI_NOT_FOUND;
+ }
+
//
// TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.
// We have to decrement TokenNumber by 1 to make it usable
@@ -519,7 +522,10 @@ ExSetWorker ( }
TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);
-
+ if (TokenNumber == PCD_INVALID_TOKEN_NUMBER) {
+ return EFI_NOT_FOUND;
+ }
+
InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size);
return SetWorker (TokenNumber, Data, Size, PtrType);
@@ -702,9 +708,7 @@ GetExPcdTokenNumber ( }
}
- ASSERT (FALSE);
-
- return 0;
+ return PCD_INVALID_TOKEN_NUMBER;
}
/**
|