MdePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
1436aea4d5
commit
2f88bd3a12
@@ -12,7 +12,6 @@
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/SmmServicesTableLib.h>
|
||||
|
||||
|
||||
/**
|
||||
Assert the validity of a PCI address. A valid PCI address should contain 1's
|
||||
only in the low 28 bits.
|
||||
@@ -21,7 +20,7 @@
|
||||
@param M Additional bits to assert to be zero.
|
||||
|
||||
**/
|
||||
#define ASSERT_INVALID_PCI_ADDRESS(A,M) \
|
||||
#define ASSERT_INVALID_PCI_ADDRESS(A, M) \
|
||||
ASSERT (((A) & (~0xfffffff | (M))) == 0)
|
||||
|
||||
/**
|
||||
@@ -37,7 +36,7 @@
|
||||
//
|
||||
// Global variable to cache pointer to PCI Root Bridge I/O protocol.
|
||||
//
|
||||
EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL;
|
||||
EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL;
|
||||
|
||||
/**
|
||||
The constructor function caches the pointer to PCI Root Bridge I/O protocol.
|
||||
@@ -54,13 +53,13 @@ EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL *mSmmPciRootBridgeIo = NULL;
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PciLibConstructor (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmPciRootBridgeIoProtocolGuid, NULL, (VOID**) &mSmmPciRootBridgeIo);
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmPciRootBridgeIoProtocolGuid, NULL, (VOID **)&mSmmPciRootBridgeIo);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ASSERT (mSmmPciRootBridgeIo != NULL);
|
||||
|
||||
@@ -90,12 +89,12 @@ SmmPciLibPciRootBridgeIoReadWorker (
|
||||
UINT32 Data;
|
||||
|
||||
mSmmPciRootBridgeIo->Pci.Read (
|
||||
mSmmPciRootBridgeIo,
|
||||
Width,
|
||||
PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
|
||||
1,
|
||||
&Data
|
||||
);
|
||||
mSmmPciRootBridgeIo,
|
||||
Width,
|
||||
PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
|
||||
1,
|
||||
&Data
|
||||
);
|
||||
|
||||
return Data;
|
||||
}
|
||||
@@ -124,12 +123,12 @@ SmmPciLibPciRootBridgeIoWriteWorker (
|
||||
)
|
||||
{
|
||||
mSmmPciRootBridgeIo->Pci.Write (
|
||||
mSmmPciRootBridgeIo,
|
||||
Width,
|
||||
PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
|
||||
1,
|
||||
&Data
|
||||
);
|
||||
mSmmPciRootBridgeIo,
|
||||
Width,
|
||||
PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS (Address),
|
||||
1,
|
||||
&Data
|
||||
);
|
||||
return Data;
|
||||
}
|
||||
|
||||
@@ -182,12 +181,12 @@ PciRegisterForRuntimeAccess (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciRead8 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 0);
|
||||
|
||||
return (UINT8) SmmPciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint8);
|
||||
return (UINT8)SmmPciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,13 +208,13 @@ PciRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 0);
|
||||
|
||||
return (UINT8) SmmPciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint8, Value);
|
||||
return (UINT8)SmmPciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint8, Value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,11 +240,11 @@ PciWrite8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (Address, (UINT8) (PciRead8 (Address) | OrData));
|
||||
return PciWrite8 (Address, (UINT8)(PciRead8 (Address) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,11 +270,11 @@ PciOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciAnd8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (Address, (UINT8) (PciRead8 (Address) & AndData));
|
||||
return PciWrite8 (Address, (UINT8)(PciRead8 (Address) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,12 +302,12 @@ PciAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciAndThenOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (Address, (UINT8) ((PciRead8 (Address) & AndData) | OrData));
|
||||
return PciWrite8 (Address, (UINT8)((PciRead8 (Address) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,9 +334,9 @@ PciAndThenOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciBitFieldRead8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead8 (PciRead8 (Address), StartBit, EndBit);
|
||||
@@ -370,10 +369,10 @@ PciBitFieldRead8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciBitFieldWrite8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 Value
|
||||
)
|
||||
{
|
||||
return PciWrite8 (
|
||||
@@ -412,10 +411,10 @@ PciBitFieldWrite8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciBitFieldOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (
|
||||
@@ -454,10 +453,10 @@ PciBitFieldOr8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciBitFieldAnd8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (
|
||||
@@ -500,11 +499,11 @@ PciBitFieldAnd8 (
|
||||
UINT8
|
||||
EFIAPI
|
||||
PciBitFieldAndThenOr8 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT8 AndData,
|
||||
IN UINT8 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite8 (
|
||||
@@ -532,12 +531,12 @@ PciBitFieldAndThenOr8 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciRead16 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 1);
|
||||
|
||||
return (UINT16) SmmPciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint16);
|
||||
return (UINT16)SmmPciLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint16);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -560,13 +559,13 @@ PciRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 1);
|
||||
|
||||
return (UINT16) SmmPciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint16, Value);
|
||||
return (UINT16)SmmPciLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint16, Value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -593,11 +592,11 @@ PciWrite16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (Address, (UINT16) (PciRead16 (Address) | OrData));
|
||||
return PciWrite16 (Address, (UINT16)(PciRead16 (Address) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -624,11 +623,11 @@ PciOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciAnd16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (Address, (UINT16) (PciRead16 (Address) & AndData));
|
||||
return PciWrite16 (Address, (UINT16)(PciRead16 (Address) & AndData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -657,12 +656,12 @@ PciAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciAndThenOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (Address, (UINT16) ((PciRead16 (Address) & AndData) | OrData));
|
||||
return PciWrite16 (Address, (UINT16)((PciRead16 (Address) & AndData) | OrData));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -690,9 +689,9 @@ PciAndThenOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciBitFieldRead16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead16 (PciRead16 (Address), StartBit, EndBit);
|
||||
@@ -726,10 +725,10 @@ PciBitFieldRead16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciBitFieldWrite16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 Value
|
||||
)
|
||||
{
|
||||
return PciWrite16 (
|
||||
@@ -769,10 +768,10 @@ PciBitFieldWrite16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciBitFieldOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (
|
||||
@@ -812,10 +811,10 @@ PciBitFieldOr16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciBitFieldAnd16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (
|
||||
@@ -859,11 +858,11 @@ PciBitFieldAnd16 (
|
||||
UINT16
|
||||
EFIAPI
|
||||
PciBitFieldAndThenOr16 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT16 AndData,
|
||||
IN UINT16 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite16 (
|
||||
@@ -891,7 +890,7 @@ PciBitFieldAndThenOr16 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciRead32 (
|
||||
IN UINTN Address
|
||||
IN UINTN Address
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 3);
|
||||
@@ -919,8 +918,8 @@ PciRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
ASSERT_INVALID_PCI_ADDRESS (Address, 3);
|
||||
@@ -952,8 +951,8 @@ PciWrite32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (Address, PciRead32 (Address) | OrData);
|
||||
@@ -983,8 +982,8 @@ PciOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciAnd32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (Address, PciRead32 (Address) & AndData);
|
||||
@@ -1016,9 +1015,9 @@ PciAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciAndThenOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (Address, (PciRead32 (Address) & AndData) | OrData);
|
||||
@@ -1049,9 +1048,9 @@ PciAndThenOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciBitFieldRead32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit
|
||||
)
|
||||
{
|
||||
return BitFieldRead32 (PciRead32 (Address), StartBit, EndBit);
|
||||
@@ -1085,10 +1084,10 @@ PciBitFieldRead32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciBitFieldWrite32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 Value
|
||||
)
|
||||
{
|
||||
return PciWrite32 (
|
||||
@@ -1128,10 +1127,10 @@ PciBitFieldWrite32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciBitFieldOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (
|
||||
@@ -1171,10 +1170,10 @@ PciBitFieldOr32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciBitFieldAnd32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (
|
||||
@@ -1218,11 +1217,11 @@ PciBitFieldAnd32 (
|
||||
UINT32
|
||||
EFIAPI
|
||||
PciBitFieldAndThenOr32 (
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
IN UINTN Address,
|
||||
IN UINTN StartBit,
|
||||
IN UINTN EndBit,
|
||||
IN UINT32 AndData,
|
||||
IN UINT32 OrData
|
||||
)
|
||||
{
|
||||
return PciWrite32 (
|
||||
@@ -1257,12 +1256,12 @@ PciBitFieldAndThenOr32 (
|
||||
UINTN
|
||||
EFIAPI
|
||||
PciReadBuffer (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Size,
|
||||
OUT VOID *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Size,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
UINTN ReturnValue;
|
||||
UINTN ReturnValue;
|
||||
|
||||
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
|
||||
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
|
||||
@@ -1283,19 +1282,19 @@ PciReadBuffer (
|
||||
// Read a byte if StartAddress is byte aligned
|
||||
//
|
||||
*(volatile UINT8 *)Buffer = PciRead8 (StartAddress);
|
||||
StartAddress += sizeof (UINT8);
|
||||
Size -= sizeof (UINT8);
|
||||
Buffer = (UINT8*)Buffer + 1;
|
||||
StartAddress += sizeof (UINT8);
|
||||
Size -= sizeof (UINT8);
|
||||
Buffer = (UINT8 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
|
||||
if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
|
||||
//
|
||||
// Read a word if StartAddress is word aligned
|
||||
//
|
||||
WriteUnaligned16 (Buffer, PciRead16 (StartAddress));
|
||||
StartAddress += sizeof (UINT16);
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16*)Buffer + 1;
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16 *)Buffer + 1;
|
||||
}
|
||||
|
||||
while (Size >= sizeof (UINT32)) {
|
||||
@@ -1304,8 +1303,8 @@ PciReadBuffer (
|
||||
//
|
||||
WriteUnaligned32 (Buffer, PciRead32 (StartAddress));
|
||||
StartAddress += sizeof (UINT32);
|
||||
Size -= sizeof (UINT32);
|
||||
Buffer = (UINT32*)Buffer + 1;
|
||||
Size -= sizeof (UINT32);
|
||||
Buffer = (UINT32 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT16)) {
|
||||
@@ -1314,8 +1313,8 @@ PciReadBuffer (
|
||||
//
|
||||
WriteUnaligned16 (Buffer, PciRead16 (StartAddress));
|
||||
StartAddress += sizeof (UINT16);
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16*)Buffer + 1;
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT8)) {
|
||||
@@ -1355,12 +1354,12 @@ PciReadBuffer (
|
||||
UINTN
|
||||
EFIAPI
|
||||
PciWriteBuffer (
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
IN UINTN StartAddress,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
UINTN ReturnValue;
|
||||
UINTN ReturnValue;
|
||||
|
||||
ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
|
||||
ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
|
||||
@@ -1380,20 +1379,20 @@ PciWriteBuffer (
|
||||
//
|
||||
// Write a byte if StartAddress is byte aligned
|
||||
//
|
||||
PciWrite8 (StartAddress, *(UINT8*)Buffer);
|
||||
PciWrite8 (StartAddress, *(UINT8 *)Buffer);
|
||||
StartAddress += sizeof (UINT8);
|
||||
Size -= sizeof (UINT8);
|
||||
Buffer = (UINT8*)Buffer + 1;
|
||||
Size -= sizeof (UINT8);
|
||||
Buffer = (UINT8 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT16) && (StartAddress & BIT1) != 0) {
|
||||
if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
|
||||
//
|
||||
// Write a word if StartAddress is word aligned
|
||||
//
|
||||
PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));
|
||||
StartAddress += sizeof (UINT16);
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16*)Buffer + 1;
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16 *)Buffer + 1;
|
||||
}
|
||||
|
||||
while (Size >= sizeof (UINT32)) {
|
||||
@@ -1402,8 +1401,8 @@ PciWriteBuffer (
|
||||
//
|
||||
PciWrite32 (StartAddress, ReadUnaligned32 (Buffer));
|
||||
StartAddress += sizeof (UINT32);
|
||||
Size -= sizeof (UINT32);
|
||||
Buffer = (UINT32*)Buffer + 1;
|
||||
Size -= sizeof (UINT32);
|
||||
Buffer = (UINT32 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT16)) {
|
||||
@@ -1412,15 +1411,15 @@ PciWriteBuffer (
|
||||
//
|
||||
PciWrite16 (StartAddress, ReadUnaligned16 (Buffer));
|
||||
StartAddress += sizeof (UINT16);
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16*)Buffer + 1;
|
||||
Size -= sizeof (UINT16);
|
||||
Buffer = (UINT16 *)Buffer + 1;
|
||||
}
|
||||
|
||||
if (Size >= sizeof (UINT8)) {
|
||||
//
|
||||
// Write the last remaining byte if exist
|
||||
//
|
||||
PciWrite8 (StartAddress, *(UINT8*)Buffer);
|
||||
PciWrite8 (StartAddress, *(UINT8 *)Buffer);
|
||||
}
|
||||
|
||||
return ReturnValue;
|
||||
|
Reference in New Issue
Block a user