OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg 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: Andrew Fish <afish@apple.com>
This commit is contained in:
committed by
mergify[bot]
parent
d1050b9dff
commit
ac0a286f4d
@@ -24,17 +24,20 @@ GetQemuSmbiosTables (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
FIRMWARE_CONFIG_ITEM Tables;
|
||||
UINTN TablesSize;
|
||||
UINT8 *QemuTables;
|
||||
EFI_STATUS Status;
|
||||
FIRMWARE_CONFIG_ITEM Tables;
|
||||
UINTN TablesSize;
|
||||
UINT8 *QemuTables;
|
||||
|
||||
if (!PcdGetBool (PcdQemuSmbiosValidated)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Status = QemuFwCfgFindFile ("etc/smbios/smbios-tables", &Tables,
|
||||
&TablesSize);
|
||||
Status = QemuFwCfgFindFile (
|
||||
"etc/smbios/smbios-tables",
|
||||
&Tables,
|
||||
&TablesSize
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ASSERT (TablesSize > 0);
|
||||
|
||||
@@ -62,12 +65,12 @@ GetQemuSmbiosTables (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SmbiosTablePublishEntry (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT8 *SmbiosTables;
|
||||
EFI_STATUS Status;
|
||||
UINT8 *SmbiosTables;
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
//
|
||||
|
@@ -24,34 +24,34 @@
|
||||
//
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
SMBIOS_TABLE_TYPE0 Base;
|
||||
UINT8 Strings[sizeof(TYPE0_STRINGS)];
|
||||
SMBIOS_TABLE_TYPE0 Base;
|
||||
UINT8 Strings[sizeof (TYPE0_STRINGS)];
|
||||
} OVMF_TYPE0;
|
||||
#pragma pack()
|
||||
|
||||
STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
|
||||
STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
|
||||
{
|
||||
// SMBIOS_STRUCTURE Hdr
|
||||
{
|
||||
EFI_SMBIOS_TYPE_BIOS_INFORMATION, // UINT8 Type
|
||||
sizeof (SMBIOS_TABLE_TYPE0), // UINT8 Length
|
||||
},
|
||||
1, // SMBIOS_TABLE_STRING Vendor
|
||||
2, // SMBIOS_TABLE_STRING BiosVersion
|
||||
0xE800,// UINT16 BiosSegment
|
||||
3, // SMBIOS_TABLE_STRING BiosReleaseDate
|
||||
0, // UINT8 BiosSize
|
||||
1, // SMBIOS_TABLE_STRING Vendor
|
||||
2, // SMBIOS_TABLE_STRING BiosVersion
|
||||
0xE800, // UINT16 BiosSegment
|
||||
3, // SMBIOS_TABLE_STRING BiosReleaseDate
|
||||
0, // UINT8 BiosSize
|
||||
{ // MISC_BIOS_CHARACTERISTICS BiosCharacteristics
|
||||
0, // Reserved :2
|
||||
0, // Unknown :1
|
||||
1, // BiosCharacteristicsNotSupported :1
|
||||
// Remaining BiosCharacteristics bits left unset :60
|
||||
0, // Reserved :2
|
||||
0, // Unknown :1
|
||||
1, // BiosCharacteristicsNotSupported :1
|
||||
// Remaining BiosCharacteristics bits left unset :60
|
||||
},
|
||||
{ // BIOSCharacteristicsExtensionBytes[2]
|
||||
0, // BiosReserved
|
||||
0x1C // SystemReserved = VirtualMachineSupported |
|
||||
// UefiSpecificationSupported |
|
||||
// TargetContentDistributionEnabled
|
||||
0, // BiosReserved
|
||||
0x1C // SystemReserved = VirtualMachineSupported |
|
||||
// UefiSpecificationSupported |
|
||||
// TargetContentDistributionEnabled
|
||||
},
|
||||
0, // UINT8 SystemBiosMajorRelease
|
||||
0, // UINT8 SystemBiosMinorRelease
|
||||
@@ -62,7 +62,6 @@ STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
|
||||
TYPE0_STRINGS
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Get SMBIOS record length.
|
||||
|
||||
@@ -71,7 +70,7 @@ STATIC CONST OVMF_TYPE0 mOvmfDefaultType0 = {
|
||||
**/
|
||||
UINTN
|
||||
SmbiosTableLength (
|
||||
IN SMBIOS_STRUCTURE_POINTER SmbiosTable
|
||||
IN SMBIOS_STRUCTURE_POINTER SmbiosTable
|
||||
)
|
||||
{
|
||||
CHAR8 *AChar;
|
||||
@@ -83,14 +82,14 @@ SmbiosTableLength (
|
||||
// Each structure shall be terminated by a double-null (SMBIOS spec.7.1)
|
||||
//
|
||||
while ((*AChar != 0) || (*(AChar + 1) != 0)) {
|
||||
AChar ++;
|
||||
AChar++;
|
||||
}
|
||||
|
||||
Length = ((UINTN)AChar - (UINTN)SmbiosTable.Raw + 2);
|
||||
|
||||
return Length;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Install all structures from the given SMBIOS structures block
|
||||
|
||||
@@ -99,7 +98,7 @@ SmbiosTableLength (
|
||||
**/
|
||||
EFI_STATUS
|
||||
InstallAllStructures (
|
||||
IN UINT8 *TableAddress
|
||||
IN UINT8 *TableAddress
|
||||
)
|
||||
{
|
||||
EFI_SMBIOS_PROTOCOL *Smbios;
|
||||
@@ -114,7 +113,7 @@ InstallAllStructures (
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiSmbiosProtocolGuid,
|
||||
NULL,
|
||||
(VOID**)&Smbios
|
||||
(VOID **)&Smbios
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
@@ -132,12 +131,12 @@ InstallAllStructures (
|
||||
// Log the SMBIOS data for this structure
|
||||
//
|
||||
SmbiosHandle = SmbiosTable.Hdr->Handle;
|
||||
Status = Smbios->Add (
|
||||
Smbios,
|
||||
NULL,
|
||||
&SmbiosHandle,
|
||||
(EFI_SMBIOS_TABLE_HEADER*) SmbiosTable.Raw
|
||||
);
|
||||
Status = Smbios->Add (
|
||||
Smbios,
|
||||
NULL,
|
||||
&SmbiosHandle,
|
||||
(EFI_SMBIOS_TABLE_HEADER *)SmbiosTable.Raw
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
if (SmbiosTable.Hdr->Type == 0) {
|
||||
@@ -155,12 +154,12 @@ InstallAllStructures (
|
||||
// Add OVMF default Type 0 (BIOS Information) table
|
||||
//
|
||||
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
|
||||
Status = Smbios->Add (
|
||||
Smbios,
|
||||
NULL,
|
||||
&SmbiosHandle,
|
||||
(EFI_SMBIOS_TABLE_HEADER*) &mOvmfDefaultType0
|
||||
);
|
||||
Status = Smbios->Add (
|
||||
Smbios,
|
||||
NULL,
|
||||
&SmbiosHandle,
|
||||
(EFI_SMBIOS_TABLE_HEADER *)&mOvmfDefaultType0
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
**/
|
||||
EFI_STATUS
|
||||
InstallAllStructures (
|
||||
IN UINT8 *TableAddress
|
||||
IN UINT8 *TableAddress
|
||||
);
|
||||
|
||||
#endif
|
||||
|
@@ -14,8 +14,8 @@
|
||||
|
||||
#include "XenSmbiosPlatformDxe.h"
|
||||
|
||||
#define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000
|
||||
#define XEN_SMBIOS_PHYSICAL_END 0x000F0000
|
||||
#define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000
|
||||
#define XEN_SMBIOS_PHYSICAL_END 0x000F0000
|
||||
|
||||
/**
|
||||
Validates the SMBIOS entry point structure
|
||||
@@ -32,17 +32,17 @@ IsEntryPointStructureValid (
|
||||
IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
UINT8 Length;
|
||||
UINT8 Checksum;
|
||||
UINT8 *BytePtr;
|
||||
UINTN Index;
|
||||
UINT8 Length;
|
||||
UINT8 Checksum;
|
||||
UINT8 *BytePtr;
|
||||
|
||||
BytePtr = (UINT8*) EntryPointStructure;
|
||||
Length = EntryPointStructure->EntryPointLength;
|
||||
BytePtr = (UINT8 *)EntryPointStructure;
|
||||
Length = EntryPointStructure->EntryPointLength;
|
||||
Checksum = 0;
|
||||
|
||||
for (Index = 0; Index < Length; Index++) {
|
||||
Checksum = Checksum + (UINT8) BytePtr[Index];
|
||||
Checksum = Checksum + (UINT8)BytePtr[Index];
|
||||
}
|
||||
|
||||
if (Checksum != 0) {
|
||||
@@ -75,18 +75,17 @@ GetXenSmbiosTables (
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (XenSmbiosPtr = (UINT8*)(UINTN) XEN_SMBIOS_PHYSICAL_ADDRESS;
|
||||
XenSmbiosPtr < (UINT8*)(UINTN) XEN_SMBIOS_PHYSICAL_END;
|
||||
XenSmbiosPtr += 0x10) {
|
||||
|
||||
XenSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) XenSmbiosPtr;
|
||||
|
||||
if (!AsciiStrnCmp ((CHAR8 *) XenSmbiosEntryPointStructure->AnchorString, "_SM_", 4) &&
|
||||
!AsciiStrnCmp ((CHAR8 *) XenSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) &&
|
||||
IsEntryPointStructureValid (XenSmbiosEntryPointStructure)) {
|
||||
for (XenSmbiosPtr = (UINT8 *)(UINTN)XEN_SMBIOS_PHYSICAL_ADDRESS;
|
||||
XenSmbiosPtr < (UINT8 *)(UINTN)XEN_SMBIOS_PHYSICAL_END;
|
||||
XenSmbiosPtr += 0x10)
|
||||
{
|
||||
XenSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *)XenSmbiosPtr;
|
||||
|
||||
if (!AsciiStrnCmp ((CHAR8 *)XenSmbiosEntryPointStructure->AnchorString, "_SM_", 4) &&
|
||||
!AsciiStrnCmp ((CHAR8 *)XenSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) &&
|
||||
IsEntryPointStructureValid (XenSmbiosEntryPointStructure))
|
||||
{
|
||||
return XenSmbiosEntryPointStructure;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -25,8 +25,8 @@
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
XenSmbiosTablePublishEntry (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@@ -39,7 +39,7 @@ XenSmbiosTablePublishEntry (
|
||||
//
|
||||
EntryPointStructure = GetXenSmbiosTables ();
|
||||
if (EntryPointStructure != NULL) {
|
||||
SmbiosTables = (UINT8*)(UINTN)EntryPointStructure->TableAddress;
|
||||
SmbiosTables = (UINT8 *)(UINTN)EntryPointStructure->TableAddress;
|
||||
if (SmbiosTables != NULL) {
|
||||
Status = InstallAllStructures (SmbiosTables);
|
||||
}
|
||||
|
Reference in New Issue
Block a user