Add Feature Flag PcdDxePcdDatabaseTraverseEnabled and PcdPeiPcdDatabaseTraverseEnabled

Add Pcd DXE driver and PEIM to all supported ARCH in EdkModulePkg-All-Archs.fpd

Make Pcd DXE driver and PEIM compilable under EBC, IPF, X64

Fixed a few other bugs.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@838 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2006-07-08 14:37:30 +00:00
parent 3c367f9de6
commit 4f914125e8
10 changed files with 5111 additions and 4340 deletions

View File

@@ -200,9 +200,15 @@ DxePcdGetSize (
//
TmpTokenNumber = TokenNumber;
ASSERT (TokenNumber < PCD_TOTAL_TOKEN_NUMBER);
// EBC compiler is very choosy. It may report warning about comparison
// between UINTN and 0 . So we add 1 in each size of the
// comparison.
ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);
IsPeiDb = (BOOLEAN) (TokenNumber < PEI_LOCAL_TOKEN_NUMBER);
// EBC compiler is very choosy. It may report warning about comparison
// between UINTN and 0 . So we add 1 in each size of the
// comparison.
IsPeiDb = (BOOLEAN) (TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1);
TokenNumber = IsPeiDb ? TokenNumber :
(TokenNumber - PEI_LOCAL_TOKEN_NUMBER);
@@ -501,25 +507,32 @@ DxePcdGetNextToken (
{
EFI_STATUS Status;
if (!FeaturePcdGet (PcdDxePcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
}
Status = EFI_NOT_FOUND;
//
// Scan the local token space
//
if (Guid == NULL) {
if (((*TokenNumber > PEI_NEX_TOKEN_NUMBER) && (*TokenNumber < PEI_LOCAL_TOKEN_NUMBER)) ||
((*TokenNumber > (PEI_LOCAL_TOKEN_NUMBER + DXE_NEX_TOKEN_NUMBER)))) {
// EBC compiler is very choosy. It may report warning about comparison
// between UINTN and 0 . So we add 1 in each size of the
// comparison.
if (((*TokenNumber + 1 > PEI_NEX_TOKEN_NUMBER + 1) && (*TokenNumber + 1 < PEI_LOCAL_TOKEN_NUMBER + 1)) ||
((*TokenNumber + 1 > (PEI_LOCAL_TOKEN_NUMBER + DXE_NEX_TOKEN_NUMBER + 1)))) {
return EFI_NOT_FOUND;
}
(*TokenNumber)++;
if (*TokenNumber > PEI_NEX_TOKEN_NUMBER &&
*TokenNumber <= PEI_LOCAL_TOKEN_NUMBER) {
if ((*TokenNumber + 1 > PEI_NEX_TOKEN_NUMBER + 1) &&
(*TokenNumber <= PEI_LOCAL_TOKEN_NUMBER)) {
//
// The first Non-Ex type Token Number for DXE PCD
// database is PEI_LOCAL_TOKEN_NUMBER
//
*TokenNumber = PEI_LOCAL_TOKEN_NUMBER;
} else if (*TokenNumber > DXE_NEX_TOKEN_NUMBER + PEI_LOCAL_TOKEN_NUMBER) {
} else if (*TokenNumber + 1 > DXE_NEX_TOKEN_NUMBER + PEI_LOCAL_TOKEN_NUMBER + 1) {
*TokenNumber = PCD_INVALID_TOKEN_NUMBER;
}
return EFI_SUCCESS;
@@ -618,6 +631,10 @@ DxePcdGetNextTokenSpace (
EFI_GUID **DxeTokenSpaceTable;
BOOLEAN Match;
if (!FeaturePcdGet (PcdDxePcdDatabaseTraverseEnabled)) {
return EFI_UNSUPPORTED;
}
ASSERT (Guid != NULL);
if (PEI_EXMAP_TABLE_EMPTY && DXE_EXMAP_TABLE_EMPTY) {