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 <michael.kubacki@microsoft.com>
This commit is contained in:
Michael Kubacki 2026-02-03 14:10:06 -05:00 committed by mergify[bot]
parent 58de02af29
commit a536e5d699
176 changed files with 176 additions and 702 deletions

View file

@ -6,8 +6,7 @@
**/
#ifndef ACPI_PLATFORM_H_
#define ACPI_PLATFORM_H_
#pragma once
#include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL
@ -28,5 +27,3 @@ EFIAPI
InstallAcpiTables (
IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
);
#endif

View file

@ -7,8 +7,7 @@
**/
#ifndef _ACPI_PLATFORM_H_INCLUDED_
#define _ACPI_PLATFORM_H_INCLUDED_
#pragma once
#include <PiDxe.h>
#include <Protocol/AcpiTable.h>
@ -52,5 +51,3 @@ EFIAPI
InstallAcpiTables (
IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
);
#endif /* _ACPI_PLATFORM_H_INCLUDED_ */

View file

@ -10,8 +10,7 @@
**/
#ifndef _Platform_h_INCLUDED_
#define _Platform_h_INCLUDED_
#pragma once
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
@ -69,4 +68,3 @@
0xCF9 /* I/O Port */ \
}
#define FACP_RESET_VAL 0x6
#endif

View file

@ -8,8 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _GOP_H_
#define _GOP_H_
#pragma once
#include <Uefi.h>
#include <Protocol/GraphicsOutput.h>
@ -144,5 +143,3 @@ InstallVbeShim (
IN CONST CHAR16 *CardName,
IN EFI_PHYSICAL_ADDRESS FrameBufferBase
);
#endif /* _GOP_H_ */

View file

@ -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_ */

View file

@ -7,8 +7,7 @@
**/
#ifndef _PLATFORM_PEI_H_INCLUDED_
#define _PLATFORM_PEI_H_INCLUDED_
#pragma once
#include <IndustryStandard/E820.h>
@ -133,5 +132,3 @@ extern UINT16 mHostBridgeDevId;
extern BOOLEAN mQ35SmramAtDefaultSmbase;
extern UINT32 mQemuUc32Base;
#endif // _PLATFORM_PEI_H_INCLUDED_

View file

@ -9,8 +9,7 @@
**/
#ifndef _SMBIOS_PLATFORM_DXE_H_
#define _SMBIOS_PLATFORM_DXE_H_
#pragma once
#include <PiDxe.h>
#include <Protocol/Smbios.h>
@ -45,5 +44,3 @@ BOOLEAN
IsEntryPointStructureValid (
IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure
);
#endif /* _SMBIOS_PLATFORM_DXE_H_ */

View file

@ -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_

View file

@ -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_

View file

@ -12,8 +12,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef QEMU_CPUHP_H_
#define QEMU_CPUHP_H_
#pragma once
#include <Protocol/MmCpuIo.h> // EFI_MM_CPU_IO_PROTOCOL
#include <Uefi/UefiBaseType.h> // EFI_STATUS
@ -64,5 +63,3 @@ QemuCpuhpCollectApicIds (
OUT UINT32 *ToUnplugSelectors,
OUT UINT32 *ToUnplugCount
);
#endif // QEMU_CPUHP_H_

View file

@ -6,8 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef SMBASE_H_
#define SMBASE_H_
#pragma once
#include <Uefi/UefiBaseType.h> // EFI_STATUS
#include <Uefi/UefiSpec.h> // EFI_BOOT_SERVICES
@ -42,5 +41,3 @@ SmbaseRelocate (
IN UINTN Smbase,
IN UINT32 PenAddress
);
#endif // SMBASE_H_

View file

@ -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

View file

