summaryrefslogtreecommitdiff
path: root/DuetPkg/PciRootBridgeNoEnumerationDxe
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-08 04:11:25 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-08 04:11:25 +0000
commit394bbc5930f78732f0bc5daf286beb3f8e39f27d (patch)
tree92889cc38410cb492cedf4df4a99143f35bbbf52 /DuetPkg/PciRootBridgeNoEnumerationDxe
parent61e334303b59d28e0baa1737a5e5751aad301e32 (diff)
downloadedk2-platforms-394bbc5930f78732f0bc5daf286beb3f8e39f27d.tar.xz
1) Fix some casting working in X64 building
2) Use SetMem/CopyMem function to do structure initialization to avoid X64 compiler call standard C library. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5180 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/PciRootBridgeNoEnumerationDxe')
-rw-r--r--DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c4
-rw-r--r--DuetPkg/PciRootBridgeNoEnumerationDxe/x64/PcatIo.c28
2 files changed, 16 insertions, 16 deletions
diff --git a/DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c b/DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c
index abb6acbd96..84abcf603a 100644
--- a/DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c
+++ b/DuetPkg/PciRootBridgeNoEnumerationDxe/PcatPciRootBridgeIo.c
@@ -270,7 +270,7 @@ PcatRootBridgeIoPollMem (
{
EFI_STATUS Status;
UINT64 NumberOfTicks;
- UINTN Remainder;
+ UINT32 Remainder;
if (Result == NULL) {
return EFI_INVALID_PARAMETER;
@@ -332,7 +332,7 @@ PcatRootBridgeIoPollIo (
{
EFI_STATUS Status;
UINT64 NumberOfTicks;
- UINTN Remainder;
+ UINT32 Remainder;
if (Result == NULL) {
return EFI_INVALID_PARAMETER;
diff --git a/DuetPkg/PciRootBridgeNoEnumerationDxe/x64/PcatIo.c b/DuetPkg/PciRootBridgeNoEnumerationDxe/x64/PcatIo.c
index 830dcbb8c7..0a786f823d 100644
--- a/DuetPkg/PciRootBridgeNoEnumerationDxe/x64/PcatIo.c
+++ b/DuetPkg/PciRootBridgeNoEnumerationDxe/x64/PcatIo.c
@@ -122,7 +122,7 @@ PcatRootBridgeIoPciRW (
UsePciExpressAccess = FALSE;
- EfiCopyMem (&PciAddress, &UserAddress, sizeof(UINT64));
+ CopyMem (&PciAddress, &UserAddress, sizeof(UINT64));
if (PciAddress.ExtendedRegister > 0xFF) {
//
@@ -136,9 +136,9 @@ PcatRootBridgeIoPciRW (
}
} else {
if (PciAddress.ExtendedRegister != 0) {
- Pci.Reg = PciAddress.ExtendedRegister & 0xFF;
+ Pci.Bits.Reg = PciAddress.ExtendedRegister & 0xFF;
} else {
- Pci.Reg = PciAddress.Register;
+ Pci.Bits.Reg = PciAddress.Register;
}
//
// Note: We can also use PciExpress access here, if wanted.
@@ -146,11 +146,11 @@ PcatRootBridgeIoPciRW (
}
if (!UsePciExpressAccess) {
- Pci.Func = PciAddress.Function;
- Pci.Dev = PciAddress.Device;
- Pci.Bus = PciAddress.Bus;
- Pci.Reserved = 0;
- Pci.Enable = 1;
+ Pci.Bits.Func = PciAddress.Function;
+ Pci.Bits.Dev = PciAddress.Device;
+ Pci.Bits.Bus = PciAddress.Bus;
+ Pci.Bits.Reserved = 0;
+ Pci.Bits.Enable = 1;
//
// PCI Config access are all 32-bit alligned, but by accessing the
@@ -160,11 +160,11 @@ PcatRootBridgeIoPciRW (
// To read a byte of PCI config space you load 0xcf8 and
// read 0xcfc, 0xcfd, 0xcfe, 0xcff
//
- PciDataStride = Pci.Reg & 0x03;
+ PciDataStride = Pci.Bits.Reg & 0x03;
while (Count) {
PciAligned = Pci;
- PciAligned.Reg &= 0xfc;
+ PciAligned.Bits.Reg &= 0xfc;
PciData = (UINTN)PrivateData->PciData + PciDataStride;
EfiAcquireLock(&PrivateData->PciLock);
This->Io.Write (This, EfiPciWidthUint32, PrivateData->PciAddress, 1, &PciAligned);
@@ -176,7 +176,7 @@ PcatRootBridgeIoPciRW (
EfiReleaseLock(&PrivateData->PciLock);
UserBuffer = ((UINT8 *)UserBuffer) + OutStride;
PciDataStride = (PciDataStride + InStride) % 4;
- Pci.Reg += InStride;
+ Pci.Bits.Reg += InStride;
Count -= 1;
}
} else {
@@ -425,7 +425,7 @@ CheckForRom (
LastImage = TRUE;
- EfiZeroMem (&EfiRomHeader, sizeof(EfiRomHeader));
+ ZeroMem (&EfiRomHeader, sizeof(EfiRomHeader));
IoDev->Mem.Read (
IoDev,
EfiPciWidthUint8,
@@ -438,7 +438,7 @@ CheckForRom (
if (EfiRomHeader.Signature == 0xaa55) {
- EfiZeroMem (&Pcir, sizeof(Pcir));
+ ZeroMem (&Pcir, sizeof(Pcir));
IoDev->Mem.Read (
IoDev,
EfiPciWidthUint8,
@@ -480,7 +480,7 @@ CheckForRom (
&TempPciOptionRomDescriptors
);
if (mPciOptionRomTable.PciOptionRomCount > 0) {
- EfiCopyMem(
+ CopyMem(
TempPciOptionRomDescriptors,
mPciOptionRomTable.PciOptionRomDescriptors,
(UINT32)mPciOptionRomTable.PciOptionRomCount * sizeof(EFI_PCI_OPTION_ROM_DESCRIPTOR)