From a536e5d6991ebb18cdc0a29e224ce5bd50ca9bc0 Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Tue, 3 Feb 2026 14:10:06 -0500 Subject: [PATCH] OvmfPkg: Replace include guards with #pragma once Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Note: Headers taken directly from external projects, such as those in OvmfPkg/Include/IndustryStandard/Xen/ were not modified since they may be periodically re-synced and do not follow other edk2 coding stadards. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 5 +---- OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h | 5 +---- OvmfPkg/Bhyve/AcpiTables/Platform.h | 4 +--- OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h | 5 +---- OvmfPkg/Bhyve/PlatformPei/Cmos.h | 5 +---- OvmfPkg/Bhyve/PlatformPei/Platform.h | 5 +---- OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 5 +---- OvmfPkg/CpuHotplugSmm/ApicId.h | 5 +---- OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h | 5 +---- OvmfPkg/CpuHotplugSmm/QemuCpuhp.h | 5 +---- OvmfPkg/CpuHotplugSmm/Smbase.h | 5 +---- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.h | 5 +---- OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h | 5 +---- OvmfPkg/Include/Guid/ConfidentialComputingSecret.h | 5 +---- OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h | 5 +---- OvmfPkg/Include/Guid/MicrosoftVendor.h | 5 +---- OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h | 5 +---- OvmfPkg/Include/Guid/OvmfPlatformConfig.h | 5 +---- OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h | 5 +---- OvmfPkg/Include/Guid/QemuRamfb.h | 5 +---- OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h | 5 +---- OvmfPkg/Include/Guid/VirtioMmioTransport.h | 5 +---- OvmfPkg/Include/Guid/XenBusRootDevice.h | 5 +---- OvmfPkg/Include/Guid/XenInfo.h | 5 +---- OvmfPkg/Include/IndustryStandard/Bhyve.h | 5 +---- OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 +---- OvmfPkg/Include/IndustryStandard/E820.h | 5 +---- OvmfPkg/Include/IndustryStandard/FusionMptScsi.h | 5 +---- OvmfPkg/Include/IndustryStandard/I440FxPiix4.h | 5 +---- OvmfPkg/Include/IndustryStandard/IgvmData.h | 5 +---- OvmfPkg/Include/IndustryStandard/InstructionParsing.h | 5 +---- OvmfPkg/Include/IndustryStandard/IntelTdx.h | 5 +---- OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h | 5 +---- OvmfPkg/Include/IndustryStandard/LinuxBzimage.h | 5 +---- OvmfPkg/Include/IndustryStandard/LsiScsi.h | 5 +---- OvmfPkg/Include/IndustryStandard/Microvm.h | 5 +---- OvmfPkg/Include/IndustryStandard/PageTable.h | 5 +---- OvmfPkg/Include/IndustryStandard/PvScsi.h | 5 +---- OvmfPkg/Include/IndustryStandard/Q35MchIch9.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuLoader.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuTpm.h | 5 +---- OvmfPkg/Include/IndustryStandard/QemuUefiVars.h | 5 +---- OvmfPkg/Include/IndustryStandard/Virtio.h | 5 +---- OvmfPkg/Include/IndustryStandard/Virtio095.h | 5 +---- OvmfPkg/Include/IndustryStandard/Virtio095Net.h | 5 +---- OvmfPkg/Include/IndustryStandard/Virtio10.h | 5 +---- OvmfPkg/Include/IndustryStandard/Virtio10Net.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioBlk.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioFs.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioGpu.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioNet.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioScsi.h | 5 +---- OvmfPkg/Include/IndustryStandard/VirtioSerial.h | 5 +---- OvmfPkg/Include/Library/AcpiPlatformLib.h | 5 +---- OvmfPkg/Include/Library/BhyveFwCtlLib.h | 5 +---- OvmfPkg/Include/Library/BlobVerifierLib.h | 5 +---- OvmfPkg/Include/Library/FdtSerialPortAddressLib.h | 5 +---- OvmfPkg/Include/Library/LoadLinuxLib.h | 5 +---- OvmfPkg/Include/Library/MemDebugLogLib.h | 5 +---- OvmfPkg/Include/Library/MemEncryptSevLib.h | 5 +---- OvmfPkg/Include/Library/MemEncryptTdxLib.h | 5 +---- OvmfPkg/Include/Library/NestedInterruptTplLib.h | 5 +---- OvmfPkg/Include/Library/NvVarsFileLib.h | 5 +---- OvmfPkg/Include/Library/PciCapLib.h | 5 +---- OvmfPkg/Include/Library/PciCapPciIoLib.h | 5 +---- OvmfPkg/Include/Library/PciCapPciSegmentLib.h | 5 +---- OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h | 5 +---- OvmfPkg/Include/Library/PeilessStartupLib.h | 5 +---- OvmfPkg/Include/Library/PlatformBmPrintScLib.h | 5 +---- OvmfPkg/Include/Library/PlatformBootManagerCommonLib.h | 5 +---- OvmfPkg/Include/Library/PlatformFvbLib.h | 5 +---- OvmfPkg/Include/Library/PlatformInitLib.h | 5 +---- OvmfPkg/Include/Library/QemuBootOrderLib.h | 5 +---- OvmfPkg/Include/Library/QemuFwCfgLib.h | 5 +---- OvmfPkg/Include/Library/QemuFwCfgS3Lib.h | 5 +---- OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h | 5 +---- OvmfPkg/Include/Library/QemuLoadImageLib.h | 5 +---- OvmfPkg/Include/Library/SerializeVariablesLib.h | 5 +---- OvmfPkg/Include/Library/TdxHelperLib.h | 5 +---- OvmfPkg/Include/Library/TdxMailboxLib.h | 5 +---- OvmfPkg/Include/Library/VirtNorFlashDeviceLib.h | 5 +---- OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h | 5 +---- OvmfPkg/Include/Library/VirtioLib.h | 5 +---- OvmfPkg/Include/Library/VirtioMmioDeviceLib.h | 5 +---- OvmfPkg/Include/Library/XenHypercallLib.h | 5 +---- OvmfPkg/Include/Library/XenIoMmioLib.h | 5 +---- OvmfPkg/Include/Library/XenPlatformLib.h | 5 +---- OvmfPkg/Include/OvmfPlatforms.h | 5 +---- OvmfPkg/Include/Pcd/CpuHotEjectData.h | 5 +---- OvmfPkg/Include/Ppi/MpInitLibDep.h | 5 +---- OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h | 5 +---- OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h | 5 +---- OvmfPkg/Include/Protocol/SevMemoryAcceptance.h | 5 +---- OvmfPkg/Include/Protocol/VirtioDevice.h | 5 +---- OvmfPkg/Include/Protocol/XenBus.h | 5 +---- OvmfPkg/Include/Protocol/XenIo.h | 5 +---- OvmfPkg/Include/WorkArea.h | 5 +---- OvmfPkg/IoMmuDxe/CcIoMmu.h | 5 +---- OvmfPkg/IoMmuDxe/IoMmuInternal.h | 5 +---- OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h | 5 +---- .../Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h | 5 +---- OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h | 5 +---- OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h | 5 +---- OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h | 5 +---- .../BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h | 5 +---- OvmfPkg/Library/CcExitLib/CcExitTd.h | 5 +---- OvmfPkg/Library/CcExitLib/CcExitVcHandler.h | 5 +---- OvmfPkg/Library/CcExitLib/CcInstruction.h | 5 +---- .../Library/HardwareInfoLib/HardwareInfoPciHostBridgeLib.h | 5 +---- OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h | 5 +---- OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h | 5 +---- OvmfPkg/Library/LockBoxLib/LockBoxLib.h | 5 +---- OvmfPkg/Library/NestedInterruptTplLib/Iret.h | 5 +---- OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.h | 5 +---- OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h | 5 +---- OvmfPkg/Library/PeilessStartupLib/X64/PageTables.h | 5 +---- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h | 5 +---- OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.h | 5 +---- OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.h | 5 +---- OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h | 5 +---- OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h | 5 +---- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h | 5 +---- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h | 5 +---- .../Library/SerializeVariablesLib/SerializeVariablesLib.h | 5 +---- OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h | 5 +---- OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h | 5 +---- OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h | 5 +---- OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.h | 5 +---- .../Library/LsRealTimeClockLib/LsRealTimeClock.h | 5 +---- .../Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h | 4 +--- OvmfPkg/LoongArchVirt/PlatformPei/Platform.h | 5 +---- OvmfPkg/LsiScsiDxe/LsiScsi.h | 5 +---- OvmfPkg/PlatformDxe/Platform.h | 5 +---- OvmfPkg/PlatformDxe/PlatformConfig.h | 5 +---- OvmfPkg/PlatformPei/Platform.h | 5 +---- OvmfPkg/PlatformPei/PlatformId.h | 5 +---- OvmfPkg/PvScsiDxe/PvScsi.h | 5 +---- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h | 5 +---- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h | 5 +---- .../Library/PlatformFlashAccessLib/PlatformFlashAccessLib.h | 5 +---- .../RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.h | 5 +---- OvmfPkg/RiscVVirt/Library/PlatformSecLib/PlatformSecLib.h | 5 +---- OvmfPkg/Sec/AmdSev.h | 5 +---- OvmfPkg/SioBusDxe/SioBusDxe.h | 5 +---- OvmfPkg/SioBusDxe/SioService.h | 5 +---- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 5 +---- OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h | 5 +---- OvmfPkg/SmmControl2Dxe/SmiFeatures.h | 5 +---- OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h | 5 +---- OvmfPkg/TdxDxe/TdxAcpiTable.h | 5 +---- OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.h | 5 +---- OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.h | 5 +---- OvmfPkg/Virtio10Dxe/Virtio10.h | 5 +---- OvmfPkg/VirtioBlkDxe/VirtioBlk.h | 5 +---- OvmfPkg/VirtioFsDxe/VirtioFsDxe.h | 5 +---- OvmfPkg/VirtioGpuDxe/VirtioGpu.h | 5 +---- OvmfPkg/VirtioKeyboardDxe/VirtioKeyCodes.h | 5 +---- OvmfPkg/VirtioKeyboardDxe/VirtioKeyboard.h | 5 +---- OvmfPkg/VirtioNetDxe/VirtioNet.h | 5 +---- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h | 5 +---- OvmfPkg/VirtioRngDxe/VirtioRng.h | 5 +---- OvmfPkg/VirtioScsiDxe/VirtioScsi.h | 5 +---- OvmfPkg/VirtioSerialDxe/VirtioSerial.h | 5 +---- OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h | 5 +---- OvmfPkg/XenBusDxe/EventChannel.h | 5 +---- OvmfPkg/XenBusDxe/GrantTable.h | 5 +---- OvmfPkg/XenBusDxe/XenBus.h | 5 +---- OvmfPkg/XenBusDxe/XenBusDxe.h | 5 +---- OvmfPkg/XenBusDxe/XenStore.h | 5 +---- OvmfPkg/XenPlatformPei/Cmos.h | 5 +---- OvmfPkg/XenPlatformPei/Platform.h | 5 +---- OvmfPkg/XenPlatformPei/Xen.h | 5 +---- OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.h | 5 +---- 176 files changed, 176 insertions(+), 702 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h index f4ae84b5a1..9aa871ebb7 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -6,8 +6,7 @@ **/ -#ifndef ACPI_PLATFORM_H_ -#define ACPI_PLATFORM_H_ +#pragma once #include // EFI_ACPI_TABLE_PROTOCOL @@ -28,5 +27,3 @@ EFIAPI InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); - -#endif diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h index b75292b735..82e3369a84 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.h @@ -7,8 +7,7 @@ **/ -#ifndef _ACPI_PLATFORM_H_INCLUDED_ -#define _ACPI_PLATFORM_H_INCLUDED_ +#pragma once #include #include @@ -52,5 +51,3 @@ EFIAPI InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); - -#endif /* _ACPI_PLATFORM_H_INCLUDED_ */ diff --git a/OvmfPkg/Bhyve/AcpiTables/Platform.h b/OvmfPkg/Bhyve/AcpiTables/Platform.h index 4561adc9f2..036960afb5 100644 --- a/OvmfPkg/Bhyve/AcpiTables/Platform.h +++ b/OvmfPkg/Bhyve/AcpiTables/Platform.h @@ -10,8 +10,7 @@ **/ -#ifndef _Platform_h_INCLUDED_ -#define _Platform_h_INCLUDED_ +#pragma once #include #include @@ -69,4 +68,3 @@ 0xCF9 /* I/O Port */ \ } #define FACP_RESET_VAL 0x6 -#endif diff --git a/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h b/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h index 128b4a5fd4..f2e1975486 100644 --- a/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h +++ b/OvmfPkg/Bhyve/BhyveRfbDxe/Gop.h @@ -8,8 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _GOP_H_ -#define _GOP_H_ +#pragma once #include #include @@ -144,5 +143,3 @@ InstallVbeShim ( IN CONST CHAR16 *CardName, IN EFI_PHYSICAL_ADDRESS FrameBufferBase ); - -#endif /* _GOP_H_ */ diff --git a/OvmfPkg/Bhyve/PlatformPei/Cmos.h b/OvmfPkg/Bhyve/PlatformPei/Cmos.h index e0ba81d4fa..dc2a98f86e 100644 --- a/OvmfPkg/Bhyve/PlatformPei/Cmos.h +++ b/OvmfPkg/Bhyve/PlatformPei/Cmos.h @@ -6,8 +6,7 @@ **/ -#ifndef _CMOS_H_ -#define _CMOS_H_ +#pragma once /** Reads 8-bits of CMOS data. @@ -44,5 +43,3 @@ CmosWrite8 ( IN UINTN Index, IN UINT8 Value ); - -#endif /* _CMOS_H_ */ diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.h b/OvmfPkg/Bhyve/PlatformPei/Platform.h index 17b63dfef3..ac4417f7c3 100644 --- a/OvmfPkg/Bhyve/PlatformPei/Platform.h +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.h @@ -7,8 +7,7 @@ **/ -#ifndef _PLATFORM_PEI_H_INCLUDED_ -#define _PLATFORM_PEI_H_INCLUDED_ +#pragma once #include @@ -133,5 +132,3 @@ extern UINT16 mHostBridgeDevId; extern BOOLEAN mQ35SmramAtDefaultSmbase; extern UINT32 mQemuUc32Base; - -#endif // _PLATFORM_PEI_H_INCLUDED_ diff --git a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h index 147370533d..10bea114be 100644 --- a/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/Bhyve/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -9,8 +9,7 @@ **/ -#ifndef _SMBIOS_PLATFORM_DXE_H_ -#define _SMBIOS_PLATFORM_DXE_H_ +#pragma once #include #include @@ -45,5 +44,3 @@ BOOLEAN IsEntryPointStructureValid ( IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure ); - -#endif /* _SMBIOS_PLATFORM_DXE_H_ */ diff --git a/OvmfPkg/CpuHotplugSmm/ApicId.h b/OvmfPkg/CpuHotplugSmm/ApicId.h index c0fa7f7978..4699b5aa74 100644 --- a/OvmfPkg/CpuHotplugSmm/ApicId.h +++ b/OvmfPkg/CpuHotplugSmm/ApicId.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef APIC_ID_H_ -#define APIC_ID_H_ +#pragma once // // The type that LocalApicLib represents an APIC ID with. @@ -19,5 +18,3 @@ typedef UINT32 APIC_ID; // The PrintLib conversion specification for formatting an APIC_ID. // #define FMT_APIC_ID "0x%08x" - -#endif // APIC_ID_H_ diff --git a/OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h b/OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h index 0c6deed4d8..aa6a4c94af 100644 --- a/OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h +++ b/OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h @@ -8,8 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef FIRST_SMI_HANDLER_CONTEXT_H_ -#define FIRST_SMI_HANDLER_CONTEXT_H_ +#pragma once // // The following structure is used to communicate between the SMM Monarch @@ -51,5 +50,3 @@ typedef struct { UINT8 AboutToLeaveSmm; } FIRST_SMI_HANDLER_CONTEXT; #pragma pack () - -#endif // FIRST_SMI_HANDLER_CONTEXT_H_ diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h index 1a4ae02398..31a1119696 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h @@ -12,8 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef QEMU_CPUHP_H_ -#define QEMU_CPUHP_H_ +#pragma once #include // EFI_MM_CPU_IO_PROTOCOL #include // EFI_STATUS @@ -64,5 +63,3 @@ QemuCpuhpCollectApicIds ( OUT UINT32 *ToUnplugSelectors, OUT UINT32 *ToUnplugCount ); - -#endif // QEMU_CPUHP_H_ diff --git a/OvmfPkg/CpuHotplugSmm/Smbase.h b/OvmfPkg/CpuHotplugSmm/Smbase.h index 31ce2c86de..b081a43cb0 100644 --- a/OvmfPkg/CpuHotplugSmm/Smbase.h +++ b/OvmfPkg/CpuHotplugSmm/Smbase.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef SMBASE_H_ -#define SMBASE_H_ +#pragma once #include // EFI_STATUS #include // EFI_BOOT_SERVICES @@ -42,5 +41,3 @@ SmbaseRelocate ( IN UINTN Smbase, IN UINT32 PenAddress ); - -#endif // SMBASE_H_ diff --git a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.h b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.h index 8299fe3f11..fb1d51b526 100644 --- a/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.h +++ b/OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.h @@ -13,8 +13,7 @@ Abstract: --*/ -#ifndef _FW_BLOCK_SERVICE_H -#define _FW_BLOCK_SERVICE_H +#pragma once // // Fvb Protocol instance data @@ -133,5 +132,3 @@ FvbProtocolEraseBlocks ( ... ) ; - -#endif diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h index 07800ce571..63e081fdc2 100644 --- a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h +++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef ENROLL_DEFAULT_KEYS_H_ -#define ENROLL_DEFAULT_KEYS_H_ +#pragma once #include @@ -144,5 +143,3 @@ extern CONST UINTN mSizeOfWindowsUefi2023; extern CONST UINT8 mSha256OfDevNull[]; extern CONST UINTN mSizeOfSha256OfDevNull; - -#endif /* ENROLL_DEFAULT_KEYS_H_ */ diff --git a/OvmfPkg/Include/Guid/ConfidentialComputingSecret.h b/OvmfPkg/Include/Guid/ConfidentialComputingSecret.h index b935573539..198f1eb4ba 100644 --- a/OvmfPkg/Include/Guid/ConfidentialComputingSecret.h +++ b/OvmfPkg/Include/Guid/ConfidentialComputingSecret.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef CONFIDENTIAL_COMPUTING_SECRET_H_ -#define CONFIDENTIAL_COMPUTING_SECRET_H_ +#pragma once #include @@ -24,5 +23,3 @@ typedef struct { } CONFIDENTIAL_COMPUTING_SECRET_LOCATION; extern EFI_GUID gConfidentialComputingSecretGuid; - -#endif // SEV_LAUNCH_SECRET_H_ diff --git a/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h b/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h index 83620e31b8..303c4b5bbe 100644 --- a/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h +++ b/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef CONFIDENTIAL_COMPUTING_SEV_SNP_BLOB_H_ -#define CONFIDENTIAL_COMPUTING_SEV_SNP_BLOB_H_ +#pragma once #include @@ -31,5 +30,3 @@ typedef PACKED struct { } CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION; extern EFI_GUID gConfidentialComputingSevSnpBlobGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/MicrosoftVendor.h b/OvmfPkg/Include/Guid/MicrosoftVendor.h index 0462f72588..32a6bf532e 100644 --- a/OvmfPkg/Include/Guid/MicrosoftVendor.h +++ b/OvmfPkg/Include/Guid/MicrosoftVendor.h @@ -16,8 +16,7 @@ . **/ -#ifndef MICROSOFT_VENDOR_H_ -#define MICROSOFT_VENDOR_H_ +#pragma once #include @@ -51,5 +50,3 @@ } extern EFI_GUID gMicrosoftVendorGuid; - -#endif /* MICROSOFT_VENDOR_H_ */ diff --git a/OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h b/OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h index b039a47454..311baa4467 100644 --- a/OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h +++ b/OvmfPkg/Include/Guid/OvmfPkKek1AppPrefix.h @@ -13,8 +13,7 @@ - https://bugzilla.tianocore.org/show_bug.cgi?id=1747 **/ -#ifndef OVMF_PK_KEK1_APP_PREFIX_H_ -#define OVMF_PK_KEK1_APP_PREFIX_H_ +#pragma once #include @@ -41,5 +40,3 @@ } extern EFI_GUID gOvmfPkKek1AppPrefixGuid; - -#endif /* OVMF_PK_KEK1_APP_PREFIX_H_ */ diff --git a/OvmfPkg/Include/Guid/OvmfPlatformConfig.h b/OvmfPkg/Include/Guid/OvmfPlatformConfig.h index 4bf0d8a089..ab798bf28e 100644 --- a/OvmfPkg/Include/Guid/OvmfPlatformConfig.h +++ b/OvmfPkg/Include/Guid/OvmfPlatformConfig.h @@ -7,12 +7,9 @@ **/ -#ifndef __OVMF_PLATFORM_CONFIG_H__ -#define __OVMF_PLATFORM_CONFIG_H__ +#pragma once #define OVMF_PLATFORM_CONFIG_GUID \ {0x7235c51c, 0x0c80, 0x4cab, {0x87, 0xac, 0x3b, 0x08, 0x4a, 0x63, 0x04, 0xb1}} extern EFI_GUID gOvmfPlatformConfigGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h b/OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h index fa64e4e3f5..4bd58d0c14 100644 --- a/OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h +++ b/OvmfPkg/Include/Guid/QemuKernelLoaderFsMedia.h @@ -7,12 +7,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef QEMU_KERNEL_LOADER_FS_MEDIA_GUID_H__ -#define QEMU_KERNEL_LOADER_FS_MEDIA_GUID_H__ +#pragma once #define QEMU_KERNEL_LOADER_FS_MEDIA_GUID \ {0x1428f772, 0xb64a, 0x441e, {0xb8, 0xc3, 0x9e, 0xbd, 0xd7, 0xf8, 0x93, 0xc7}} extern EFI_GUID gQemuKernelLoaderFsMediaGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/QemuRamfb.h b/OvmfPkg/Include/Guid/QemuRamfb.h index 74d59bb089..4d563478f8 100644 --- a/OvmfPkg/Include/Guid/QemuRamfb.h +++ b/OvmfPkg/Include/Guid/QemuRamfb.h @@ -8,12 +8,9 @@ **/ -#ifndef __QEMU_RAMFB_H__ -#define __QEMU_RAMFB_H__ +#pragma once #define QEMU_RAMFB_GUID \ {0x557423a1, 0x63ab, 0x406c, {0xbe, 0x7e, 0x91, 0xcd, 0xbc, 0x08, 0xc4, 0x57}} extern EFI_GUID gQemuRamfbGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h b/OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h index e4542d645f..abab897e70 100644 --- a/OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h +++ b/OvmfPkg/Include/Guid/RootBridgesConnectedEventGroup.h @@ -12,8 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _ROOT_BRIDGES_CONNECTED_EVENT_GROUP_H_ -#define _ROOT_BRIDGES_CONNECTED_EVENT_GROUP_H_ +#pragma once #define ROOT_BRIDGES_CONNECTED_EVENT_GROUP_GUID \ { 0x24a2d66f, \ @@ -23,5 +22,3 @@ } extern EFI_GUID gRootBridgesConnectedEventGroupGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/VirtioMmioTransport.h b/OvmfPkg/Include/Guid/VirtioMmioTransport.h index 280700d404..f8e8991b12 100644 --- a/OvmfPkg/Include/Guid/VirtioMmioTransport.h +++ b/OvmfPkg/Include/Guid/VirtioMmioTransport.h @@ -8,12 +8,9 @@ **/ -#ifndef __VIRTIO_MMIO_TRANSPORT_H__ -#define __VIRTIO_MMIO_TRANSPORT_H__ +#pragma once #define VIRTIO_MMIO_TRANSPORT_GUID \ {0x837dca9e, 0xe874, 0x4d82, {0xb2, 0x9a, 0x23, 0xfe, 0x0e, 0x23, 0xd1, 0xe2}} extern EFI_GUID gVirtioMmioTransportGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/XenBusRootDevice.h b/OvmfPkg/Include/Guid/XenBusRootDevice.h index e17de76fea..65dd7dab79 100644 --- a/OvmfPkg/Include/Guid/XenBusRootDevice.h +++ b/OvmfPkg/Include/Guid/XenBusRootDevice.h @@ -7,12 +7,9 @@ **/ -#ifndef __XENBUS_ROOT_DEVICE_H__ -#define __XENBUS_ROOT_DEVICE_H__ +#pragma once #define XENBUS_ROOT_DEVICE_GUID \ {0xa732241f, 0x383d, 0x4d9c, {0x8a, 0xe1, 0x8e, 0x09, 0x83, 0x75, 0x89, 0xd7}} extern EFI_GUID gXenBusRootDeviceGuid; - -#endif diff --git a/OvmfPkg/Include/Guid/XenInfo.h b/OvmfPkg/Include/Guid/XenInfo.h index c5de783c06..a32eab4261 100644 --- a/OvmfPkg/Include/Guid/XenInfo.h +++ b/OvmfPkg/Include/Guid/XenInfo.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __XEN_INFO_H__ -#define __XEN_INFO_H__ +#pragma once #define EFI_XEN_INFO_GUID \ { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } } @@ -28,5 +27,3 @@ typedef struct { } EFI_XEN_INFO; extern EFI_GUID gEfiXenInfoGuid; - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/Bhyve.h b/OvmfPkg/Include/IndustryStandard/Bhyve.h index c22d301d47..48ef5ae622 100644 --- a/OvmfPkg/Include/IndustryStandard/Bhyve.h +++ b/OvmfPkg/Include/IndustryStandard/Bhyve.h @@ -8,11 +8,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __BHYVE_H__ -#define __BHYVE_H__ +#pragma once #define BHYVE_ACPI_TIMER_IO_ADDR 0x408 #define BHYVE_PM_REG 0x404 - -#endif // __BHYVE_H__ diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/IndustryStandard/CloudHv.h index 527c236f48..246faf018b 100644 --- a/OvmfPkg/Include/IndustryStandard/CloudHv.h +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -5,8 +5,7 @@ **/ -#ifndef __CLOUDHV_H__ -#define __CLOUDHV_H__ +#pragma once // // Host Bridge Device ID @@ -37,5 +36,3 @@ // SMBIOS address // #define CLOUDHV_SMBIOS_ADDRESS 0xf0000 - -#endif // __CLOUDHV_H__ diff --git a/OvmfPkg/Include/IndustryStandard/E820.h b/OvmfPkg/Include/IndustryStandard/E820.h index e41be5af3c..b8f3575ac2 100644 --- a/OvmfPkg/Include/IndustryStandard/E820.h +++ b/OvmfPkg/Include/IndustryStandard/E820.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __E820_H__ -#define __E820_H__ +#pragma once #pragma pack(1) @@ -34,5 +33,3 @@ typedef struct { } EFI_E820_ENTRY; #pragma pack() - -#endif /* __E820_H__ */ diff --git a/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h b/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h index ad5dbaa414..d5db22f932 100644 --- a/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h +++ b/OvmfPkg/Include/IndustryStandard/FusionMptScsi.h @@ -8,8 +8,7 @@ **/ -#ifndef __FUSION_MPT_SCSI_H__ -#define __FUSION_MPT_SCSI_H__ +#pragma once // // Device offsets and constants @@ -156,5 +155,3 @@ typedef union { MPT_SCSI_REQUEST_WITH_SG Data; UINT64 Uint64; // 8 byte alignment required by HW } MPT_SCSI_REQUEST_ALIGNED; - -#endif // __FUSION_MPT_SCSI_H__ diff --git a/OvmfPkg/Include/IndustryStandard/I440FxPiix4.h b/OvmfPkg/Include/IndustryStandard/I440FxPiix4.h index b4c374c920..c5cea854d3 100644 --- a/OvmfPkg/Include/IndustryStandard/I440FxPiix4.h +++ b/OvmfPkg/Include/IndustryStandard/I440FxPiix4.h @@ -11,8 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __I440FX_PIIX4_H__ -#define __I440FX_PIIX4_H__ +#pragma once #include @@ -50,5 +49,3 @@ // IO ports // #define PIIX4_CPU_HOTPLUG_BASE 0xAF00 - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/IgvmData.h b/OvmfPkg/Include/IndustryStandard/IgvmData.h index 5816ac5b7f..2cbddb810c 100644 --- a/OvmfPkg/Include/IndustryStandard/IgvmData.h +++ b/OvmfPkg/Include/IndustryStandard/IgvmData.h @@ -6,8 +6,7 @@ **/ -#ifndef __IGVM_DATA_H__ -#define __IGVM_DATA_H__ +#pragma once /* secure boot databases */ #define EFI_IGVM_DATA_TYPE_PK 0x100 @@ -25,5 +24,3 @@ typedef struct { UINT32 DataType; UINT32 DataFlags; } EFI_IGVM_DATA_HOB; - -#endif /* __IGVM_DATA_H__ */ diff --git a/OvmfPkg/Include/IndustryStandard/InstructionParsing.h b/OvmfPkg/Include/IndustryStandard/InstructionParsing.h index e70557a933..cae364396d 100644 --- a/OvmfPkg/Include/IndustryStandard/InstructionParsing.h +++ b/OvmfPkg/Include/IndustryStandard/InstructionParsing.h @@ -6,8 +6,7 @@ **/ -#ifndef __INSTRUCTION_PARSING_H__ -#define __INSTRUCTION_PARSING_H__ +#pragma once #include #include @@ -79,5 +78,3 @@ typedef union { // Two-byte Opcode Flag // #define TWO_BYTE_OPCODE_ESCAPE 0x0F - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/IntelTdx.h b/OvmfPkg/Include/IndustryStandard/IntelTdx.h index e80688c459..e785478570 100644 --- a/OvmfPkg/Include/IndustryStandard/IntelTdx.h +++ b/OvmfPkg/Include/IndustryStandard/IntelTdx.h @@ -6,8 +6,7 @@ **/ -#ifndef OVMF_INTEL_TDX_H_ -#define OVMF_INTEL_TDX_H_ +#pragma once #include #include @@ -67,5 +66,3 @@ typedef struct { } MP_RELOCATION_MAP; #pragma pack() - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h b/OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h index 7568d585a9..63af14d5df 100644 --- a/OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h +++ b/OvmfPkg/Include/IndustryStandard/LegacyVgaBios.h @@ -11,8 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __LEGACY_VGA_BIOS_H__ -#define __LEGACY_VGA_BIOS_H__ +#pragma once #include @@ -125,5 +124,3 @@ typedef struct { UINT16 OffScreenSizeKB; } VBE2_MODE_INFO; #pragma pack () - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h b/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h index 08d0fcab44..a51f99037a 100644 --- a/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h +++ b/OvmfPkg/Include/IndustryStandard/LinuxBzimage.h @@ -5,8 +5,7 @@ **/ -#ifndef __LINUX_BZIMAGE_H__ -#define __LINUX_BZIMAGE_H__ +#pragma once #define BOOTSIG 0x1FE #define SETUP_HDR 0x53726448 /* 0x53726448 == "HdrS" */ @@ -157,5 +156,3 @@ extern EFI_STATUS setup_graphics ( struct boot_params *buf ); - -#endif /* __LINUX_BZIMAGE_H__ */ diff --git a/OvmfPkg/Include/IndustryStandard/LsiScsi.h b/OvmfPkg/Include/IndustryStandard/LsiScsi.h index affff53889..b05846a563 100644 --- a/OvmfPkg/Include/IndustryStandard/LsiScsi.h +++ b/OvmfPkg/Include/IndustryStandard/LsiScsi.h @@ -8,8 +8,7 @@ **/ -#ifndef _LSI_SCSI_H_ -#define _LSI_SCSI_H_ +#pragma once // // Device ID @@ -101,5 +100,3 @@ #define LSI_INS_TC_SCSIP_DAT_OUT 0x00000000 #define LSI_INS_TC_SCSIP_MSG_IN (BIT24 | BIT25 | BIT26) - -#endif // _LSI_SCSI_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Microvm.h b/OvmfPkg/Include/IndustryStandard/Microvm.h index 4f669766c4..604b230f6b 100644 --- a/OvmfPkg/Include/IndustryStandard/Microvm.h +++ b/OvmfPkg/Include/IndustryStandard/Microvm.h @@ -5,8 +5,7 @@ **/ -#ifndef __MICROVM_H__ -#define __MICROVM_H__ +#pragma once #define MICROVM_PSEUDO_DEVICE_ID 0xfff1 @@ -16,5 +15,3 @@ #define MICROVM_ACPI_GED_REG_SLEEP_CTL 0x00 #define MICROVM_ACPI_GED_REG_RESET 0x02 #define MICROVM_ACPI_GED_RESET_VALUE 0x42 - -#endif // __MICROVM_H__ diff --git a/OvmfPkg/Include/IndustryStandard/PageTable.h b/OvmfPkg/Include/IndustryStandard/PageTable.h index a75b3fcfe7..5783d4e67e 100644 --- a/OvmfPkg/Include/IndustryStandard/PageTable.h +++ b/OvmfPkg/Include/IndustryStandard/PageTable.h @@ -11,8 +11,7 @@ **/ -#ifndef PAGE_TABLE_H_ -#define PAGE_TABLE_H_ +#pragma once #include @@ -157,5 +156,3 @@ typedef union { #define PDE_OFFSET(x) ( (x >> 21) & PAGETABLE_ENTRY_MASK) #define PTE_OFFSET(x) ( (x >> 12) & PAGETABLE_ENTRY_MASK) #define PAGING_1G_ADDRESS_MASK_64 0x000FFFFFC0000000ull - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/PvScsi.h b/OvmfPkg/Include/IndustryStandard/PvScsi.h index 70ed91ddb3..5bd2779f4e 100644 --- a/OvmfPkg/Include/IndustryStandard/PvScsi.h +++ b/OvmfPkg/Include/IndustryStandard/PvScsi.h @@ -8,8 +8,7 @@ **/ -#ifndef __PVSCSI_H_ -#define __PVSCSI_H_ +#pragma once // // Device offsets and constants @@ -182,5 +181,3 @@ typedef struct { UINT32 Pad[2]; } PVSCSI_RING_CMP_DESC; #pragma pack () - -#endif // __PVSCSI_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Q35MchIch9.h b/OvmfPkg/Include/IndustryStandard/Q35MchIch9.h index db828d31b3..f8e2b4f651 100644 --- a/OvmfPkg/Include/IndustryStandard/Q35MchIch9.h +++ b/OvmfPkg/Include/IndustryStandard/Q35MchIch9.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __Q35_MCH_ICH9_H__ -#define __Q35_MCH_ICH9_H__ +#pragma once #include #include @@ -123,5 +122,3 @@ #define ICH9_SMI_EN_GBL_SMI_EN BIT0 #define ICH9_ROOT_COMPLEX_BASE 0xFED1C000 - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h b/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h index 1b7c6c8df3..e2b2e66ab3 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h +++ b/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h @@ -16,8 +16,7 @@ interface that OVMF needs. **/ -#ifndef QEMU_CPU_HOTPLUG_H_ -#define QEMU_CPU_HOTPLUG_H_ +#pragma once #include @@ -44,5 +43,3 @@ #define QEMU_CPUHP_W_CMD 0x5 #define QEMU_CPUHP_CMD_GET_PENDING 0x0 #define QEMU_CPUHP_CMD_GET_ARCH_ID 0x3 - -#endif // QEMU_CPU_HOTPLUG_H_ diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h index c2e7e2f920..d564dcf0da 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __FW_CFG_H__ -#define __FW_CFG_H__ +#pragma once #include @@ -92,5 +91,3 @@ typedef struct { UINT64 Address; } FW_CFG_DMA_ACCESS; #pragma pack () - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/QemuLoader.h b/OvmfPkg/Include/IndustryStandard/QemuLoader.h index cf953c448b..b8623dca37 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuLoader.h +++ b/OvmfPkg/Include/IndustryStandard/QemuLoader.h @@ -7,8 +7,7 @@ **/ -#ifndef QEMU_LOADER_H_ -#define QEMU_LOADER_H_ +#pragma once #include #include @@ -102,5 +101,3 @@ typedef struct { } Command; } QEMU_LOADER_ENTRY; #pragma pack () - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h b/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h index a70b99fccf..e6657c009c 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h +++ b/OvmfPkg/Include/IndustryStandard/QemuPciBridgeCapabilities.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __QEMU_PCI_BRIDGE_CAPABILITIES_H__ -#define __QEMU_PCI_BRIDGE_CAPABILITIES_H__ +#pragma once #include @@ -50,5 +49,3 @@ typedef struct { UINT64 Prefetchable64BitMmio; } QEMU_PCI_BRIDGE_CAPABILITY_RESOURCE_RESERVATION; #pragma pack () - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/QemuTpm.h b/OvmfPkg/Include/IndustryStandard/QemuTpm.h index 1a269e6ad8..1e9d3736bc 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuTpm.h +++ b/OvmfPkg/Include/IndustryStandard/QemuTpm.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __QEMU_TPM_H__ -#define __QEMU_TPM_H__ +#pragma once #include @@ -59,5 +58,3 @@ typedef struct { #define QEMU_TPM_PPI_VERSION_NONE 0 #define QEMU_TPM_PPI_VERSION_1_30 1 - -#endif diff --git a/OvmfPkg/Include/IndustryStandard/QemuUefiVars.h b/OvmfPkg/Include/IndustryStandard/QemuUefiVars.h index 484bf79380..092cc86e9f 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuUefiVars.h +++ b/OvmfPkg/Include/IndustryStandard/QemuUefiVars.h @@ -6,8 +6,7 @@ * copied from qemu.git (include/hw/uefi/var-service-api.h) */ -#ifndef QEMU_UEFI_VAR_SERVICE_API_H -#define QEMU_UEFI_VAR_SERVICE_API_H +#pragma once /* qom: device names */ #define TYPE_UEFI_VARS_X64 "uefi-vars-x64" @@ -46,5 +45,3 @@ #define UEFI_VARS_STS_ERR_UNKNOWN 0x10 #define UEFI_VARS_STS_ERR_NOT_SUPPORTED 0x11 #define UEFI_VARS_STS_ERR_BAD_BUFFER_SIZE 0x12 - -#endif /* QEMU_UEFI_VAR_SERVICE_API_H */ diff --git a/OvmfPkg/Include/IndustryStandard/Virtio.h b/OvmfPkg/Include/IndustryStandard/Virtio.h index ad6111f3aa..6920005cf8 100644 --- a/OvmfPkg/Include/IndustryStandard/Virtio.h +++ b/OvmfPkg/Include/IndustryStandard/Virtio.h @@ -10,9 +10,6 @@ **/ -#ifndef _VIRTIO_H_ -#define _VIRTIO_H_ +#pragma once #include - -#endif // _VIRTIO_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Virtio095.h b/OvmfPkg/Include/IndustryStandard/Virtio095.h index e06f87db79..ac8e482363 100644 --- a/OvmfPkg/Include/IndustryStandard/Virtio095.h +++ b/OvmfPkg/Include/IndustryStandard/Virtio095.h @@ -10,8 +10,7 @@ **/ -#ifndef _VIRTIO_0_9_5_H_ -#define _VIRTIO_0_9_5_H_ +#pragma once #include @@ -161,5 +160,3 @@ typedef struct { #define VIRTIO_F_NOTIFY_ON_EMPTY BIT24 #define VIRTIO_F_RING_INDIRECT_DESC BIT28 #define VIRTIO_F_RING_EVENT_IDX BIT29 - -#endif // _VIRTIO_0_9_5_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Virtio095Net.h b/OvmfPkg/Include/IndustryStandard/Virtio095Net.h index 372015a0f5..cb322a5ba0 100644 --- a/OvmfPkg/Include/IndustryStandard/Virtio095Net.h +++ b/OvmfPkg/Include/IndustryStandard/Virtio095Net.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_0_9_5_NET_H_ -#define _VIRTIO_0_9_5_NET_H_ +#pragma once #include @@ -87,5 +86,3 @@ typedef struct { // #define VIRTIO_NET_S_LINK_UP BIT0 #define VIRTIO_NET_S_ANNOUNCE BIT1 - -#endif // _VIRTIO_0_9_5_NET_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Virtio10.h b/OvmfPkg/Include/IndustryStandard/Virtio10.h index c92bd66ca5..abc6b8d36d 100644 --- a/OvmfPkg/Include/IndustryStandard/Virtio10.h +++ b/OvmfPkg/Include/IndustryStandard/Virtio10.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _VIRTIO_1_0_H_ -#define _VIRTIO_1_0_H_ +#pragma once #include #include @@ -93,5 +92,3 @@ typedef struct { #define VIRTIO_MMIO_OFFSET_QUEUE_USED_LO 0xa0 #define VIRTIO_MMIO_OFFSET_QUEUE_USED_HI 0xa4 #define VIRTIO_MMIO_OFFSET_CONFIG_GENERATION 0xfc - -#endif // _VIRTIO_1_0_H_ diff --git a/OvmfPkg/Include/IndustryStandard/Virtio10Net.h b/OvmfPkg/Include/IndustryStandard/Virtio10Net.h index 4efb916408..4ae20e46b7 100644 --- a/OvmfPkg/Include/IndustryStandard/Virtio10Net.h +++ b/OvmfPkg/Include/IndustryStandard/Virtio10Net.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _VIRTIO_1_0_NET_H_ -#define _VIRTIO_1_0_NET_H_ +#pragma once #include #include @@ -22,5 +21,3 @@ typedef struct { UINT16 NumBuffers; } VIRTIO_1_0_NET_REQ; #pragma pack () - -#endif // _VIRTIO_1_0_NET_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioBlk.h b/OvmfPkg/Include/IndustryStandard/VirtioBlk.h index 7a904975c3..b6329c67b4 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioBlk.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioBlk.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_BLK_H_ -#define _VIRTIO_BLK_H_ +#pragma once #include @@ -78,5 +77,3 @@ typedef struct { #define VIRTIO_BLK_S_OK 0x00 #define VIRTIO_BLK_S_IOERR 0x01 #define VIRTIO_BLK_S_UNSUPP 0x02 - -#endif // _VIRTIO_BLK_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioFs.h b/OvmfPkg/Include/IndustryStandard/VirtioFs.h index dbcb62f6ca..09f67356b4 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioFs.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioFs.h @@ -14,8 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef VIRTIO_FS_H_ -#define VIRTIO_FS_H_ +#pragma once #include @@ -450,5 +449,3 @@ typedef struct { UINT32 Padding; } VIRTIO_FS_FUSE_RENAME2_REQUEST; #pragma pack () - -#endif // VIRTIO_FS_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioGpu.h b/OvmfPkg/Include/IndustryStandard/VirtioGpu.h index 13f719d4c0..d0a39f7f72 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioGpu.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioGpu.h @@ -18,8 +18,7 @@ **/ -#ifndef _VIRTIO_GPU_H_ -#define _VIRTIO_GPU_H_ +#pragma once #include @@ -223,5 +222,3 @@ typedef struct { } Pmodes[VIRTIO_GPU_MAX_SCANOUTS]; } VIRTIO_GPU_RESP_DISPLAY_INFO; #pragma pack () - -#endif // _VIRTIO_GPU_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioNet.h b/OvmfPkg/Include/IndustryStandard/VirtioNet.h index c9315a029c..0a8948271d 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioNet.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioNet.h @@ -8,9 +8,6 @@ **/ -#ifndef _VIRTIO_NET_H_ -#define _VIRTIO_NET_H_ +#pragma once #include - -#endif // _VIRTIO_NET_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioScsi.h b/OvmfPkg/Include/IndustryStandard/VirtioScsi.h index 2a097bd0ec..9c9d18d4f7 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioScsi.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioScsi.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_SCSI_H_ -#define _VIRTIO_SCSI_H_ +#pragma once #include @@ -88,5 +87,3 @@ typedef struct { #define VIRTIO_SCSI_S_TARGET_FAILURE 7 #define VIRTIO_SCSI_S_NEXUS_FAILURE 8 #define VIRTIO_SCSI_S_FAILURE 9 - -#endif // _VIRTIO_SCSI_H_ diff --git a/OvmfPkg/Include/IndustryStandard/VirtioSerial.h b/OvmfPkg/Include/IndustryStandard/VirtioSerial.h index ffc8f84d03..9531f8b189 100644 --- a/OvmfPkg/Include/IndustryStandard/VirtioSerial.h +++ b/OvmfPkg/Include/IndustryStandard/VirtioSerial.h @@ -7,8 +7,7 @@ **/ -#ifndef _VIRTIO_SERIAL_H_ -#define _VIRTIO_SERIAL_H_ +#pragma once #include #include @@ -60,5 +59,3 @@ typedef struct { #define VIRTIO_SERIAL_RESIZE 5 #define VIRTIO_SERIAL_PORT_OPEN 6 #define VIRTIO_SERIAL_PORT_NAME 7 - -#endif /* _VIRTIO_SERIAL_H_ */ diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Library/AcpiPlatformLib.h index 277be93a50..5fe4657b6a 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -4,8 +4,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef ACPI_PLATFORM_LIB_H_ -#define ACPI_PLATFORM_LIB_H_ +#pragma once #include #include @@ -101,5 +100,3 @@ EFI_STATUS TransferS3ContextToBootScript ( IN S3_CONTEXT *S3Context ); - -#endif diff --git a/OvmfPkg/Include/Library/BhyveFwCtlLib.h b/OvmfPkg/Include/Library/BhyveFwCtlLib.h index 07fbd60476..125de5eb07 100644 --- a/OvmfPkg/Include/Library/BhyveFwCtlLib.h +++ b/OvmfPkg/Include/Library/BhyveFwCtlLib.h @@ -8,8 +8,7 @@ **/ -#ifndef _BHYVE_FW_CTL_LIB_ -#define _BHYVE_FW_CTL_LIB_ +#pragma once /** Sysctl-like interface to read host information via a dot-separated @@ -43,5 +42,3 @@ BhyveFwCtlGet ( OUT VOID *Item, IN OUT UINTN *Size ); - -#endif /* _BHYVE_FW_CTL_LIB_ */ diff --git a/OvmfPkg/Include/Library/BlobVerifierLib.h b/OvmfPkg/Include/Library/BlobVerifierLib.h index 09af1b77de..9d70e0ed36 100644 --- a/OvmfPkg/Include/Library/BlobVerifierLib.h +++ b/OvmfPkg/Include/Library/BlobVerifierLib.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef BLOB_VERIFIER_LIB_H_ -#define BLOB_VERIFIER_LIB_H_ +#pragma once #include #include @@ -37,5 +36,3 @@ VerifyBlob ( IN UINT32 BufSize, IN EFI_STATUS FetchStatus ); - -#endif diff --git a/OvmfPkg/Include/Library/FdtSerialPortAddressLib.h b/OvmfPkg/Include/Library/FdtSerialPortAddressLib.h index 3d4c911f58..d1c625c6c9 100644 --- a/OvmfPkg/Include/Library/FdtSerialPortAddressLib.h +++ b/OvmfPkg/Include/Library/FdtSerialPortAddressLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef FDT_SERIAL_PORT_ADDRESS_LIB_H_ -#define FDT_SERIAL_PORT_ADDRESS_LIB_H_ +#pragma once #include @@ -79,5 +78,3 @@ FdtSerialGetConsolePort ( IN CONST VOID *DeviceTree, OUT UINT64 *BaseAddress ); - -#endif diff --git a/OvmfPkg/Include/Library/LoadLinuxLib.h b/OvmfPkg/Include/Library/LoadLinuxLib.h index 65f5895bfc..a0cafbbca6 100644 --- a/OvmfPkg/Include/Library/LoadLinuxLib.h +++ b/OvmfPkg/Include/Library/LoadLinuxLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __LOAD_LINUX_LIB__ -#define __LOAD_LINUX_LIB__ +#pragma once /** Verifies that the kernel setup image is valid and supported. @@ -190,5 +189,3 @@ LoadLinuxSetInitrd ( IN VOID *Initrd, IN UINTN InitrdSize ); - -#endif diff --git a/OvmfPkg/Include/Library/MemDebugLogLib.h b/OvmfPkg/Include/Library/MemDebugLogLib.h index 6dde585574..0d2c61e746 100644 --- a/OvmfPkg/Include/Library/MemDebugLogLib.h +++ b/OvmfPkg/Include/Library/MemDebugLogLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _MEM_DEBUG_LOG_LIB_H_ -#define _MEM_DEBUG_LOG_LIB_H_ +#pragma once #include #include @@ -210,5 +209,3 @@ EFIAPI MemDebugLogEnabled ( VOID ); - -#endif // _MEM_DEBUG_LOG_LIB_H_ diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h index d3d4f6fa9a..70ab2ffb2b 100644 --- a/OvmfPkg/Include/Library/MemEncryptSevLib.h +++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h @@ -8,8 +8,7 @@ **/ -#ifndef _MEM_ENCRYPT_SEV_LIB_H_ -#define _MEM_ENCRYPT_SEV_LIB_H_ +#pragma once #include #include @@ -253,5 +252,3 @@ MemEncryptSevSnpPreValidateSystemRam ( IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages ); - -#endif // _MEM_ENCRYPT_SEV_LIB_H_ diff --git a/OvmfPkg/Include/Library/MemEncryptTdxLib.h b/OvmfPkg/Include/Library/MemEncryptTdxLib.h index 2350dd47bc..3c1d470674 100644 --- a/OvmfPkg/Include/Library/MemEncryptTdxLib.h +++ b/OvmfPkg/Include/Library/MemEncryptTdxLib.h @@ -9,8 +9,7 @@ **/ -#ifndef MEM_ENCRYPT_TDX_LIB_H_ -#define MEM_ENCRYPT_TDX_LIB_H_ +#pragma once #include @@ -77,5 +76,3 @@ MemEncryptTdxClearPageSharedBit ( IN PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages ); - -#endif // _MEM_ENCRYPT_TDX_LIB_H_ diff --git a/OvmfPkg/Include/Library/NestedInterruptTplLib.h b/OvmfPkg/Include/Library/NestedInterruptTplLib.h index 0ead6e4b34..3a314efe12 100644 --- a/OvmfPkg/Include/Library/NestedInterruptTplLib.h +++ b/OvmfPkg/Include/Library/NestedInterruptTplLib.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __NESTED_INTERRUPT_TPL_LIB__ -#define __NESTED_INTERRUPT_TPL_LIB__ +#pragma once #include #include @@ -83,5 +82,3 @@ NestedInterruptRestoreTPL ( IN OUT EFI_SYSTEM_CONTEXT SystemContext, IN OUT NESTED_INTERRUPT_STATE *IsrState ); - -#endif // __NESTED_INTERRUPT_TPL_LIB__ diff --git a/OvmfPkg/Include/Library/NvVarsFileLib.h b/OvmfPkg/Include/Library/NvVarsFileLib.h index c2fb5c6846..69292f04f6 100644 --- a/OvmfPkg/Include/Library/NvVarsFileLib.h +++ b/OvmfPkg/Include/Library/NvVarsFileLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __NV_VARS_FILE_LIB__ -#define __NV_VARS_FILE_LIB__ +#pragma once /** Attempts to connect the NvVarsFileLib to the specified file system. @@ -38,5 +37,3 @@ EFI_STATUS EFIAPI UpdateNvVarsOnFileSystem ( ); - -#endif diff --git a/OvmfPkg/Include/Library/PciCapLib.h b/OvmfPkg/Include/Library/PciCapLib.h index 4badb0a914..694e2d6574 100644 --- a/OvmfPkg/Include/Library/PciCapLib.h +++ b/OvmfPkg/Include/Library/PciCapLib.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PCI_CAP_LIB_H__ -#define __PCI_CAP_LIB_H__ +#pragma once #include @@ -412,5 +411,3 @@ PciCapWrite ( IN VOID *SourceBuffer, IN UINT16 Size ); - -#endif // __PCI_CAP_LIB_H__ diff --git a/OvmfPkg/Include/Library/PciCapPciIoLib.h b/OvmfPkg/Include/Library/PciCapPciIoLib.h index 1109096379..8470dd38e7 100644 --- a/OvmfPkg/Include/Library/PciCapPciIoLib.h +++ b/OvmfPkg/Include/Library/PciCapPciIoLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PCI_CAP_PCI_IO_LIB_H__ -#define __PCI_CAP_PCI_IO_LIB_H__ +#pragma once #include @@ -46,5 +45,3 @@ EFIAPI PciCapPciIoDeviceUninit ( IN PCI_CAP_DEV *PciDevice ); - -#endif // __PCI_CAP_PCI_IO_LIB_H__ diff --git a/OvmfPkg/Include/Library/PciCapPciSegmentLib.h b/OvmfPkg/Include/Library/PciCapPciSegmentLib.h index 7bcfb57652..16d611b658 100644 --- a/OvmfPkg/Include/Library/PciCapPciSegmentLib.h +++ b/OvmfPkg/Include/Library/PciCapPciSegmentLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PCI_CAP_PCI_SEGMENT_LIB_H__ -#define __PCI_CAP_PCI_SEGMENT_LIB_H__ +#pragma once #include @@ -70,5 +69,3 @@ EFIAPI PciCapPciSegmentDeviceUninit ( IN PCI_CAP_DEV *PciDevice ); - -#endif // __PCI_CAP_PCI_SEGMENT_LIB_H__ diff --git a/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h b/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h index 28516e4c1e..0786fb000d 100644 --- a/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h +++ b/OvmfPkg/Include/Library/PciHostBridgeUtilityLib.h @@ -10,8 +10,7 @@ **/ -#ifndef __PCI_HOST_BRIDGE_UTILITY_LIB_H__ -#define __PCI_HOST_BRIDGE_UTILITY_LIB_H__ +#pragma once #include @@ -174,5 +173,3 @@ EFIAPI PciHostBridgeUtilityResourceConflict ( IN VOID *Configuration ); - -#endif // __PCI_HOST_BRIDGE_UTILITY_LIB_H__ diff --git a/OvmfPkg/Include/Library/PeilessStartupLib.h b/OvmfPkg/Include/Library/PeilessStartupLib.h index 8c9e3cb05a..ab4e4f9d36 100644 --- a/OvmfPkg/Include/Library/PeilessStartupLib.h +++ b/OvmfPkg/Include/Library/PeilessStartupLib.h @@ -6,8 +6,7 @@ **/ -#ifndef PEILESS_STARTUP_LIB_H_ -#define PEILESS_STARTUP_LIB_H_ +#pragma once #include #include @@ -30,5 +29,3 @@ EFIAPI PeilessStartup ( IN VOID *Context ); - -#endif diff --git a/OvmfPkg/Include/Library/PlatformBmPrintScLib.h b/OvmfPkg/Include/Library/PlatformBmPrintScLib.h index 11d2481017..f41775330b 100644 --- a/OvmfPkg/Include/Library/PlatformBmPrintScLib.h +++ b/OvmfPkg/Include/Library/PlatformBmPrintScLib.h @@ -11,8 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PLATFORM_BM_PRINT_SC_LIB__ -#define __PLATFORM_BM_PRINT_SC_LIB__ +#pragma once #include @@ -31,5 +30,3 @@ EFIAPI PlatformBmPrintScRegisterHandler ( VOID ); - -#endif // __PLATFORM_BM_PRINT_SC_LIB__ diff --git a/OvmfPkg/Include/Library/PlatformBootManagerCommonLib.h b/OvmfPkg/Include/Library/PlatformBootManagerCommonLib.h index 724f8ff37f..0f4662e123 100644 --- a/OvmfPkg/Include/Library/PlatformBootManagerCommonLib.h +++ b/OvmfPkg/Include/Library/PlatformBootManagerCommonLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __PLATFORMBOOTMANAGERCOMMON_LIB_H__ -#define __PLATFORMBOOTMANAGERCOMMON_LIB_H__ +#pragma once #include #include @@ -24,5 +23,3 @@ VOID RemoveStaleFvFileOptions ( VOID ); - -#endif diff --git a/OvmfPkg/Include/Library/PlatformFvbLib.h b/OvmfPkg/Include/Library/PlatformFvbLib.h index 9acbdc2aa7..43ea49c6ca 100644 --- a/OvmfPkg/Include/Library/PlatformFvbLib.h +++ b/OvmfPkg/Include/Library/PlatformFvbLib.h @@ -7,8 +7,7 @@ **/ -#ifndef __PLATFORM_FVB_LIB__ -#define __PLATFORM_FVB_LIB__ +#pragma once #include @@ -73,5 +72,3 @@ PlatformFvbBlocksErased ( IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This, IN VA_LIST List ); - -#endif diff --git a/OvmfPkg/Include/Library/PlatformInitLib.h b/OvmfPkg/Include/Library/PlatformInitLib.h index 884e381928..8b7ab4c30d 100644 --- a/OvmfPkg/Include/Library/PlatformInitLib.h +++ b/OvmfPkg/Include/Library/PlatformInitLib.h @@ -6,8 +6,7 @@ **/ -#ifndef PLATFORM_INIT_LIB_H_ -#define PLATFORM_INIT_LIB_H_ +#pragma once #include #include @@ -326,5 +325,3 @@ EFIAPI PlatformIgvmParamReserve ( VOID ); - -#endif // PLATFORM_INIT_LIB_H_ diff --git a/OvmfPkg/Include/Library/QemuBootOrderLib.h b/OvmfPkg/Include/Library/QemuBootOrderLib.h index f0369298a1..bb934021d7 100644 --- a/OvmfPkg/Include/Library/QemuBootOrderLib.h +++ b/OvmfPkg/Include/Library/QemuBootOrderLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __QEMU_BOOT_ORDER_LIB_H__ -#define __QEMU_BOOT_ORDER_LIB_H__ +#pragma once #include #include @@ -106,5 +105,3 @@ EFIAPI GetFrontPageTimeoutFromQemu ( VOID ); - -#endif diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h index 73f4503263..97472bb17c 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h @@ -8,8 +8,7 @@ **/ -#ifndef __FW_CFG_LIB__ -#define __FW_CFG_LIB__ +#pragma once #include #include @@ -183,5 +182,3 @@ EFIAPI QemuFwCfgInitCache ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ); - -#endif diff --git a/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h b/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h index b6b1e30da3..572a0038c2 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgS3Lib.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __FW_CFG_S3_LIB__ -#define __FW_CFG_S3_LIB__ +#pragma once #include @@ -345,5 +344,3 @@ QemuFwCfgS3ScriptCheckValue ( IN UINT64 ValueMask, IN UINT64 Value ); - -#endif diff --git a/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h b/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h index bcbf3bc4fc..6275dd0ed6 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgSimpleParserLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef QEMU_FW_CFG_SIMPLE_PARSER_LIB_H_ -#define QEMU_FW_CFG_SIMPLE_PARSER_LIB_H_ +#pragma once #include @@ -124,5 +123,3 @@ QemuFwCfgParseUintn ( IN BOOLEAN ParseAsHex, OUT UINTN *Value ); - -#endif // QEMU_FW_CFG_SIMPLE_PARSER_LIB_H_ diff --git a/OvmfPkg/Include/Library/QemuLoadImageLib.h b/OvmfPkg/Include/Library/QemuLoadImageLib.h index f344b763a4..dde0af90bd 100644 --- a/OvmfPkg/Include/Library/QemuLoadImageLib.h +++ b/OvmfPkg/Include/Library/QemuLoadImageLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef QEMU_LOAD_IMAGE_LIB_H__ -#define QEMU_LOAD_IMAGE_LIB_H__ +#pragma once #include #include @@ -80,5 +79,3 @@ EFIAPI QemuUnloadKernelImage ( IN EFI_HANDLE ImageHandle ); - -#endif diff --git a/OvmfPkg/Include/Library/SerializeVariablesLib.h b/OvmfPkg/Include/Library/SerializeVariablesLib.h index 5ca395786c..752e190142 100644 --- a/OvmfPkg/Include/Library/SerializeVariablesLib.h +++ b/OvmfPkg/Include/Library/SerializeVariablesLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __SERIALIZE_VARIABLES_LIB__ -#define __SERIALIZE_VARIABLES_LIB__ +#pragma once /** Callback function for each variable @@ -208,5 +207,3 @@ SerializeVariablesToBuffer ( OUT VOID *Buffer, IN OUT UINTN *Size ); - -#endif diff --git a/OvmfPkg/Include/Library/TdxHelperLib.h b/OvmfPkg/Include/Library/TdxHelperLib.h index 199aade42f..9126c6977a 100644 --- a/OvmfPkg/Include/Library/TdxHelperLib.h +++ b/OvmfPkg/Include/Library/TdxHelperLib.h @@ -6,8 +6,7 @@ **/ -#ifndef TDX_HELPER_LIB_H -#define TDX_HELPER_LIB_H +#pragma once #include @@ -66,5 +65,3 @@ EFIAPI TdxHelperBuildGuidHobForTdxMeasurement ( VOID ); - -#endif diff --git a/OvmfPkg/Include/Library/TdxMailboxLib.h b/OvmfPkg/Include/Library/TdxMailboxLib.h index 166cab43bc..3715818378 100644 --- a/OvmfPkg/Include/Library/TdxMailboxLib.h +++ b/OvmfPkg/Include/Library/TdxMailboxLib.h @@ -6,8 +6,7 @@ **/ -#ifndef TDX_MAILBOX_LIB_H_ -#define TDX_MAILBOX_LIB_H_ +#pragma once #include #include @@ -72,5 +71,3 @@ EFIAPI MpSerializeEnd ( VOID ); - -#endif diff --git a/OvmfPkg/Include/Library/VirtNorFlashDeviceLib.h b/OvmfPkg/Include/Library/VirtNorFlashDeviceLib.h index d6a6816fd9..9c7ae1af3d 100644 --- a/OvmfPkg/Include/Library/VirtNorFlashDeviceLib.h +++ b/OvmfPkg/Include/Library/VirtNorFlashDeviceLib.h @@ -7,8 +7,7 @@ **/ -#ifndef VIRT_NOR_FLASH_DEVICE_LIB_H -#define VIRT_NOR_FLASH_DEVICE_LIB_H +#pragma once // Each command must be sent simultaneously to both chips, // i.e. at the lower 16 bits AND at the higher 16 bits @@ -122,5 +121,3 @@ EFIAPI NorFlashReset ( IN UINTN DeviceBaseAddress ); - -#endif /* VIRT_NOR_FLASH_DEVICE_LIB_H */ diff --git a/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h b/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h index 8f5b5e972d..0fb847e392 100644 --- a/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h +++ b/OvmfPkg/Include/Library/VirtNorFlashPlatformLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __VIRT_NOR_FLASH_PLATFORM_LIB__ -#define __VIRT_NOR_FLASH_PLATFORM_LIB__ +#pragma once typedef struct { UINTN DeviceBaseAddress; // Start address of the Device Base Address (DBA) @@ -26,5 +25,3 @@ VirtNorFlashPlatformGetDevices ( OUT VIRT_NOR_FLASH_DESCRIPTION **NorFlashDescriptions, OUT UINT32 *Count ); - -#endif /* __VIRT_NOR_FLASH_PLATFORM_LIB__ */ diff --git a/OvmfPkg/Include/Library/VirtioLib.h b/OvmfPkg/Include/Library/VirtioLib.h index 085e719b08..bbb012e3cf 100644 --- a/OvmfPkg/Include/Library/VirtioLib.h +++ b/OvmfPkg/Include/Library/VirtioLib.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_LIB_H_ -#define _VIRTIO_LIB_H_ +#pragma once #include @@ -306,5 +305,3 @@ VirtioMapAllBytesInSharedBuffer ( OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping ); - -#endif // _VIRTIO_LIB_H_ diff --git a/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h b/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h index 41df774161..5d5e680105 100644 --- a/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h +++ b/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_MMIO_DEVICE_LIB_H_ -#define _VIRTIO_MMIO_DEVICE_LIB_H_ +#pragma once /** @@ -56,5 +55,3 @@ EFI_STATUS VirtioMmioUninstallDevice ( IN EFI_HANDLE Handle ); - -#endif // _VIRTIO_MMIO_DEVICE_LIB_H_ diff --git a/OvmfPkg/Include/Library/XenHypercallLib.h b/OvmfPkg/Include/Library/XenHypercallLib.h index d7cf2c0c50..fb21f611cc 100644 --- a/OvmfPkg/Include/Library/XenHypercallLib.h +++ b/OvmfPkg/Include/Library/XenHypercallLib.h @@ -7,8 +7,7 @@ **/ -#ifndef __XEN_HYPERCALL_LIB_H__ -#define __XEN_HYPERCALL_LIB_H__ +#pragma once /** To call when the gEfiXenInfoGuid HOB became available after the library init @@ -107,5 +106,3 @@ XenHypercallSchedOp ( IN INTN Operation, IN OUT VOID *Arguments ); - -#endif diff --git a/OvmfPkg/Include/Library/XenIoMmioLib.h b/OvmfPkg/Include/Library/XenIoMmioLib.h index 072fdbf821..8aeebce008 100644 --- a/OvmfPkg/Include/Library/XenIoMmioLib.h +++ b/OvmfPkg/Include/Library/XenIoMmioLib.h @@ -7,8 +7,7 @@ * **/ -#ifndef _XENIO_MMIO_DEVICE_LIB_H_ -#define _XENIO_MMIO_DEVICE_LIB_H_ +#pragma once /** @@ -53,5 +52,3 @@ EFI_STATUS XenIoMmioUninstall ( IN EFI_HANDLE Handle ); - -#endif diff --git a/OvmfPkg/Include/Library/XenPlatformLib.h b/OvmfPkg/Include/Library/XenPlatformLib.h index 8b8c0d057f..fdf47373ae 100644 --- a/OvmfPkg/Include/Library/XenPlatformLib.h +++ b/OvmfPkg/Include/Library/XenPlatformLib.h @@ -10,8 +10,7 @@ **/ -#ifndef _XEN_PLATFORM_LIB_H_ -#define _XEN_PLATFORM_LIB_H_ +#pragma once #include @@ -49,5 +48,3 @@ EFIAPI XenGetInfoHOB ( VOID ); - -#endif diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatforms.h index f613dd7e2d..bd67d3010a 100644 --- a/OvmfPkg/Include/OvmfPlatforms.h +++ b/OvmfPkg/Include/OvmfPlatforms.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __OVMF_PLATFORMS_H__ -#define __OVMF_PLATFORMS_H__ +#pragma once #include #include @@ -39,5 +38,3 @@ // Common IO ports relative to the Power Management Base Address // #define ACPI_TIMER_OFFSET 0x8 - -#endif diff --git a/OvmfPkg/Include/Pcd/CpuHotEjectData.h b/OvmfPkg/Include/Pcd/CpuHotEjectData.h index 3f955269c4..60406be750 100644 --- a/OvmfPkg/Include/Pcd/CpuHotEjectData.h +++ b/OvmfPkg/Include/Pcd/CpuHotEjectData.h @@ -14,8 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef CPU_HOT_EJECT_DATA_H_ -#define CPU_HOT_EJECT_DATA_H_ +#pragma once /** CPU Hot-eject handler, called from SmmCpuFeaturesRendezvousExit() @@ -56,5 +55,3 @@ typedef struct { // UINT32 ArrayLength; } CPU_HOT_EJECT_DATA; - -#endif // CPU_HOT_EJECT_DATA_H_ diff --git a/OvmfPkg/Include/Ppi/MpInitLibDep.h b/OvmfPkg/Include/Ppi/MpInitLibDep.h index 232ff52e19..651fd2693e 100644 --- a/OvmfPkg/Include/Ppi/MpInitLibDep.h +++ b/OvmfPkg/Include/Ppi/MpInitLibDep.h @@ -6,8 +6,7 @@ **/ -#ifndef MPINITLIB_DEP_H_ -#define MPINITLIB_DEP_H_ +#pragma once // {138F9CF4-F0E7-4721-8F49-F5FFECF42D40} #define EFI_PEI_MPINITLIB_MP_DEP_PPI_GUID \ @@ -24,5 +23,3 @@ extern EFI_GUID gEfiPeiMpInitLibMpDepPpiGuid; }; extern EFI_GUID gEfiPeiMpInitLibUpDepPpiGuid; - -#endif diff --git a/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h b/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h index 449c8fedb3..5a73b3e881 100644 --- a/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h +++ b/OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h @@ -6,8 +6,7 @@ **/ -#ifndef MPINITLIB_DEP_PROTOCOLS_H_ -#define MPINITLIB_DEP_PROTOCOLS_H_ +#pragma once // {BB00A5CA-08CE-462F-A537-43C74A825CA4} #define EFI_MPINITLIB_MP_DEP_PROTOCOL_GUID \ @@ -24,5 +23,3 @@ extern EFI_GUID gEfiMpInitLibMpDepProtocolGuid; }; extern EFI_GUID gEfiMpInitLibUpDepProtocolGuid; - -#endif diff --git a/OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h b/OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h index 9adb75cc5a..91710e8cf2 100644 --- a/OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h +++ b/OvmfPkg/Include/Protocol/OvmfLoadedX86LinuxKernel.h @@ -10,8 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef OVMF_LOADED_X86_LINUX_KERNEL_H__ -#define OVMF_LOADED_X86_LINUX_KERNEL_H__ +#pragma once #define OVMF_LOADED_X86_LINUX_KERNEL_PROTOCOL_GUID \ {0xa3edc05d, 0xb618, 0x4ff6, {0x95, 0x52, 0x76, 0xd7, 0x88, 0x63, 0x43, 0xc8}} @@ -28,5 +27,3 @@ typedef struct { } OVMF_LOADED_X86_LINUX_KERNEL; extern EFI_GUID gOvmfLoadedX86LinuxKernelProtocolGuid; - -#endif diff --git a/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h b/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h index c5ea3f383a..9c85dcdf57 100644 --- a/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h +++ b/OvmfPkg/Include/Protocol/SevMemoryAcceptance.h @@ -11,8 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef SEV_MEMORY_ACCEPTANCE_H_ -#define SEV_MEMORY_ACCEPTANCE_H_ +#pragma once #define OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL_GUID \ {0xc5a010fe, \ @@ -39,5 +38,3 @@ typedef struct _OVMF_SEV_MEMORY_ACCEPTANCE_PROTOCOL { OVMF_SEV_ALLOW_UNACCEPTED_MEMORY AllowUnacceptedMemory; }; - -#endif diff --git a/OvmfPkg/Include/Protocol/VirtioDevice.h b/OvmfPkg/Include/Protocol/VirtioDevice.h index ad37f4e3f7..c2f9251dc3 100644 --- a/OvmfPkg/Include/Protocol/VirtioDevice.h +++ b/OvmfPkg/Include/Protocol/VirtioDevice.h @@ -11,8 +11,7 @@ **/ -#ifndef __VIRTIO_DEVICE_H__ -#define __VIRTIO_DEVICE_H__ +#pragma once #include @@ -516,5 +515,3 @@ struct _VIRTIO_DEVICE_PROTOCOL { }; extern EFI_GUID gVirtioDeviceProtocolGuid; - -#endif diff --git a/OvmfPkg/Include/Protocol/XenBus.h b/OvmfPkg/Include/Protocol/XenBus.h index e34347fc3f..912ea180c4 100644 --- a/OvmfPkg/Include/Protocol/XenBus.h +++ b/OvmfPkg/Include/Protocol/XenBus.h @@ -14,8 +14,7 @@ **/ -#ifndef __PROTOCOL_XENBUS_H__ -#define __PROTOCOL_XENBUS_H__ +#pragma once #define XENBUS_PROTOCOL_GUID \ {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}} @@ -402,5 +401,3 @@ struct _XENBUS_PROTOCOL { }; extern EFI_GUID gXenBusProtocolGuid; - -#endif diff --git a/OvmfPkg/Include/Protocol/XenIo.h b/OvmfPkg/Include/Protocol/XenIo.h index ed1cc37ef1..fb30807df4 100644 --- a/OvmfPkg/Include/Protocol/XenIo.h +++ b/OvmfPkg/Include/Protocol/XenIo.h @@ -14,8 +14,7 @@ **/ -#ifndef __PROTOCOL_XENIO_H__ -#define __PROTOCOL_XENIO_H__ +#pragma once #include @@ -38,5 +37,3 @@ struct _XENIO_PROTOCOL { }; extern EFI_GUID gXenIoProtocolGuid; - -#endif diff --git a/OvmfPkg/Include/WorkArea.h b/OvmfPkg/Include/WorkArea.h index 297e54f36e..97b8cc000a 100644 --- a/OvmfPkg/Include/WorkArea.h +++ b/OvmfPkg/Include/WorkArea.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __OVMF_WORK_AREA_H__ -#define __OVMF_WORK_AREA_H__ +#pragma once #include #include @@ -121,5 +120,3 @@ typedef union { SEV_WORK_AREA SevWorkArea; TDX_WORK_AREA TdxWorkArea; } OVMF_WORK_AREA; - -#endif diff --git a/OvmfPkg/IoMmuDxe/CcIoMmu.h b/OvmfPkg/IoMmuDxe/CcIoMmu.h index 8fdfa99685..227cb1f77e 100644 --- a/OvmfPkg/IoMmuDxe/CcIoMmu.h +++ b/OvmfPkg/IoMmuDxe/CcIoMmu.h @@ -12,8 +12,7 @@ **/ -#ifndef _AMD_SEV_IOMMU_H_ -#define _AMD_SEV_IOMMU_H_ +#pragma once #include @@ -34,5 +33,3 @@ EFIAPI InstallIoMmuProtocol ( VOID ); - -#endif diff --git a/OvmfPkg/IoMmuDxe/IoMmuInternal.h b/OvmfPkg/IoMmuDxe/IoMmuInternal.h index 936c35aa53..edcaeecdd9 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuInternal.h +++ b/OvmfPkg/IoMmuDxe/IoMmuInternal.h @@ -6,8 +6,7 @@ **/ -#ifndef IOMMU_INTERNAL_H_ -#define IOMMU_INTERNAL_H_ +#pragma once #include #include @@ -175,5 +174,3 @@ IoMmuFreeCommonBuffer ( IN COMMON_BUFFER_HEADER *CommonBufferHeader, IN UINTN CommonBufferPages ); - -#endif diff --git a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h index 0ac9902844..ac6c5946fd 100644 --- a/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h +++ b/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _ACPI_TIMER_LIB_INTERNAL_H_ -#define _ACPI_TIMER_LIB_INTERNAL_H_ +#pragma once /** Internal function to read the current tick counter of ACPI. @@ -19,5 +18,3 @@ UINT32 InternalAcpiGetTimerTick ( VOID ); - -#endif // _ACPI_TIMER_LIB_INTERNAL_H_ diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h index 5d23d1828b..ac464988eb 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChange.h @@ -8,8 +8,7 @@ **/ -#ifndef SNP_PAGE_STATE_INTERNAL_H_ -#define SNP_PAGE_STATE_INTERNAL_H_ +#pragma once // // SEV-SNP Page states @@ -33,5 +32,3 @@ VOID SnpPageStateFailureTerminate ( VOID ); - -#endif diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h index ffc7430b22..4ba585e4d3 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h @@ -11,8 +11,7 @@ **/ -#ifndef __VIRTUAL_MEMORY__ -#define __VIRTUAL_MEMORY__ +#pragma once #include #include @@ -167,5 +166,3 @@ InternalMemEncryptSevCreateIdentityMap1G ( IN PHYSICAL_ADDRESS PhysicalAddress, IN UINTN Length ); - -#endif diff --git a/OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h b/OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h index e9403798d9..76e22702b3 100644 --- a/OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h +++ b/OvmfPkg/Library/BaseMemEncryptTdxLib/VirtualMemory.h @@ -11,8 +11,7 @@ **/ -#ifndef TDX_VIRTUAL_MEMORY_ -#define TDX_VIRTUAL_MEMORY_ +#pragma once #include #include @@ -177,5 +176,3 @@ typedef struct { UINTN Offset; UINTN FreePages; } PAGE_TABLE_POOL; - -#endif diff --git a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h index b836fd593c..3881a793e1 100644 --- a/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h +++ b/OvmfPkg/Library/BasePciCapLib/BasePciCapLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __BASE_PCI_CAP_LIB_H__ -#define __BASE_PCI_CAP_LIB_H__ +#pragma once #include @@ -50,5 +49,3 @@ struct PCI_CAP { struct PCI_CAP_LIST { ORDERED_COLLECTION *Capabilities; }; - -#endif // __BASE_PCI_CAP_LIB_H__ diff --git a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h index 5d587ceca3..96506fbd02 100644 --- a/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h +++ b/OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__ -#define __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__ +#pragma once #include @@ -37,5 +36,3 @@ typedef struct { #define SEGMENT_DEV_FROM_PCI_CAP_DEV(PciDevice) \ CR (PciDevice, SEGMENT_DEV, BaseDevice, SEGMENT_DEV_SIG) - -#endif // __BASE_PCI_CAP_PCI_SEGMENT_LIB_H__ diff --git a/OvmfPkg/Library/CcExitLib/CcExitTd.h b/OvmfPkg/Library/CcExitLib/CcExitTd.h index 013a55e207..788ae2bb0c 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitTd.h +++ b/OvmfPkg/Library/CcExitLib/CcExitTd.h @@ -5,8 +5,7 @@ **/ -#ifndef CC_EXIT_TD_H_ -#define CC_EXIT_TD_H_ +#pragma once #include #include @@ -28,5 +27,3 @@ TdVmCallCpuid ( IN UINT64 Ecx, OUT VOID *Results ); - -#endif diff --git a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.h b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.h index 464591fcb7..534f12dac5 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.h +++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.h @@ -6,8 +6,7 @@ **/ -#ifndef CC_EXIT_VC_HANDLER_H_ -#define CC_EXIT_VC_HANDLER_H_ +#pragma once #include #include @@ -49,5 +48,3 @@ EFIAPI VmgExitIssueAssert ( IN OUT SEV_ES_PER_CPU_DATA *SevEsData ); - -#endif diff --git a/OvmfPkg/Library/CcExitLib/CcInstruction.h b/OvmfPkg/Library/CcExitLib/CcInstruction.h index a8223a6a7d..b91aa53ac1 100644 --- a/OvmfPkg/Library/CcExitLib/CcInstruction.h +++ b/OvmfPkg/Library/CcExitLib/CcInstruction.h @@ -7,8 +7,7 @@ **/ -#ifndef CC_INSTRUCTION_H_ -#define CC_INSTRUCTION_H_ +#pragma once #include #include @@ -193,5 +192,3 @@ CcInitInstructionData ( IN GHCB *Ghcb, IN EFI_SYSTEM_CONTEXT_X64 *Regs ); - -#endif diff --git a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoPciHostBridgeLib.h b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoPciHostBridgeLib.h index 627de118d3..f785e9d704 100644 --- a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoPciHostBridgeLib.h +++ b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoPciHostBridgeLib.h @@ -7,8 +7,7 @@ **/ -#ifndef __HARDWARE_INFO_PCI_HOST_BRIDGE_LIB_H__ -#define __HARDWARE_INFO_PCI_HOST_BRIDGE_LIB_H__ +#pragma once #include #include @@ -252,5 +251,3 @@ HardwareInfoPciHostBridgeGet ( OUT PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PcieConfig OPTIONAL ); - -#endif // __HARDWARE_INFO_PCI_HOST_BRIDGE_LIB_H__ diff --git a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h index 40a785eac4..f9cab1f8bd 100644 --- a/OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h +++ b/OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h @@ -7,8 +7,7 @@ **/ -#ifndef __HARDWARE_INFO_TYPES_LIB_H__ -#define __HARDWARE_INFO_TYPES_LIB_H__ +#pragma once // Specific hardware types: #include "HardwareInfoPciHostBridgeLib.h" @@ -66,5 +65,3 @@ typedef struct { #define HARDWARE_INFO_FROM_LINK(a) \ BASE_CR (a, HARDWARE_INFO, Link) - -#endif // __HARDWARE_INFO_TYPES_LIB_H__ diff --git a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h index deb9b6e861..79dee7f849 100644 --- a/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h +++ b/OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.h @@ -7,8 +7,7 @@ **/ -#ifndef _LOAD_LINUX_LIB_INCLUDED_ -#define _LOAD_LINUX_LIB_INCLUDED_ +#pragma once #include #include @@ -48,5 +47,3 @@ VOID SetLinuxDescriptorTables ( VOID ); - -#endif diff --git a/OvmfPkg/Library/LockBoxLib/LockBoxLib.h b/OvmfPkg/Library/LockBoxLib/LockBoxLib.h index a5392c9124..3109875d78 100644 --- a/OvmfPkg/Library/LockBoxLib/LockBoxLib.h +++ b/OvmfPkg/Library/LockBoxLib/LockBoxLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __LOCK_BOX_LIB_IMPL_H__ -#define __LOCK_BOX_LIB_IMPL_H__ +#pragma once #pragma pack(1) @@ -48,5 +47,3 @@ EFIAPI LockBoxLibInitialize ( VOID ); - -#endif diff --git a/OvmfPkg/Library/NestedInterruptTplLib/Iret.h b/OvmfPkg/Library/NestedInterruptTplLib/Iret.h index 278c1e22b3..f38cff224d 100644 --- a/OvmfPkg/Library/NestedInterruptTplLib/Iret.h +++ b/OvmfPkg/Library/NestedInterruptTplLib/Iret.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _IRET_H_ -#define _IRET_H_ +#pragma once #include @@ -15,5 +14,3 @@ VOID DisableInterruptsOnIret ( IN OUT EFI_SYSTEM_CONTEXT SystemContext ); - -#endif // _IRET_H_ diff --git a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.h b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.h index 15161cbddc..c407d10e1e 100644 --- a/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.h +++ b/OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __NV_VARS_FILE_LIB_INSTANCE__ -#define __NV_VARS_FILE_LIB_INSTANCE__ +#pragma once #include @@ -49,5 +48,3 @@ EFI_STATUS SaveNvVarsToFs ( EFI_HANDLE FsHandle ); - -#endif diff --git a/OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h b/OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h index 1581962719..23b1ed657b 100644 --- a/OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h +++ b/OvmfPkg/Library/PeilessStartupLib/PeilessStartupInternal.h @@ -6,8 +6,7 @@ **/ -#ifndef PEILESS_STARTUP_INTERNAL_LIB_H_ -#define PEILESS_STARTUP_INTERNAL_LIB_H_ +#pragma once #include #include @@ -57,5 +56,3 @@ EFI_STATUS EFIAPI ConstructSecHobList ( ); - -#endif diff --git a/OvmfPkg/Library/PeilessStartupLib/X64/PageTables.h b/OvmfPkg/Library/PeilessStartupLib/X64/PageTables.h index a0d0d3547b..329ed9d3d4 100644 --- a/OvmfPkg/Library/PeilessStartupLib/X64/PageTables.h +++ b/OvmfPkg/Library/PeilessStartupLib/X64/PageTables.h @@ -14,8 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef PAGE_TABLES_H_ -#define PAGE_TABLES_H_ +#pragma once #define SYS_CODE64_SEL 0x38 @@ -202,5 +201,3 @@ BOOLEAN IsNullDetectionEnabled ( VOID ); - -#endif diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h index e238dda9e1..1302f5cc90 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h @@ -14,8 +14,7 @@ Abstract: **/ -#ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ -#define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ +#pragma once #include @@ -184,5 +183,3 @@ EFI_STATUS TryRunningQemuKernel ( VOID ); - -#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.h b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.h index 9be184cb64..0199a2141f 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.h +++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.h @@ -15,8 +15,7 @@ Abstract: **/ -#ifndef _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ -#define _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ +#pragma once #include @@ -185,5 +184,3 @@ EFI_STATUS TryRunningQemuKernel ( VOID ); - -#endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_ diff --git a/OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.h b/OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.h index 70c52d9832..be939f948e 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.h +++ b/OvmfPkg/Library/PlatformBootManagerLibLight/PlatformBm.h @@ -8,8 +8,7 @@ **/ -#ifndef _PLATFORM_BM_H_ -#define _PLATFORM_BM_H_ +#pragma once #include #include @@ -41,5 +40,3 @@ EFIAPI TryRunningQemuKernel ( VOID ); - -#endif // _PLATFORM_BM_H_ diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h index 6d08909dbc..cf1d1cd5be 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h @@ -7,8 +7,7 @@ **/ -#ifndef __DEBUG_IO_PORT_DETECT_H__ -#define __DEBUG_IO_PORT_DETECT_H__ +#pragma once #include @@ -41,5 +40,3 @@ EFIAPI PlatformDebugLibIoPortFound ( VOID ); - -#endif diff --git a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h index 7c4a338693..9606204530 100644 --- a/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h +++ b/OvmfPkg/Library/QemuBootOrderLib/ExtraRootBusMap.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __EXTRA_ROOT_BUS_MAP_H__ -#define __EXTRA_ROOT_BUS_MAP_H__ +#pragma once /** Incomplete ("opaque") data type implementing the map. @@ -30,5 +29,3 @@ MapRootBusPosToBusNr ( IN UINT64 RootBusPos, OUT UINT32 *RootBusNr ); - -#endif diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h index a33caff83a..cfe58a6d8e 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h @@ -8,8 +8,7 @@ **/ -#ifndef __QEMU_FW_CFG_LIB_INTERNAL_H__ -#define __QEMU_FW_CFG_LIB_INTERNAL_H__ +#pragma once #include #include @@ -176,5 +175,3 @@ EFI_STATUS InternalQemuFwCfgInitCache ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ); - -#endif diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h index 961612f067..2061fa7b28 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMmioInternal.h @@ -9,8 +9,7 @@ **/ -#ifndef QEMU_FW_CFG_LIB_MMIO_INTERNAL_H_ -#define QEMU_FW_CFG_LIB_MMIO_INTERNAL_H_ +#pragma once typedef struct { UINTN FwCfgSelectorAddress; @@ -234,5 +233,3 @@ DmaTransferBytes ( IN OUT VOID *Buffer OPTIONAL, IN UINT32 Control ); - -#endif diff --git a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.h b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.h index 7afa74ff6f..04a9a115c1 100644 --- a/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.h +++ b/OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __SERIALIZE_VARIABLES_LIB_INSTANCE__ -#define __SERIALIZE_VARIABLES_LIB_INSTANCE__ +#pragma once #include @@ -28,5 +27,3 @@ typedef struct { UINTN BufferSize; UINTN DataSize; } SV_INSTANCE; - -#endif diff --git a/OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h b/OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h index d1387f2dfb..59fe82e344 100644 --- a/OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h +++ b/OvmfPkg/Library/SmmRelocationLib/InternalSmmRelocationLib.h @@ -12,8 +12,7 @@ **/ -#ifndef INTERNAL_SMM_RELOCATION_LIB_H_ -#define INTERNAL_SMM_RELOCATION_LIB_H_ +#pragma once #include #include @@ -123,5 +122,3 @@ VOID EFIAPI SmmInitFixupAddress ( ); - -#endif diff --git a/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h b/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h index 3ff65966b2..1fc9841ae6 100644 --- a/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h +++ b/OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __UEFI_PCI_CAP_PCI_IO_LIB_H__ -#define __UEFI_PCI_CAP_PCI_IO_LIB_H__ +#pragma once #include @@ -34,5 +33,3 @@ typedef struct { #define PROTO_DEV_FROM_PCI_CAP_DEV(PciDevice) \ CR (PciDevice, PROTO_DEV, BaseDevice, PROTO_DEV_SIG) - -#endif // __UEFI_PCI_CAP_PCI_IO_LIB_H__ diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h index 7298cf5821..01f91a0e58 100644 --- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h +++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_MMIO_DEVICE_INTERNAL_H_ -#define _VIRTIO_MMIO_DEVICE_INTERNAL_H_ +#pragma once #include @@ -172,5 +171,3 @@ VirtioMmioUnmapSharedBuffer ( IN VIRTIO_DEVICE_PROTOCOL *This, IN VOID *Mapping ); - -#endif // _VIRTIO_MMIO_DEVICE_INTERNAL_H_ diff --git a/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.h b/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.h index 93706995f8..4a6b590037 100644 --- a/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.h +++ b/OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.h @@ -7,8 +7,7 @@ Copyright (c) 2019, Citrix Systems, Inc. SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef LOCAL_APIC_TIMER_H_ -#define LOCAL_APIC_TIMER_H_ +#pragma once #include @@ -174,5 +173,3 @@ TimerDriverGenerateSoftInterrupt ( IN EFI_TIMER_ARCH_PROTOCOL *This ) ; - -#endif diff --git a/OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h b/OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h index 5ad0b14642..ed00b28ce0 100644 --- a/OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h +++ b/OvmfPkg/LoongArchVirt/Library/LsRealTimeClockLib/LsRealTimeClock.h @@ -7,8 +7,7 @@ **/ -#ifndef LS_REAL_TIME_CLOCK_H_ -#define LS_REAL_TIME_CLOCK_H_ +#pragma once #define TOY_WRITE0_REG 0x24 #define TOY_WRITE1_REG 0x28 @@ -36,5 +35,3 @@ #define TOY_HOUR_SHIFT 16 #define TOY_MIN_SHIFT 10 #define TOY_SEC_SHIFT 4 - -#endif // LS_REAL_TIME_CLOCK_H_ diff --git a/OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h b/OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h index 06e2572db0..70df07c0bd 100644 --- a/OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h +++ b/OvmfPkg/LoongArchVirt/Library/ResetSystemAcpiLib/ResetSystemAcpiGed.h @@ -7,8 +7,7 @@ **/ -#ifndef RESET_SYSTEM_ACPI_GED_H_ -#define RESET_SYSTEM_ACPI_GED_H_ +#pragma once #include @@ -20,4 +19,3 @@ typedef struct { } POWER_MANAGER; extern POWER_MANAGER mPowerManager; -#endif // RESET_SYSTEM_ACPI_GED_H_ diff --git a/OvmfPkg/LoongArchVirt/PlatformPei/Platform.h b/OvmfPkg/LoongArchVirt/PlatformPei/Platform.h index 62456a5725..e3887d5602 100644 --- a/OvmfPkg/LoongArchVirt/PlatformPei/Platform.h +++ b/OvmfPkg/LoongArchVirt/PlatformPei/Platform.h @@ -7,8 +7,7 @@ **/ -#ifndef PLATFORM_H_ -#define PLATFORM_H_ +#pragma once #include @@ -81,5 +80,3 @@ EFIAPI GetMemoryMapPolicy ( OUT EFI_MEMORY_DESCRIPTOR **MemoryTable ); - -#endif // PLATFORM_H_ diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.h b/OvmfPkg/LsiScsiDxe/LsiScsi.h index bdee9bb70e..573ca048a5 100644 --- a/OvmfPkg/LsiScsiDxe/LsiScsi.h +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h @@ -9,8 +9,7 @@ **/ -#ifndef _LSI_SCSI_DXE_H_ -#define _LSI_SCSI_DXE_H_ +#pragma once typedef struct { // @@ -195,5 +194,3 @@ LsiScsiGetDeviceName ( IN CHAR8 *Language, OUT CHAR16 **ControllerName ); - -#endif // _LSI_SCSI_DXE_H_ diff --git a/OvmfPkg/PlatformDxe/Platform.h b/OvmfPkg/PlatformDxe/Platform.h index 7cdbd867ca..05aa25bef8 100644 --- a/OvmfPkg/PlatformDxe/Platform.h +++ b/OvmfPkg/PlatformDxe/Platform.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ +#pragma once // // Macro and type definitions that connect the form with the HII driver code. @@ -33,5 +32,3 @@ typedef struct { UINT16 CurrentPreferredResolution[MAXSIZE_RES_CUR]; UINT32 NextPreferredResolution; } MAIN_FORM_STATE; - -#endif // _PLATFORM_H_ diff --git a/OvmfPkg/PlatformDxe/PlatformConfig.h b/OvmfPkg/PlatformDxe/PlatformConfig.h index 93d06a9a6b..9ea6e5995c 100644 --- a/OvmfPkg/PlatformDxe/PlatformConfig.h +++ b/OvmfPkg/PlatformDxe/PlatformConfig.h @@ -9,8 +9,7 @@ **/ -#ifndef _PLATFORM_CONFIG_H_ -#define _PLATFORM_CONFIG_H_ +#pragma once #include @@ -52,5 +51,3 @@ PlatformConfigLoad ( extern CHAR16 mVariableName[]; extern CHAR16 mHiiFormName[]; - -#endif // _PLATFORM_CONFIG_H_ diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h index 0a59547cfc..5ad285ffca 100644 --- a/OvmfPkg/PlatformPei/Platform.h +++ b/OvmfPkg/PlatformPei/Platform.h @@ -6,8 +6,7 @@ **/ -#ifndef _PLATFORM_PEI_H_INCLUDED_ -#define _PLATFORM_PEI_H_INCLUDED_ +#pragma once #include #include @@ -110,5 +109,3 @@ VOID SevInitializeRam ( VOID ); - -#endif // _PLATFORM_PEI_H_INCLUDED_ diff --git a/OvmfPkg/PlatformPei/PlatformId.h b/OvmfPkg/PlatformPei/PlatformId.h index c8b55288c4..61b1b4701f 100644 --- a/OvmfPkg/PlatformPei/PlatformId.h +++ b/OvmfPkg/PlatformPei/PlatformId.h @@ -7,8 +7,7 @@ **/ -#ifndef __PLATFORM_PEI_PLATFORMID_H__ -#define __PLATFORM_PEI_PLATFORMID_H__ +#pragma once /** * Reads opt/org.tianocode/sp800155evt/%d from 0 to the first positive integer @@ -22,5 +21,3 @@ VOID PlatformIdInitialization ( IN CONST EFI_PEI_SERVICES **PeiServices ); - -#endif // __PLATFORM_PEI_PLATFORMID_H__ diff --git a/OvmfPkg/PvScsiDxe/PvScsi.h b/OvmfPkg/PvScsiDxe/PvScsi.h index 245705ed07..92c829a3e4 100644 --- a/OvmfPkg/PvScsiDxe/PvScsi.h +++ b/OvmfPkg/PvScsiDxe/PvScsi.h @@ -9,8 +9,7 @@ **/ -#ifndef __PVSCSI_DXE_H_ -#define __PVSCSI_DXE_H_ +#pragma once #include #include @@ -68,5 +67,3 @@ typedef struct { #define PVSCSI_DMA_BUF_DEV_ADDR(Dev, MemberName) \ (Dev->DmaBufDmaDesc.DeviceAddress + OFFSET_OF(PVSCSI_DMA_BUFFER, MemberName)) - -#endif // __PVSCSI_DXE_H_ diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h index dda3bc5feb..bbb64df084 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h @@ -14,8 +14,7 @@ **/ -#ifndef _FW_BLOCK_SERVICE_H -#define _FW_BLOCK_SERVICE_H +#pragma once typedef struct { UINTN FvBase; @@ -198,5 +197,3 @@ VOID UpdateQemuFlashVariablesEnable ( VOID ); - -#endif diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h index ea895157da..ea8ead3349 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h @@ -7,8 +7,7 @@ **/ -#ifndef __QEMU_FLASH_H__ -#define __QEMU_FLASH_H__ +#pragma once #include @@ -97,5 +96,3 @@ QemuFlashPtrWrite ( IN volatile UINT8 *Ptr, IN UINT8 Value ); - -#endif diff --git a/OvmfPkg/RiscVVirt/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.h b/OvmfPkg/RiscVVirt/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.h index fe3cf0a17b..434287e937 100644 --- a/OvmfPkg/RiscVVirt/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.h +++ b/OvmfPkg/RiscVVirt/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.h @@ -6,8 +6,7 @@ **/ -#ifndef __PLATFORM_FLASH_ACCESS_LIB_H__ -#define __PLATFORM_FLASH_ACCESS_LIB_H__ +#pragma once #include @@ -91,5 +90,3 @@ PerformFlashWriteWithProgress ( IN UINTN StartPercentage, IN UINTN EndPercentage ); - -#endif diff --git a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.h b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.h index 70c52d9832..be939f948e 100644 --- a/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.h +++ b/OvmfPkg/RiscVVirt/Library/PlatformBootManagerLib/PlatformBm.h @@ -8,8 +8,7 @@ **/ -#ifndef _PLATFORM_BM_H_ -#define _PLATFORM_BM_H_ +#pragma once #include #include @@ -41,5 +40,3 @@ EFIAPI TryRunningQemuKernel ( VOID ); - -#endif // _PLATFORM_BM_H_ diff --git a/OvmfPkg/RiscVVirt/Library/PlatformSecLib/PlatformSecLib.h b/OvmfPkg/RiscVVirt/Library/PlatformSecLib/PlatformSecLib.h index 53fa53f1f6..ccd073fdc4 100644 --- a/OvmfPkg/RiscVVirt/Library/PlatformSecLib/PlatformSecLib.h +++ b/OvmfPkg/RiscVVirt/Library/PlatformSecLib/PlatformSecLib.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef PLATFORM_SEC_LIB_ -#define PLATFORM_SEC_LIB_ +#pragma once #include #include @@ -98,5 +97,3 @@ EFIAPI CpuInitialization ( VOID *FdtPointer ); - -#endif /* PLATFORM_SEC_LIB_ */ diff --git a/OvmfPkg/Sec/AmdSev.h b/OvmfPkg/Sec/AmdSev.h index c5ab0d5a0b..0bf3fcf878 100644 --- a/OvmfPkg/Sec/AmdSev.h +++ b/OvmfPkg/Sec/AmdSev.h @@ -7,8 +7,7 @@ **/ -#ifndef _AMD_SEV_SEC_INTERNAL_H__ -#define _AMD_SEV_SEC_INTERNAL_H__ +#pragma once /** Handle an SEV-ES/GHCB protocol check failure. @@ -104,5 +103,3 @@ VOID SecMapApicBaseUnencrypted ( VOID ); - -#endif diff --git a/OvmfPkg/SioBusDxe/SioBusDxe.h b/OvmfPkg/SioBusDxe/SioBusDxe.h index 0fc4ed8cf7..5374a618d4 100644 --- a/OvmfPkg/SioBusDxe/SioBusDxe.h +++ b/OvmfPkg/SioBusDxe/SioBusDxe.h @@ -8,8 +8,7 @@ **/ -#ifndef __SIO_BUS_DXE_H__ -#define __SIO_BUS_DXE_H__ +#pragma once #include @@ -318,5 +317,3 @@ SioBusDriverBindingStop ( IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer ); - -#endif // __SIO_BUS_DXE_H__ diff --git a/OvmfPkg/SioBusDxe/SioService.h b/OvmfPkg/SioBusDxe/SioService.h index d30caed9f6..1800411456 100644 --- a/OvmfPkg/SioBusDxe/SioService.h +++ b/OvmfPkg/SioBusDxe/SioService.h @@ -8,8 +8,7 @@ **/ -#ifndef __SIO_SERVICE_H__ -#define __SIO_SERVICE_H__ +#pragma once #pragma pack(1) @@ -209,5 +208,3 @@ SioCreateAllChildDevices ( IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath ); - -#endif // __SIO_SERVICE_H__ diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h index 709e096e7b..24d1399ad6 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -8,8 +8,7 @@ **/ -#ifndef SMBIOS_PLATFORM_DXE_H_ -#define SMBIOS_PLATFORM_DXE_H_ +#pragma once /** Install all structures from the given SMBIOS structures block @@ -43,5 +42,3 @@ UINT8 * GetCloudHvSmbiosTables ( VOID ); - -#endif diff --git a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h index 850a8b662c..5f4089b7d7 100644 --- a/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h @@ -9,8 +9,7 @@ **/ -#ifndef XEN_SMBIOS_PLATFORM_DXE_H_ -#define XEN_SMBIOS_PLATFORM_DXE_H_ +#pragma once #include // SMBIOS_TABLE_ENTRY_POINT @@ -24,5 +23,3 @@ SMBIOS_TABLE_ENTRY_POINT * GetXenSmbiosTables ( VOID ); - -#endif diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.h b/OvmfPkg/SmmControl2Dxe/SmiFeatures.h index fd1d507362..465df6621e 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.h +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __SMI_FEATURES_H__ -#define __SMI_FEATURES_H__ +#pragma once #include @@ -36,5 +35,3 @@ VOID SaveSmiFeatures ( VOID ); - -#endif diff --git a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h index d92c432530..91495eb9d0 100644 --- a/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h +++ b/OvmfPkg/Tcg/Tcg2Config/Tpm12Support.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef TPM12_SUPPORT_H_ -#define TPM12_SUPPORT_H_ +#pragma once #include @@ -30,5 +29,3 @@ EFI_STATUS InternalTpm12Detect ( VOID ); - -#endif // TPM12_SUPPORT_H_ diff --git a/OvmfPkg/TdxDxe/TdxAcpiTable.h b/OvmfPkg/TdxDxe/TdxAcpiTable.h index 6081665ffa..1519b451c6 100644 --- a/OvmfPkg/TdxDxe/TdxAcpiTable.h +++ b/OvmfPkg/TdxDxe/TdxAcpiTable.h @@ -5,8 +5,7 @@ **/ -#ifndef TDX_ACPI_TABLE_H_ -#define TDX_ACPI_TABLE_H_ +#pragma once #include @@ -58,5 +57,3 @@ AlterAcpiTable ( IN EFI_EVENT Event, IN VOID *Context ); - -#endif diff --git a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.h b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.h index ee8268c56b..55815a1c39 100644 --- a/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.h +++ b/OvmfPkg/VirtMmCommunicationDxe/VirtMmCommunication.h @@ -4,8 +4,7 @@ **/ -#ifndef _VIRT_MM_COMM_DXE_H_ -#define _VIRT_MM_COMM_DXE_H_ +#pragma once /* communication buffer */ @@ -49,5 +48,3 @@ VirtMmHwPioTransfer ( UINT32 BufferSize, BOOLEAN ToDevice ); - -#endif /* _VIRT_MM_COMM_DXE_H_ */ diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.h b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.h index 3c7f509415..1cec066dda 100644 --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.h +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.h @@ -7,8 +7,7 @@ **/ -#ifndef __VIRT_NOR_FLASH_DXE__ -#define __VIRT_NOR_FLASH_DXE__ +#pragma once #include #include @@ -152,5 +151,3 @@ EFIAPI NorFlashFvbInitialize ( IN NOR_FLASH_INSTANCE *Instance ); - -#endif /* __VIRT_NOT_FLASH_DXE__ */ diff --git a/OvmfPkg/Virtio10Dxe/Virtio10.h b/OvmfPkg/Virtio10Dxe/Virtio10.h index 355f2a0785..f1fd91724a 100644 --- a/OvmfPkg/Virtio10Dxe/Virtio10.h +++ b/OvmfPkg/Virtio10Dxe/Virtio10.h @@ -6,8 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _VIRTIO_1_0_DXE_H_ -#define _VIRTIO_1_0_DXE_H_ +#pragma once #include #include @@ -46,5 +45,3 @@ typedef struct { #define VIRTIO_1_0_FROM_VIRTIO_DEVICE(Device) \ CR (Device, VIRTIO_1_0_DEV, VirtIo, VIRTIO_1_0_SIGNATURE) - -#endif // _VIRTIO_1_0_DXE_H_ diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.h b/OvmfPkg/VirtioBlkDxe/VirtioBlk.h index 54a96626ff..ac2bd62578 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.h +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_BLK_DXE_H_ -#define _VIRTIO_BLK_DXE_H_ +#pragma once #include #include @@ -273,5 +272,3 @@ VirtioBlkGetDeviceName ( IN CHAR8 *Language, OUT CHAR16 **ControllerName ); - -#endif // _VIRTIO_BLK_DXE_H_ diff --git a/OvmfPkg/VirtioFsDxe/VirtioFsDxe.h b/OvmfPkg/VirtioFsDxe/VirtioFsDxe.h index 0bbf5b7895..4af962d239 100644 --- a/OvmfPkg/VirtioFsDxe/VirtioFsDxe.h +++ b/OvmfPkg/VirtioFsDxe/VirtioFsDxe.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef VIRTIO_FS_DXE_H_ -#define VIRTIO_FS_DXE_H_ +#pragma once #include // SIGNATURE_64() #include // EFI_FILE_INFO @@ -540,5 +539,3 @@ VirtioFsSimpleFileWrite ( IN OUT UINTN *BufferSize, IN VOID *Buffer ); - -#endif // VIRTIO_FS_DXE_H_ diff --git a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h b/OvmfPkg/VirtioGpuDxe/VirtioGpu.h index 45da564152..7d42896eec 100644 --- a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h +++ b/OvmfPkg/VirtioGpuDxe/VirtioGpu.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_GPU_DXE_H_ -#define _VIRTIO_GPU_DXE_H_ +#pragma once #include #include @@ -411,5 +410,3 @@ ReleaseGopResources ( // Template for initializing VGPU_GOP.Gop. // extern CONST EFI_GRAPHICS_OUTPUT_PROTOCOL mGopTemplate; - -#endif // _VIRTIO_GPU_DXE_H_ diff --git a/OvmfPkg/VirtioKeyboardDxe/VirtioKeyCodes.h b/OvmfPkg/VirtioKeyboardDxe/VirtioKeyCodes.h index 31299b5c64..fe5ddc5a51 100644 --- a/OvmfPkg/VirtioKeyboardDxe/VirtioKeyCodes.h +++ b/OvmfPkg/VirtioKeyboardDxe/VirtioKeyCodes.h @@ -11,8 +11,7 @@ **/ -#ifndef _VIRTIO_KEYBOARD_KEY_CODES_H_ -#define _VIRTIO_KEYBOARD_KEY_CODES_H_ +#pragma once /* * Event types @@ -290,5 +289,3 @@ #define KEY_MICMUTE 248 /* Mute / unmute the microphone */ /* Code 255 is reserved for special needs of AT keyboard driver */ - -#endif diff --git a/OvmfPkg/VirtioKeyboardDxe/VirtioKeyboard.h b/OvmfPkg/VirtioKeyboardDxe/VirtioKeyboard.h index d4cbde97fd..b244dec12e 100644 --- a/OvmfPkg/VirtioKeyboardDxe/VirtioKeyboard.h +++ b/OvmfPkg/VirtioKeyboardDxe/VirtioKeyboard.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_KEYBOARD_DXE_H_ -#define _VIRTIO_KEYBOARD_DXE_H_ +#pragma once #include #include @@ -205,5 +204,3 @@ VirtioKeyboardUnregisterKeyNotify ( IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle ); - -#endif diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.h b/OvmfPkg/VirtioNetDxe/VirtioNet.h index 719c575132..a1be672feb 100644 --- a/OvmfPkg/VirtioNetDxe/VirtioNet.h +++ b/OvmfPkg/VirtioNetDxe/VirtioNet.h @@ -9,8 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef _VIRTIO_NET_DXE_H_ -#define _VIRTIO_NET_DXE_H_ +#pragma once #include #include @@ -326,5 +325,3 @@ VirtioNetExitBoot ( IN EFI_EVENT Event, IN VOID *Context ); - -#endif // _VIRTIO_NET_DXE_H_ diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h index 772a03c446..9daae9e5e1 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_PCI_DEVICE_DXE_H_ -#define _VIRTIO_PCI_DEVICE_DXE_H_ +#pragma once #include #include @@ -184,5 +183,3 @@ VirtioPciUnmapSharedBuffer ( IN VIRTIO_DEVICE_PROTOCOL *This, IN VOID *Mapping ); - -#endif // _VIRTIO_PCI_DEVICE_DXE_H_ diff --git a/OvmfPkg/VirtioRngDxe/VirtioRng.h b/OvmfPkg/VirtioRngDxe/VirtioRng.h index 3519521d6a..546d4a0fd7 100644 --- a/OvmfPkg/VirtioRngDxe/VirtioRng.h +++ b/OvmfPkg/VirtioRngDxe/VirtioRng.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_RNG_DXE_H_ -#define _VIRTIO_RNG_DXE_H_ +#pragma once #include #include @@ -38,5 +37,3 @@ typedef struct { #define VIRTIO_ENTROPY_SOURCE_FROM_RNG(RngPointer) \ CR (RngPointer, VIRTIO_RNG_DEV, Rng, VIRTIO_RNG_SIG) - -#endif diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.h b/OvmfPkg/VirtioScsiDxe/VirtioScsi.h index e7aa16dc2f..0acb0ea011 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.h +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.h @@ -9,8 +9,7 @@ **/ -#ifndef _VIRTIO_SCSI_DXE_H_ -#define _VIRTIO_SCSI_DXE_H_ +#pragma once #include #include @@ -185,5 +184,3 @@ VirtioScsiGetDeviceName ( IN CHAR8 *Language, OUT CHAR16 **ControllerName ); - -#endif // _VIRTIO_SCSI_DXE_H_ diff --git a/OvmfPkg/VirtioSerialDxe/VirtioSerial.h b/OvmfPkg/VirtioSerialDxe/VirtioSerial.h index e626fdf430..921bed8773 100644 --- a/OvmfPkg/VirtioSerialDxe/VirtioSerial.h +++ b/OvmfPkg/VirtioSerialDxe/VirtioSerial.h @@ -8,8 +8,7 @@ **/ -#ifndef _VIRTIO_SERIAL_DXE_H_ -#define _VIRTIO_SERIAL_DXE_H_ +#pragma once #include #include @@ -222,5 +221,3 @@ VirtioSerialPortRemove ( IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId ); - -#endif diff --git a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h index ccb5b092ad..2968c7f7d8 100644 --- a/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h @@ -7,8 +7,7 @@ **/ -#ifndef ACPI_PLATFORM_H_ -#define ACPI_PLATFORM_H_ +#pragma once #include // EFI_ACPI_TABLE_PROTOCOL @@ -23,5 +22,3 @@ EFIAPI InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); - -#endif diff --git a/OvmfPkg/XenBusDxe/EventChannel.h b/OvmfPkg/XenBusDxe/EventChannel.h index 1e748825dd..760a31a9a5 100644 --- a/OvmfPkg/XenBusDxe/EventChannel.h +++ b/OvmfPkg/XenBusDxe/EventChannel.h @@ -7,8 +7,7 @@ **/ -#ifndef __XENBUS_EVENT_CHANNEL_H -#define __XENBUS_EVENT_CHANNEL_H +#pragma once #include "XenBusDxe.h" @@ -79,5 +78,3 @@ XenBusEventChannelClose ( IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port ); - -#endif diff --git a/OvmfPkg/XenBusDxe/GrantTable.h b/OvmfPkg/XenBusDxe/GrantTable.h index 3d5c98e85d..af9e94e8ea 100644 --- a/OvmfPkg/XenBusDxe/GrantTable.h +++ b/OvmfPkg/XenBusDxe/GrantTable.h @@ -10,8 +10,7 @@ **/ -#ifndef __GNTTAB_H__ -#define __GNTTAB_H__ +#pragma once #include @@ -67,5 +66,3 @@ XenBusGrantEndAccess ( IN XENBUS_PROTOCOL *This, IN grant_ref_t Ref ); - -#endif /* !__GNTTAB_H__ */ diff --git a/OvmfPkg/XenBusDxe/XenBus.h b/OvmfPkg/XenBusDxe/XenBus.h index 36aff47019..735abd392c 100644 --- a/OvmfPkg/XenBusDxe/XenBus.h +++ b/OvmfPkg/XenBusDxe/XenBus.h @@ -7,8 +7,7 @@ **/ -#ifndef _XEN_XENBUS_XENBUSB_H -#define _XEN_XENBUS_XENBUSB_H +#pragma once #include "XenBusDxe.h" @@ -34,5 +33,3 @@ XENSTORE_STATUS XenBusEnumerateBus ( XENBUS_DEVICE *Dev ); - -#endif /* _XEN_XENBUS_XENBUSB_H */ diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.h b/OvmfPkg/XenBusDxe/XenBusDxe.h index 8b32505cb0..f97e55f625 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.h +++ b/OvmfPkg/XenBusDxe/XenBusDxe.h @@ -7,8 +7,7 @@ **/ -#ifndef __EFI_XENBUS_DXE_H__ -#define __EFI_XENBUS_DXE_H__ +#pragma once #include @@ -118,5 +117,3 @@ CHAR8 * AsciiStrDup ( IN CONST CHAR8 *Str ); - -#endif diff --git a/OvmfPkg/XenBusDxe/XenStore.h b/OvmfPkg/XenBusDxe/XenStore.h index b2ae805524..fd747427aa 100644 --- a/OvmfPkg/XenBusDxe/XenStore.h +++ b/OvmfPkg/XenBusDxe/XenStore.h @@ -12,8 +12,7 @@ SPDX-License-Identifier: MIT **/ -#ifndef _XEN_XENSTORE_XENSTOREVAR_H -#define _XEN_XENSTORE_XENSTOREVAR_H +#pragma once #include "XenBusDxe.h" @@ -358,5 +357,3 @@ XenBusUnregisterWatch ( IN XENBUS_PROTOCOL *This, IN VOID *Token ); - -#endif /* _XEN_XENSTORE_XENSTOREVAR_H */ diff --git a/OvmfPkg/XenPlatformPei/Cmos.h b/OvmfPkg/XenPlatformPei/Cmos.h index 8fca4866b4..8c73d9c344 100644 --- a/OvmfPkg/XenPlatformPei/Cmos.h +++ b/OvmfPkg/XenPlatformPei/Cmos.h @@ -8,8 +8,7 @@ **/ -#ifndef __CMOS_H__ -#define __CMOS_H__ +#pragma once /** Reads 8-bits of CMOS data. @@ -46,5 +45,3 @@ CmosWrite8 ( IN UINTN Index, IN UINT8 Value ); - -#endif diff --git a/OvmfPkg/XenPlatformPei/Platform.h b/OvmfPkg/XenPlatformPei/Platform.h index 7b4de128e7..99855446bf 100644 --- a/OvmfPkg/XenPlatformPei/Platform.h +++ b/OvmfPkg/XenPlatformPei/Platform.h @@ -8,8 +8,7 @@ **/ -#ifndef _PLATFORM_PEI_H_INCLUDED_ -#define _PLATFORM_PEI_H_INCLUDED_ +#pragma once #include #include @@ -138,5 +137,3 @@ extern EFI_BOOT_MODE mBootMode; extern UINT8 mPhysMemAddressWidth; extern UINT16 mHostBridgeDevId; - -#endif // _PLATFORM_PEI_H_INCLUDED_ diff --git a/OvmfPkg/XenPlatformPei/Xen.h b/OvmfPkg/XenPlatformPei/Xen.h index 58d1f05484..cfe2c2128f 100644 --- a/OvmfPkg/XenPlatformPei/Xen.h +++ b/OvmfPkg/XenPlatformPei/Xen.h @@ -7,8 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ -#ifndef __XEN_H__ -#define __XEN_H__ +#pragma once #include @@ -35,5 +34,3 @@ typedef struct { UINT32 E820EntriesCount; } EFI_XEN_OVMF_INFO; #pragma pack() - -#endif /* __XEN_H__ */ diff --git a/OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.h b/OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.h index 350b7bd309..0ee0dbf953 100644 --- a/OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.h +++ b/OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.h @@ -7,8 +7,7 @@ **/ -#ifndef __EFI_XEN_PV_BLK_DXE_H__ -#define __EFI_XEN_PV_BLK_DXE_H__ +#pragma once #include @@ -62,5 +61,3 @@ extern EFI_COMPONENT_NAME_PROTOCOL gXenPvBlkDxeComponentName; #include "DriverBinding.h" #include "ComponentName.h" #include "BlockIo.h" - -#endif