@ -7,8 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef ENROLL_DEFAULT_KEYS_H_
#define ENROLL_DEFAULT_KEYS_H_
#pragma once
#include <Uefi/UefiBaseType.h>
@ -144,5 +143,3 @@ extern CONST UINTN mSizeOfWindowsUefi2023;
extern CONST UINT8 mSha256OfDevNull[];
extern CONST UINTN mSizeOfSha256OfDevNull;
#endif /* ENROLL_DEFAULT_KEYS_H_ */

View file

@ -6,8 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef CONFIDENTIAL_COMPUTING_SECRET_H_
#define CONFIDENTIAL_COMPUTING_SECRET_H_
#pragma once
#include <Uefi/UefiBaseType.h>
@ -24,5 +23,3 @@ typedef struct {
} CONFIDENTIAL_COMPUTING_SECRET_LOCATION;
extern EFI_GUID gConfidentialComputingSecretGuid;
#endif // SEV_LAUNCH_SECRET_H_

View file

@ -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 <Uefi/UefiBaseType.h>
@ -31,5 +30,3 @@ typedef PACKED struct {
} CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION;
extern EFI_GUID gConfidentialComputingSevSnpBlobGuid;
#endif

View file

@ -16,8 +16,7 @@
<https://msdn.microsoft.com/en-us/ie/dn932805(v=vs.94)>.
**/
#ifndef MICROSOFT_VENDOR_H_
#define MICROSOFT_VENDOR_H_
#pragma once
#include <Uefi/UefiBaseType.h>
@ -51,5 +50,3 @@
}
extern EFI_GUID gMicrosoftVendorGuid;
#endif /* MICROSOFT_VENDOR_H_ */

View file

@ -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 <Uefi/UefiBaseType.h>
@ -41,5 +40,3 @@
}
extern EFI_GUID gOvmfPkKek1AppPrefixGuid;
#endif /* OVMF_PK_KEK1_APP_PREFIX_H_ */

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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__

View file

@ -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__

View file

@ -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__ */

View file

@ -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__

View file

@ -11,8 +11,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __I440FX_PIIX4_H__
#define __I440FX_PIIX4_H__
#pragma once
#include <Library/PciLib.h>
@ -50,5 +49,3 @@
// IO ports
//
#define PIIX4_CPU_HOTPLUG_BASE 0xAF00
#endif

View file

@ -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__ */

View file

@ -6,8 +6,7 @@
**/
#ifndef __INSTRUCTION_PARSING_H__
#define __INSTRUCTION_PARSING_H__
#pragma once
#include <Base.h>
#include <Uefi.h>
@ -79,5 +78,3 @@ typedef union {
// Two-byte Opcode Flag
//
#define TWO_BYTE_OPCODE_ESCAPE 0x0F
#endif

View file

@ -6,8 +6,7 @@
**/
#ifndef OVMF_INTEL_TDX_H_
#define OVMF_INTEL_TDX_H_
#pragma once
#include <PiPei.h>
#include <Library/BaseLib.h>
@ -67,5 +66,3 @@ typedef struct {
} MP_RELOCATION_MAP;
#pragma pack()
#endif

View file

@ -11,8 +11,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __LEGACY_VGA_BIOS_H__
#define __LEGACY_VGA_BIOS_H__
#pragma once
#include <Base.h>
@ -125,5 +124,3 @@ typedef struct {
UINT16 OffScreenSizeKB;
} VBE2_MODE_INFO;
#pragma pack ()
#endif

View file

@ -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__ */

View file

@ -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_

View file

@ -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__

View file

@ -11,8 +11,7 @@
**/
#ifndef PAGE_TABLE_H_
#define PAGE_TABLE_H_
#pragma once
#include <Base.h>
@ -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

View file

@ -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_

View file

@ -9,8 +9,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __Q35_MCH_ICH9_H__
#define __Q35_MCH_ICH9_H__
#pragma once
#include <Library/PciLib.h>
#include <Uefi/UefiBaseType.h>
@ -123,5 +122,3 @@
#define ICH9_SMI_EN_GBL_SMI_EN BIT0
#define ICH9_ROOT_COMPLEX_BASE 0xFED1C000
#endif

View file

@ -16,8 +16,7 @@
interface that OVMF needs.
**/
#ifndef QEMU_CPU_HOTPLUG_H_
#define QEMU_CPU_HOTPLUG_H_
#pragma once
#include <Base.h>
@ -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_

View file

@ -9,8 +9,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __FW_CFG_H__
#define __FW_CFG_H__
#pragma once
#include <Base.h>
@ -92,5 +91,3 @@ typedef struct {
UINT64 Address;
} FW_CFG_DMA_ACCESS;
#pragma pack ()
#endif

View file

@ -7,8 +7,7 @@
**/
#ifndef QEMU_LOADER_H_
#define QEMU_LOADER_H_
#pragma once
#include <Base.h>
#include <IndustryStandard/QemuFwCfg.h>
@ -102,5 +101,3 @@ typedef struct {
} Command;
} QEMU_LOADER_ENTRY;
#pragma pack ()
#endif

