Coding style fix and minor improvements.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9977 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
rsun3
2010-02-11 02:33:16 +00:00
parent 548dda8f74
commit 4140a6635b
23 changed files with 113 additions and 420 deletions

View File

@ -75,7 +75,7 @@ DiscoverPeimsAndOrderWithApriori (
//
// Go ahead to scan this Fv, and cache FileHandles within it.
//
for (PeimCount = 0; PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);
if (Status != EFI_SUCCESS) {
break;
@ -88,7 +88,7 @@ DiscoverPeimsAndOrderWithApriori (
// Check whether the count of Peims exceeds the max support PEIMs in a FV image
// If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
//
ASSERT (PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv));
ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));
//
// Get Apriori File handle
@ -598,7 +598,7 @@ PeiDispatcher (
PEI_CORE_FV_HANDLE *CoreFvHandle;
VOID *LoadFixPeiCodeBegin;
PeiServices = (CONST EFI_PEI_SERVICES **) &Private->PS;
PeiServices = (CONST EFI_PEI_SERVICES **) &Private->Ps;
PeimEntryPoint = NULL;
PeimFileHandle = NULL;
EntryPoint = 0;
@ -613,11 +613,11 @@ PeiDispatcher (
SaveCurrentFileHandle = Private->CurrentFileHandle;
for (Index1 = 0; Index1 <= SaveCurrentFvCount; Index1++) {
for (Index2 = 0; (Index2 < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
for (Index2 = 0; (Index2 < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->Fv[Index1].FvFileHandles[Index2] != NULL); Index2++) {
if (Private->Fv[Index1].PeimState[Index2] == PEIM_STATE_REGISITER_FOR_SHADOW) {
PeimFileHandle = Private->Fv[Index1].FvFileHandles[Index2];
Status = PeiLoadImage (
(CONST EFI_PEI_SERVICES **) &Private->PS,
(CONST EFI_PEI_SERVICES **) &Private->Ps,
PeimFileHandle,
PEIM_STATE_REGISITER_FOR_SHADOW,
&EntryPoint,
@ -637,7 +637,7 @@ PeiDispatcher (
PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint;
PERF_START (PeimFileHandle, "PEIM", NULL, 0);
PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->PS);
PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->Ps);
PERF_END (PeimFileHandle, "PEIM", NULL, 0);
}
@ -699,7 +699,7 @@ PeiDispatcher (
// Start to dispatch all modules within the current Fv.
//
for (PeimCount = Private->CurrentPeimCount;
(PeimCount < PcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);
(PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) && (Private->CurrentFvFileHandles[PeimCount] != NULL);
PeimCount++) {
Private->CurrentPeimCount = PeimCount;
PeimFileHandle = Private->CurrentFileHandle = Private->CurrentFvFileHandles[PeimCount];
@ -891,12 +891,12 @@ PeiDispatcher (
//
// Fixup the PeiCore's private data
//
PrivateInMem->PS = &PrivateInMem->ServiceTableShadow;
PrivateInMem->Ps = &PrivateInMem->ServiceTableShadow;
PrivateInMem->CpuIo = &PrivateInMem->ServiceTableShadow.CpuIo;
PrivateInMem->HobList.Raw = (VOID*) ((UINTN) PrivateInMem->HobList.Raw + HeapOffset);
PrivateInMem->StackBase = (EFI_PHYSICAL_ADDRESS)(((UINTN)PrivateInMem->PhysicalMemoryBegin + EFI_PAGE_MASK) & ~EFI_PAGE_MASK);
PeiServices = (CONST EFI_PEI_SERVICES **) &PrivateInMem->PS;
PeiServices = (CONST EFI_PEI_SERVICES **) &PrivateInMem->Ps;
//
// Fixup for PeiService's address
@ -1120,7 +1120,7 @@ DepexSatisfied (
//
// Evaluate a given DEPEX
//
return PeimDispatchReadiness (&Private->PS, DepexData);
return PeimDispatchReadiness (&Private->Ps, DepexData);
}
/**

View File

@ -368,8 +368,8 @@ FirmwareVolmeInfoPpiNotifyCallback (
Status = EFI_SUCCESS;
PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);
if (PrivateData->FvCount >= PcdGet32 (PcdPeiCoreMaxFvSupported)) {
DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, PcdGet32 (PcdPeiCoreMaxFvSupported)));
if (PrivateData->FvCount >= FixedPcdGet32 (PcdPeiCoreMaxFvSupported)) {
DEBUG ((EFI_D_ERROR, "The number of Fv Images (%d) exceed the max supported FVs (%d) in Pei", PrivateData->FvCount + 1, FixedPcdGet32 (PcdPeiCoreMaxFvSupported)));
DEBUG ((EFI_D_ERROR, "PcdPeiCoreMaxFvSupported value need be reconfigurated in DSC"));
ASSERT (FALSE);
}
@ -1156,7 +1156,7 @@ PeiFfs2FvPpiGetFileInfo (
return EFI_INVALID_PARAMETER;
}
if (CoreFvHandle->FvHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {
if ((CoreFvHandle->FvHeader->Attributes & EFI_FVB2_ERASE_POLARITY) != 0) {
ErasePolarity = 1;
} else {
ErasePolarity = 0;
@ -1417,7 +1417,7 @@ PeiReinitializeFv (
//
// Fixup all FvPpi pointers for the implementation in flash to permanent memory.
//
for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {
for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxFvSupported); Index ++) {
if (PrivateData->Fv[Index].FvPpi == OldFfs2FvPpi) {
PrivateData->Fv[Index].FvPpi = &mPeiFfs2FvPpi;
}
@ -1452,7 +1452,7 @@ AddUnknownFormatFvInfo (
{
PEI_CORE_UNKNOW_FORMAT_FV_INFO *NewUnknownFv;
if (PrivateData->UnknownFvInfoCount + 1 >= PcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
if (PrivateData->UnknownFvInfoCount + 1 >= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -52,9 +52,9 @@ InitializeMemoryServices (
);
//
// Set PS to point to ServiceTableShadow in Cache
// Set Ps to point to ServiceTableShadow in Cache
//
PrivateData->PS = &(PrivateData->ServiceTableShadow);
PrivateData->Ps = &(PrivateData->ServiceTableShadow);
}
return;

View File

@ -140,7 +140,7 @@ typedef struct{
///
/// Point to ServiceTableShadow
///
EFI_PEI_SERVICES *PS;
EFI_PEI_SERVICES *Ps;
PEI_PPI_DATABASE PpiData;
///
@ -180,7 +180,7 @@ typedef struct{
//
// For Loading modules at fixed address feature to cache the top address below which the
// Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
// and PS should not be changed since maybe user could get this top address by using the offet to PS.
// and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
//
EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress;
//
@ -195,7 +195,7 @@ typedef struct{
/// Pei Core Instance Data Macros
///
#define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
/**
Function Pointer type for PeiCore function.

View File

@ -148,12 +148,12 @@ PeiCore (
CopyMem (&PrivateData.ServiceTableShadow, &gPs, sizeof (gPs));
}
PrivateData.PS = &PrivateData.ServiceTableShadow;
PrivateData.Ps = &PrivateData.ServiceTableShadow;
//
// Initialize libraries that the PeiCore is linked against
//
ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.PS);
ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps);
InitializeMemoryServices (&PrivateData, SecCoreData, OldCoreData);
@ -162,7 +162,7 @@ PeiCore (
//
// Save PeiServicePointer so that it can be retrieved anywhere.
//
SetPeiServicesTablePointer((CONST EFI_PEI_SERVICES **) &PrivateData.PS);
SetPeiServicesTablePointer((CONST EFI_PEI_SERVICES **) &PrivateData.Ps);
if (OldCoreData != NULL) {
@ -205,7 +205,7 @@ PeiCore (
}
}
InitializeSecurityServices (&PrivateData.PS, OldCoreData);
InitializeSecurityServices (&PrivateData.Ps, OldCoreData);
InitializeDispatcherData (&PrivateData, OldCoreData, SecCoreData);
@ -244,7 +244,7 @@ PeiCore (
DEBUG ((EFI_D_INFO, "DXE IPL Entry\n"));
Status = TempPtr.DxeIpl->Entry (
TempPtr.DxeIpl,
&PrivateData.PS,
&PrivateData.Ps,
PrivateData.HobList
);
//

View File

@ -30,9 +30,9 @@ InitializePpiServices (
)
{
if (OldCoreData == NULL) {
PrivateData->PpiData.NotifyListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.DispatchListEnd = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.LastDispatchedNotify = PcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.NotifyListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.DispatchListEnd = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
PrivateData->PpiData.LastDispatchedNotify = FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1;
}
}
@ -60,7 +60,7 @@ ConvertPpiPointers (
UINT8 Index;
PEI_PPI_LIST_POINTERS *PpiPointer;
for (Index = 0; Index < PcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {
for (Index = 0; Index < FixedPcdGet32 (PcdPeiCoreMaxPpiSupported); Index++) {
if (Index < PrivateData->PpiData.PpiListEnd ||
Index > PrivateData->PpiData.NotifyListEnd) {
PpiPointer = &PrivateData->PpiData.PpiListPtrs[Index];
@ -254,7 +254,7 @@ PeiReInstallPpi (
// Remove the old PPI from the database, add the new one.
//
DEBUG((EFI_D_INFO, "Reinstall PPI: %g\n", NewPpi->Guid));
ASSERT (Index < (INTN)(PcdGet32 (PcdPeiCoreMaxPpiSupported)));
ASSERT (Index < (INTN)(FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)));
PrivateData->PpiData.PpiListPtrs[Index].Ppi = (EFI_PEI_PPI_DESCRIPTOR *) NewPpi;
//
@ -512,7 +512,7 @@ ProcessNotifyList (
EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH,
PrivateData->PpiData.LastDispatchedInstall,
PrivateData->PpiData.PpiListEnd,
PcdGet32 (PcdPeiCoreMaxPpiSupported)-1,
FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)-1,
PrivateData->PpiData.DispatchListEnd
);
PrivateData->PpiData.LastDispatchedInstall = TempValue;

View File

@ -1,7 +1,7 @@
/** @file
EFI PEI Core Security services
Copyright (c) 2006, Intel Corporation
Copyright (c) 2006 - 2010, 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
@ -113,7 +113,7 @@ VerifyPeim (
// Check to see if the image is OK
//
Status = PrivateData->PrivateSecurityPpi->AuthenticationState (
(CONST EFI_PEI_SERVICES **) &PrivateData->PS,
(CONST EFI_PEI_SERVICES **) &PrivateData->Ps,
PrivateData->PrivateSecurityPpi,
AuthenticationStatus,
VolumeHandle,