1) Change Framework version of PeiServiceTable's PciCfg from PEI_PCI_CFG_PPI to ECP_PEI_PCI_CFG_PPI. This help to detect if user is calling PeiServiceTable->PciCfg->Modify in a PI platform. Modify between Framework spec and PI spec is not compatible.

2) Add ECP_PEI_PCI_CFG_PPI to EdkFrameworkPpiLib
3) Add PeiLibPciCfgModify which call PciCfg2. This function will used by modified Framework Module which will be working with a PI platform.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5260 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-05-21 07:21:30 +00:00
parent bf6d2af434
commit 1e55f6a46b
6 changed files with 250 additions and 0 deletions

View File

@ -153,6 +153,99 @@ Returns:
}
EFI_STATUS
EFIAPI
PeiLibPciCfgModify (
IN EFI_PEI_SERVICES **PeiServices,
IN PEI_PCI_CFG_PPI_WIDTH Width,
IN UINT64 Address,
IN UINTN SetBits,
IN UINTN ClearBits
)
/*++
Routine Description:
PCI read-modify-write operations.
PIWG's PI specification replaces Inte's EFI Specification 1.10.
EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by
EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function in these two PPI are not
compatibile with each other.
For Framework code that make the following call:
PciCfg->Modify (
PeiServices,
PciCfg,
Width,
Address,
SetBits,
ClearBits
);
it will be updated to the following code which call this library API:
PeiLibPciCfgModify (
PeiServices,
Width,
Address,
SetBits,
ClearBits
);
The
Arguments:
PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
Width The width of the access. Enumerated in bytes. Type
EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
Address The physical address of the access.
SetBits Points to value to bitwise-OR with the read configuration value.
The size of the value is determined by Width.
ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
The size of the value is determined by Width.
Returns:
EFI_SUCCESS The function completed successfully.
EFI_DEVICE_ERROR There was a problem with the transaction.
--*/
{
EFI_STATUS Status;
EFI_PEI_PCI_CFG2_PPI *PciCfg2;
Status = (*PeiServices)->LocatePpi (
PeiServices,
&gPeiPciCfg2PpiGuid,
0,
NULL,
(VOID **) &PciCfg2
);
ASSERT_EFI_ERROR (Status);
Status = PciCfg2->Modify (
PeiServices,
PciCfg2,
Width,
Address,
&SetBits,
&ClearBits
);
return Status;
}
#if (PI_SPECIFICATION_VERSION >= 0x00010000)
VOID *