View file

@ -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 <IndustryStandard/Pci23.h>
@ -50,5 +49,3 @@ typedef struct {
UINT64 Prefetchable64BitMmio;
} QEMU_PCI_BRIDGE_CAPABILITY_RESOURCE_RESERVATION;
#pragma pack ()
#endif

View file

@ -9,8 +9,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __QEMU_TPM_H__
#define __QEMU_TPM_H__
#pragma once
#include <Base.h>
@ -59,5 +58,3 @@ typedef struct {
#define QEMU_TPM_PPI_VERSION_NONE 0
#define QEMU_TPM_PPI_VERSION_1_30 1
#endif

View file

@ -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 */

View file

@ -10,9 +10,6 @@
**/
#ifndef _VIRTIO_H_
#define _VIRTIO_H_
#pragma once
#include <IndustryStandard/Virtio10.h>
#endif // _VIRTIO_H_

View file

@ -10,8 +10,7 @@
**/
#ifndef _VIRTIO_0_9_5_H_
#define _VIRTIO_0_9_5_H_
#pragma once
#include <Base.h>
@ -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_

View file

@ -8,8 +8,7 @@
**/
#ifndef _VIRTIO_0_9_5_NET_H_
#define _VIRTIO_0_9_5_NET_H_
#pragma once
#include <IndustryStandard/Virtio095.h>
@ -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_

View file

@ -7,8 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _VIRTIO_1_0_H_
#define _VIRTIO_1_0_H_
#pragma once
#include <IndustryStandard/Pci23.h>
#include <IndustryStandard/Virtio095.h>
@ -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_

View file

@ -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 <IndustryStandard/Virtio10.h>
#include <IndustryStandard/Virtio095Net.h>
@ -22,5 +21,3 @@ typedef struct {
UINT16 NumBuffers;
} VIRTIO_1_0_NET_REQ;
#pragma pack ()
#endif // _VIRTIO_1_0_NET_H_

View file

@ -9,8 +9,7 @@
**/
#ifndef _VIRTIO_BLK_H_
#define _VIRTIO_BLK_H_
#pragma once
#include <IndustryStandard/Virtio.h>
@ -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_

View file

@ -14,8 +14,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef VIRTIO_FS_H_
#define VIRTIO_FS_H_
#pragma once
#include <IndustryStandard/Virtio.h>
@ -450,5 +449,3 @@ typedef struct {
UINT32 Padding;
} VIRTIO_FS_FUSE_RENAME2_REQUEST;
#pragma pack ()
#endif // VIRTIO_FS_H_

View file

@ -18,8 +18,7 @@
**/
#ifndef _VIRTIO_GPU_H_
#define _VIRTIO_GPU_H_
#pragma once
#include <IndustryStandard/Virtio.h>
@ -223,5 +222,3 @@ typedef struct {
} Pmodes[VIRTIO_GPU_MAX_SCANOUTS];
} VIRTIO_GPU_RESP_DISPLAY_INFO;
#pragma pack ()
#endif // _VIRTIO_GPU_H_

