summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:54:02 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commit1436aea4d5707e672672a11bda72be2c63c936c3 (patch)
tree370c9d5bd8823aa8ea7bce71a0f29bff71feff67 /MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei
parent7c7184e201a90a1d2376e615e55e3f4074731468 (diff)
downloadedk2-1436aea4d5707e672672a11bda72be2c63c936c3.zip
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.gz
edk2-1436aea4d5707e672672a11bda72be2c63c936c3.tar.bz2
MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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>
Diffstat (limited to 'MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei')
-rw-r--r--MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c123
1 files changed, 61 insertions, 62 deletions
diff --git a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
index 41fa929..7849070 100644
--- a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
+++ b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
@@ -27,7 +27,7 @@
**/
UINTN
PciCfgAddressConvert (
- EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address
+ EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address
)
{
if (Address->ExtendedRegister == 0) {
@@ -55,52 +55,52 @@ PciCfgAddressConvert (
EFI_STATUS
EFIAPI
PciCfg2Read (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_PCI_CFG2_PPI *This,
- IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN OUT VOID *Buffer
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_PCI_CFG2_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN OUT VOID *Buffer
)
{
UINTN PciLibAddress;
- PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);
+ PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *)&Address);
if (Width == EfiPeiPciCfgWidthUint8) {
- *((UINT8 *) Buffer) = PciRead8 (PciLibAddress);
+ *((UINT8 *)Buffer) = PciRead8 (PciLibAddress);
} else if (Width == EfiPeiPciCfgWidthUint16) {
if ((PciLibAddress & 0x01) == 0) {
//
// Aligned Pci address access
//
- WriteUnaligned16 (((UINT16 *) Buffer), PciRead16 (PciLibAddress));
+ WriteUnaligned16 (((UINT16 *)Buffer), PciRead16 (PciLibAddress));
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- *((UINT8 *) Buffer) = PciRead8 (PciLibAddress);
- *((UINT8 *) Buffer + 1) = PciRead8 (PciLibAddress + 1);
+ *((UINT8 *)Buffer) = PciRead8 (PciLibAddress);
+ *((UINT8 *)Buffer + 1) = PciRead8 (PciLibAddress + 1);
}
} else if (Width == EfiPeiPciCfgWidthUint32) {
if ((PciLibAddress & 0x03) == 0) {
//
// Aligned Pci address access
//
- WriteUnaligned32 (((UINT32 *) Buffer), PciRead32 (PciLibAddress));
+ WriteUnaligned32 (((UINT32 *)Buffer), PciRead32 (PciLibAddress));
} else if ((PciLibAddress & 0x01) == 0) {
//
// Unaligned Pci address access, break up the request into word by word.
//
- WriteUnaligned16 (((UINT16 *) Buffer), PciRead16 (PciLibAddress));
- WriteUnaligned16 (((UINT16 *) Buffer + 1), PciRead16 (PciLibAddress + 2));
+ WriteUnaligned16 (((UINT16 *)Buffer), PciRead16 (PciLibAddress));
+ WriteUnaligned16 (((UINT16 *)Buffer + 1), PciRead16 (PciLibAddress + 2));
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- *((UINT8 *) Buffer) = PciRead8 (PciLibAddress);
- *((UINT8 *) Buffer + 1) = PciRead8 (PciLibAddress + 1);
- *((UINT8 *) Buffer + 2) = PciRead8 (PciLibAddress + 2);
- *((UINT8 *) Buffer + 3) = PciRead8 (PciLibAddress + 3);
+ *((UINT8 *)Buffer) = PciRead8 (PciLibAddress);
+ *((UINT8 *)Buffer + 1) = PciRead8 (PciLibAddress + 1);
+ *((UINT8 *)Buffer + 2) = PciRead8 (PciLibAddress + 2);
+ *((UINT8 *)Buffer + 3) = PciRead8 (PciLibAddress + 3);
}
} else {
return EFI_INVALID_PARAMETER;
@@ -127,52 +127,52 @@ PciCfg2Read (
EFI_STATUS
EFIAPI
PciCfg2Write (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_PCI_CFG2_PPI *This,
- IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN OUT VOID *Buffer
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_PCI_CFG2_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN OUT VOID *Buffer
)
{
UINTN PciLibAddress;
- PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);
+ PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *)&Address);
if (Width == EfiPeiPciCfgWidthUint8) {
- PciWrite8 (PciLibAddress, *((UINT8 *) Buffer));
+ PciWrite8 (PciLibAddress, *((UINT8 *)Buffer));
} else if (Width == EfiPeiPciCfgWidthUint16) {
if ((PciLibAddress & 0x01) == 0) {
//
// Aligned Pci address access
//
- PciWrite16 (PciLibAddress, ReadUnaligned16 ((UINT16 *) Buffer));
+ PciWrite16 (PciLibAddress, ReadUnaligned16 ((UINT16 *)Buffer));
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- PciWrite8 (PciLibAddress, *((UINT8 *) Buffer));
- PciWrite8 (PciLibAddress + 1, *((UINT8 *) Buffer + 1));
+ PciWrite8 (PciLibAddress, *((UINT8 *)Buffer));
+ PciWrite8 (PciLibAddress + 1, *((UINT8 *)Buffer + 1));
}
} else if (Width == EfiPeiPciCfgWidthUint32) {
if ((PciLibAddress & 0x03) == 0) {
//
// Aligned Pci address access
//
- PciWrite32 (PciLibAddress, ReadUnaligned32 ((UINT32 *) Buffer));
+ PciWrite32 (PciLibAddress, ReadUnaligned32 ((UINT32 *)Buffer));
} else if ((PciLibAddress & 0x01) == 0) {
//
// Unaligned Pci address access, break up the request into word by word.
//
- PciWrite16 (PciLibAddress, ReadUnaligned16 ((UINT16 *) Buffer));
- PciWrite16 (PciLibAddress + 2, ReadUnaligned16 ((UINT16 *) Buffer + 1));
+ PciWrite16 (PciLibAddress, ReadUnaligned16 ((UINT16 *)Buffer));
+ PciWrite16 (PciLibAddress + 2, ReadUnaligned16 ((UINT16 *)Buffer + 1));
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- PciWrite8 (PciLibAddress, *((UINT8 *) Buffer));
- PciWrite8 (PciLibAddress + 1, *((UINT8 *) Buffer + 1));
- PciWrite8 (PciLibAddress + 2, *((UINT8 *) Buffer + 2));
- PciWrite8 (PciLibAddress + 3, *((UINT8 *) Buffer + 3));
+ PciWrite8 (PciLibAddress, *((UINT8 *)Buffer));
+ PciWrite8 (PciLibAddress + 1, *((UINT8 *)Buffer + 1));
+ PciWrite8 (PciLibAddress + 2, *((UINT8 *)Buffer + 2));
+ PciWrite8 (PciLibAddress + 3, *((UINT8 *)Buffer + 3));
}
} else {
return EFI_INVALID_PARAMETER;
@@ -181,7 +181,6 @@ PciCfg2Write (
return EFI_SUCCESS;
}
-
/**
This function performs a read-modify-write operation on the contents from a given
location in the PCI configuration space.
@@ -204,12 +203,12 @@ PciCfg2Write (
EFI_STATUS
EFIAPI
PciCfg2Modify (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CONST EFI_PEI_PCI_CFG2_PPI *This,
- IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN VOID *SetBits,
- IN VOID *ClearBits
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_PCI_CFG2_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN VOID *SetBits,
+ IN VOID *ClearBits
)
{
UINTN PciLibAddress;
@@ -218,52 +217,52 @@ PciCfg2Modify (
UINT32 ClearValue32;
UINT32 SetValue32;
- PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *) &Address);
+ PciLibAddress = PciCfgAddressConvert ((EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *)&Address);
if (Width == EfiPeiPciCfgWidthUint8) {
- PciAndThenOr8 (PciLibAddress, (UINT8) (~(*(UINT8 *) ClearBits)), *((UINT8 *) SetBits));
+ PciAndThenOr8 (PciLibAddress, (UINT8)(~(*(UINT8 *)ClearBits)), *((UINT8 *)SetBits));
} else if (Width == EfiPeiPciCfgWidthUint16) {
if ((PciLibAddress & 0x01) == 0) {
//
// Aligned Pci address access
//
- ClearValue16 = (UINT16) (~ReadUnaligned16 ((UINT16 *) ClearBits));
- SetValue16 = ReadUnaligned16 ((UINT16 *) SetBits);
+ ClearValue16 = (UINT16)(~ReadUnaligned16 ((UINT16 *)ClearBits));
+ SetValue16 = ReadUnaligned16 ((UINT16 *)SetBits);
PciAndThenOr16 (PciLibAddress, ClearValue16, SetValue16);
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- PciAndThenOr8 (PciLibAddress, (UINT8) (~(*(UINT8 *) ClearBits)), *((UINT8 *) SetBits));
- PciAndThenOr8 (PciLibAddress + 1, (UINT8) (~(*((UINT8 *) ClearBits + 1))), *((UINT8 *) SetBits + 1));
+ PciAndThenOr8 (PciLibAddress, (UINT8)(~(*(UINT8 *)ClearBits)), *((UINT8 *)SetBits));
+ PciAndThenOr8 (PciLibAddress + 1, (UINT8)(~(*((UINT8 *)ClearBits + 1))), *((UINT8 *)SetBits + 1));
}
} else if (Width == EfiPeiPciCfgWidthUint32) {
if ((PciLibAddress & 0x03) == 0) {
//
// Aligned Pci address access
//
- ClearValue32 = (UINT32) (~ReadUnaligned32 ((UINT32 *) ClearBits));
- SetValue32 = ReadUnaligned32 ((UINT32 *) SetBits);
+ ClearValue32 = (UINT32)(~ReadUnaligned32 ((UINT32 *)ClearBits));
+ SetValue32 = ReadUnaligned32 ((UINT32 *)SetBits);
PciAndThenOr32 (PciLibAddress, ClearValue32, SetValue32);
} else if ((PciLibAddress & 0x01) == 0) {
//
// Unaligned Pci address access, break up the request into word by word.
//
- ClearValue16 = (UINT16) (~ReadUnaligned16 ((UINT16 *) ClearBits));
- SetValue16 = ReadUnaligned16 ((UINT16 *) SetBits);
+ ClearValue16 = (UINT16)(~ReadUnaligned16 ((UINT16 *)ClearBits));
+ SetValue16 = ReadUnaligned16 ((UINT16 *)SetBits);
PciAndThenOr16 (PciLibAddress, ClearValue16, SetValue16);
- ClearValue16 = (UINT16) (~ReadUnaligned16 ((UINT16 *) ClearBits + 1));
- SetValue16 = ReadUnaligned16 ((UINT16 *) SetBits + 1);
+ ClearValue16 = (UINT16)(~ReadUnaligned16 ((UINT16 *)ClearBits + 1));
+ SetValue16 = ReadUnaligned16 ((UINT16 *)SetBits + 1);
PciAndThenOr16 (PciLibAddress + 2, ClearValue16, SetValue16);
} else {
//
// Unaligned Pci address access, break up the request into byte by byte.
//
- PciAndThenOr8 (PciLibAddress, (UINT8) (~(*(UINT8 *) ClearBits)), *((UINT8 *) SetBits));
- PciAndThenOr8 (PciLibAddress + 1, (UINT8) (~(*((UINT8 *) ClearBits + 1))), *((UINT8 *) SetBits + 1));
- PciAndThenOr8 (PciLibAddress + 2, (UINT8) (~(*((UINT8 *) ClearBits + 2))), *((UINT8 *) SetBits + 2));
- PciAndThenOr8 (PciLibAddress + 3, (UINT8) (~(*((UINT8 *) ClearBits + 3))), *((UINT8 *) SetBits + 3));
+ PciAndThenOr8 (PciLibAddress, (UINT8)(~(*(UINT8 *)ClearBits)), *((UINT8 *)SetBits));
+ PciAndThenOr8 (PciLibAddress + 1, (UINT8)(~(*((UINT8 *)ClearBits + 1))), *((UINT8 *)SetBits + 1));
+ PciAndThenOr8 (PciLibAddress + 2, (UINT8)(~(*((UINT8 *)ClearBits + 2))), *((UINT8 *)SetBits + 2));
+ PciAndThenOr8 (PciLibAddress + 3, (UINT8)(~(*((UINT8 *)ClearBits + 3))), *((UINT8 *)SetBits + 3));
}
} else {
return EFI_INVALID_PARAMETER;
@@ -272,14 +271,14 @@ PciCfg2Modify (
return EFI_SUCCESS;
}
-EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {
+EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {
PciCfg2Read,
PciCfg2Write,
PciCfg2Modify,
0
};
-EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
+EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPciCfg2PpiGuid,
&gPciCfg2Ppi
@@ -301,10 +300,10 @@ PeimInitializePciCfg (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
(**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi;
- Status = PeiServicesInstallPpi (&gPciCfg2PpiList);
+ Status = PeiServicesInstallPpi (&gPciCfg2PpiList);
ASSERT_EFI_ERROR (Status);
return Status;