View file

@ -8,9 +8,6 @@
**/
#ifndef _VIRTIO_NET_H_
#define _VIRTIO_NET_H_
#pragma once
#include <IndustryStandard/Virtio10Net.h>
#endif // _VIRTIO_NET_H_

View file

@ -9,8 +9,7 @@
**/
#ifndef _VIRTIO_SCSI_H_
#define _VIRTIO_SCSI_H_
#pragma once
#include <IndustryStandard/Virtio.h>
@ -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_

View file

@ -7,8 +7,7 @@
**/
#ifndef _VIRTIO_SERIAL_H_
#define _VIRTIO_SERIAL_H_
#pragma once
#include <IndustryStandard/Virtio095.h>
#include <IndustryStandard/Virtio10.h>
@ -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_ */

View file

@ -4,8 +4,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef ACPI_PLATFORM_LIB_H_
#define ACPI_PLATFORM_LIB_H_
#pragma once
#include <Protocol/AcpiTable.h>
#include <Protocol/PciIo.h>
@ -101,5 +100,3 @@ EFI_STATUS
TransferS3ContextToBootScript (
IN S3_CONTEXT *S3Context
);
#endif

View file

@ -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_ */

View file

@ -10,8 +10,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef BLOB_VERIFIER_LIB_H_
#define BLOB_VERIFIER_LIB_H_
#pragma once
#include <Uefi/UefiBaseType.h>
#include <Base.h>
@ -37,5 +36,3 @@ VerifyBlob (
IN UINT32 BufSize,
IN EFI_STATUS FetchStatus
);
#endif

View file

@ -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 <Base.h>
@ -79,5 +78,3 @@ FdtSerialGetConsolePort (
IN CONST VOID *DeviceTree,
OUT UINT64 *BaseAddress
);
#endif

View file

@ -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

View file

@ -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 <Uefi/UefiBaseType.h>
#include <Base.h>
@ -210,5 +209,3 @@ EFIAPI
MemDebugLogEnabled (
VOID
);
#endif // _MEM_DEBUG_LOG_LIB_H_

View file

@ -8,8 +8,7 @@
**/
#ifndef _MEM_ENCRYPT_SEV_LIB_H_
#define _MEM_ENCRYPT_SEV_LIB_H_
#pragma once
#include <Base.h>
#include <WorkArea.h>
@ -253,5 +252,3 @@ MemEncryptSevSnpPreValidateSystemRam (
IN PHYSICAL_ADDRESS BaseAddress,
IN UINTN NumPages
);
#endif // _MEM_ENCRYPT_SEV_LIB_H_

View file

@ -9,8 +9,7 @@
**/
#ifndef MEM_ENCRYPT_TDX_LIB_H_
#define MEM_ENCRYPT_TDX_LIB_H_
#pragma once
#include <Base.h>
@ -77,5 +76,3 @@ MemEncryptTdxClearPageSharedBit (
IN PHYSICAL_ADDRESS BaseAddress,
IN UINTN NumPages
);
#endif // _MEM_ENCRYPT_TDX_LIB_H_

View file

@ -10,8 +10,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __NESTED_INTERRUPT_TPL_LIB__
#define __NESTED_INTERRUPT_TPL_LIB__
#pragma once
#include <Uefi/UefiBaseType.h>
#include <Uefi/UefiSpec.h>
@ -83,5 +82,3 @@ NestedInterruptRestoreTPL (
IN OUT EFI_SYSTEM_CONTEXT SystemContext,
IN OUT NESTED_INTERRUPT_STATE *IsrState
);
#endif // __NESTED_INTERRUPT_TPL_LIB__

View file

@ -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

View file

@ -9,8 +9,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __PCI_CAP_LIB_H__
#define __PCI_CAP_LIB_H__
#pragma once
#include <Uefi/UefiBaseType.h>
@ -412,5 +411,3 @@ PciCapWrite (
IN VOID *SourceBuffer,
IN UINT16 Size
);
#endif // __PCI_CAP_LIB_H__

View file

@ -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 <Protocol/PciIo.h>
@ -46,5 +45,3 @@ EFIAPI
PciCapPciIoDeviceUninit (
IN PCI_CAP_DEV *PciDevice
);
#endif // __PCI_CAP_PCI_IO_LIB_H__

View file

@ -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 <Library/PciCapLib.h>
@ -70,5 +69,3 @@ EFIAPI
PciCapPciSegmentDeviceUninit (
IN PCI_CAP_DEV *PciDevice
);
#endif // __PCI_CAP_PCI_SEGMENT_LIB_H__

View file

@ -10,8 +10,7 @@
**/
#ifndef __PCI_HOST_BRIDGE_UTILITY_LIB_H__
#define __PCI_HOST_BRIDGE_UTILITY_LIB_H__
#pragma once
#include <Library/PciHostBridgeLib.h>
@ -174,5 +173,3 @@ EFIAPI
PciHostBridgeUtilityResourceConflict (
IN VOID *Configuration
);
#endif // __PCI_HOST_BRIDGE_UTILITY_LIB_H__

View file

@ -6,8 +6,7 @@
**/
#ifndef PEILESS_STARTUP_LIB_H_
#define PEILESS_STARTUP_LIB_H_
#pragma once
#include <Library/BaseLib.h>
#include <Uefi/UefiBaseType.h>
@ -30,5 +29,3 @@ EFIAPI
PeilessStartup (
IN VOID *Context
);
#endif

View file

@ -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 <Uefi/UefiBaseType.h>
@ -31,5 +30,3 @@ EFIAPI
PlatformBmPrintScRegisterHandler (
VOID
);
#endif // __PLATFORM_BM_PRINT_SC_LIB__

View file

@ -6,8 +6,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __PLATFORMBOOTMANAGERCOMMON_LIB_H__
#define __PLATFORMBOOTMANAGERCOMMON_LIB_H__
#pragma once
#include <Uefi/UefiBaseType.h>
#include <Base.h>
@ -24,5 +23,3 @@ VOID
RemoveStaleFvFileOptions (
VOID
);
#endif

View file

@ -7,8 +7,7 @@
**/
#ifndef __PLATFORM_FVB_LIB__
#define __PLATFORM_FVB_LIB__
#pragma once
#include <Protocol/FirmwareVolumeBlock.h>
@ -73,5 +72,3 @@ PlatformFvbBlocksErased (
IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
IN VA_LIST List
);
#endif

View file

@ -6,8 +6,7 @@
**/
#ifndef PLATFORM_INIT_LIB_H_
#define PLATFORM_INIT_LIB_H_
#pragma once
#include <PiPei.h>
#include <IndustryStandard/E820.h>
@ -326,5 +325,3 @@ EFIAPI
PlatformIgvmParamReserve (
VOID
);
#endif // PLATFORM_INIT_LIB_H_

View file

@ -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 <Uefi/UefiBaseType.h>
#include <Base.h>
@ -106,5 +105,3 @@ EFIAPI
GetFrontPageTimeoutFromQemu (
VOID
);
#endif

View file

@ -8,8 +8,7 @@
**/
#ifndef __FW_CFG_LIB__
#define __FW_CFG_LIB__
#pragma once
#include <IndustryStandard/QemuFwCfg.h>
#include <Library/PlatformInitLib.h>
@ -183,5 +182,3 @@ EFIAPI
QemuFwCfgInitCache (
IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
);
#endif

View file

@ -10,8 +10,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __FW_CFG_S3_LIB__
#define __FW_CFG_S3_LIB__
#pragma once
#include <Base.h>
@ -345,5 +344,3 @@ QemuFwCfgS3ScriptCheckValue (
IN UINT64 ValueMask,
IN UINT64 Value
);
#endif

View file

@ -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 <Base.h>
@ -124,5 +123,3 @@ QemuFwCfgParseUintn (
IN BOOLEAN ParseAsHex,
OUT UINTN *Value
);
#endif // QEMU_FW_CFG_SIMPLE_PARSER_LIB_H_

View file

@ -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 <Uefi/UefiBaseType.h>
#include <Base.h>
@ -80,5 +79,3 @@ EFIAPI
QemuUnloadKernelImage (
IN EFI_HANDLE ImageHandle
);
#endif

View file

@ -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

View file

@ -6,8 +6,7 @@
**/
#ifndef TDX_HELPER_LIB_H
#define TDX_HELPER_LIB_H
#pragma once
#include <PiPei.h>
@ -66,5 +65,3 @@ EFIAPI
TdxHelperBuildGuidHobForTdxMeasurement (
VOID
);
#endif

View file

@ -6,8 +6,7 @@
**/
#ifndef TDX_MAILBOX_LIB_H_
#define TDX_MAILBOX_LIB_H_
#pragma once
#include <Library/BaseLib.h>
#include <Uefi/UefiBaseType.h>
@ -72,5 +71,3 @@ EFIAPI
MpSerializeEnd (
VOID
);
#endif

View file

@ -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 */

View file

@ -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__ */

View file

@ -9,8 +9,7 @@
**/
#ifndef _VIRTIO_LIB_H_
#define _VIRTIO_LIB_H_
#pragma once
#include <Protocol/VirtioDevice.h>
@ -306,5 +305,3 @@ VirtioMapAllBytesInSharedBuffer (
OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
OUT VOID **Mapping
);
#endif // _VIRTIO_LIB_H_

View file

@ -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_

View file

@ -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

View file

@ -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

View file

@ -10,8 +10,7 @@
**/
#ifndef _XEN_PLATFORM_LIB_H_
#define _XEN_PLATFORM_LIB_H_
#pragma once
#include <Guid/XenInfo.h>
@ -49,5 +48,3 @@ EFIAPI
XenGetInfoHOB (
VOID
);
#endif

View file

@ -7,8 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __OVMF_PLATFORMS_H__
#define __OVMF_PLATFORMS_H__
#pragma once
#include <Library/PciLib.h>
#include <IndustryStandard/Pci22.h>
@ -39,5 +38,3 @@
// Common IO ports relative to the Power Management Base Address
//
#define ACPI_TIMER_OFFSET 0x8
#endif

View file

@ -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_

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -11,8 +11,7 @@
**/
#ifndef __VIRTIO_DEVICE_H__
#define __VIRTIO_DEVICE_H__
#pragma once
#include <IndustryStandard/Virtio.h>
@ -516,5 +515,3 @@ struct _VIRTIO_DEVICE_PROTOCOL {
};
extern EFI_GUID gVirtioDeviceProtocolGuid;
#endif

View file

@ -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

View file

@ -14,8 +14,7 @@
**/
#ifndef __PROTOCOL_XENIO_H__
#define __PROTOCOL_XENIO_H__
#pragma once
#include <IndustryStandard/Xen/xen.h>
@ -38,5 +37,3 @@ struct _XENIO_PROTOCOL {
};
extern EFI_GUID gXenIoProtocolGuid;
#endif

View file

@ -7,8 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __OVMF_WORK_AREA_H__
#define __OVMF_WORK_AREA_H__
#pragma once
#include <ConfidentialComputingGuestAttr.h>
#include <IndustryStandard/Tpm20.h>
@ -121,5 +120,3 @@ typedef union {
SEV_WORK_AREA SevWorkArea;
TDX_WORK_AREA TdxWorkArea;
} OVMF_WORK_AREA;
#endif

Some files were not shown because too many files have changed in this diff Show more