src/cpu: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-06-07 15:20:22 -05:00 committed by Ján Tomko
parent 222e0f0f08
commit b7779b2938
8 changed files with 48 additions and 74 deletions

View File

@ -18,16 +18,15 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_H
# define LIBVIRT_CPU_H
#pragma once
# include "virerror.h"
# include "datatypes.h"
# include "virarch.h"
# include "domain_capabilities.h"
# include "cpu_conf.h"
# include "cpu_x86_data.h"
# include "cpu_ppc64_data.h"
#include "virerror.h"
#include "datatypes.h"
#include "virarch.h"
#include "domain_capabilities.h"
#include "cpu_conf.h"
#include "cpu_x86_data.h"
#include "cpu_ppc64_data.h"
typedef struct _virCPUData virCPUData;
@ -264,5 +263,3 @@ char *virCPUDataFormat(const virCPUData *data)
ATTRIBUTE_NONNULL(1);
virCPUDataPtr virCPUDataParse(const char *xmlStr)
ATTRIBUTE_NONNULL(1);
#endif /* LIBVIRT_CPU_H */

View File

@ -18,11 +18,8 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_ARM_H
# define LIBVIRT_CPU_ARM_H
#pragma once
# include "cpu.h"
#include "cpu.h"
extern struct cpuArchDriver cpuDriverArm;
#endif /* LIBVIRT_CPU_ARM_H */

View File

@ -18,10 +18,9 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_MAP_H
# define LIBVIRT_CPU_MAP_H
#pragma once
# include "virxml.h"
#include "virxml.h"
typedef int
(*cpuMapLoadCallback) (xmlXPathContextPtr ctxt,
@ -34,5 +33,3 @@ cpuMapLoad(const char *arch,
cpuMapLoadCallback featureCB,
cpuMapLoadCallback modelCB,
void *data);
#endif /* LIBVIRT_CPU_MAP_H */

View File

@ -18,11 +18,8 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_PPC64_H
# define LIBVIRT_CPU_PPC64_H
#pragma once
# include "cpu.h"
#include "cpu.h"
extern struct cpuArchDriver cpuDriverPPC64;
#endif /* LIBVIRT_CPU_PPC64_H */

View File

@ -18,9 +18,7 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_PPC64_DATA_H
# define LIBVIRT_CPU_PPC64_DATA_H
#pragma once
typedef struct _virCPUppc64PVR virCPUppc64PVR;
struct _virCPUppc64PVR {
@ -28,12 +26,10 @@ struct _virCPUppc64PVR {
uint32_t mask;
};
# define VIR_CPU_PPC64_DATA_INIT { 0 }
#define VIR_CPU_PPC64_DATA_INIT { 0 }
typedef struct _virCPUppc64Data virCPUppc64Data;
struct _virCPUppc64Data {
size_t len;
virCPUppc64PVR *pvr;
};
#endif /* LIBVIRT_CPU_PPC64_DATA_H */

View File

@ -18,11 +18,8 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_S390_H
# define LIBVIRT_CPU_S390_H
#pragma once
# include "cpu.h"
#include "cpu.h"
extern struct cpuArchDriver cpuDriverS390;
#endif /* LIBVIRT_CPU_S390_H */

View File

@ -18,11 +18,10 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_X86_H
# define LIBVIRT_CPU_X86_H
#pragma once
# include "cpu.h"
# include "cpu_x86_data.h"
#include "cpu.h"
#include "cpu_x86_data.h"
extern struct cpuArchDriver cpuDriverX86;
@ -44,5 +43,3 @@ int virCPUx86DataSetVendor(virCPUDataPtr cpuData,
int virCPUx86DataAddFeature(virCPUDataPtr cpuData,
const char *name);
#endif /* LIBVIRT_CPU_X86_H */

View File

@ -18,9 +18,7 @@
* <http://www.gnu.org/licenses/>.
*/
#ifndef LIBVIRT_CPU_X86_DATA_H
# define LIBVIRT_CPU_X86_DATA_H
#pragma once
typedef struct _virCPUx86CPUID virCPUx86CPUID;
typedef virCPUx86CPUID *virCPUx86CPUIDPtr;
@ -41,41 +39,41 @@ struct _virCPUx86MSR {
uint32_t edx;
};
# define CPUX86_BASIC 0x0
# define CPUX86_KVM 0x40000000
# define CPUX86_EXTENDED 0x80000000
#define CPUX86_BASIC 0x0
#define CPUX86_KVM 0x40000000
#define CPUX86_EXTENDED 0x80000000
# define VIR_CPU_x86_KVM_CLOCKSOURCE "__kvm_clocksource"
# define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay"
# define VIR_CPU_x86_KVM_MMU_OP "__kvm_mmu_op"
# define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2"
# define VIR_CPU_x86_KVM_ASYNC_PF "__kvm_async_pf"
# define VIR_CPU_x86_KVM_STEAL_TIME "__kvm_steal_time"
# define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi"
# define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt"
# define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable"
#define VIR_CPU_x86_KVM_CLOCKSOURCE "__kvm_clocksource"
#define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay"
#define VIR_CPU_x86_KVM_MMU_OP "__kvm_mmu_op"
#define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2"
#define VIR_CPU_x86_KVM_ASYNC_PF "__kvm_async_pf"
#define VIR_CPU_x86_KVM_STEAL_TIME "__kvm_steal_time"
#define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi"
#define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt"
#define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable"
/*
* The following HyperV feature names suffixes must exactly match corresponding
* ones defined for virDomainHyperv in domain_conf.c.
* E.g "__kvm_runtime" -> "runtime", "__kvm_hv_spinlocks" -> "spinlocks" etc.
*/
# define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime"
# define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic"
# define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer"
# define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed"
# define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks"
# define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic"
# define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex"
# define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset"
# define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies"
# define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment"
# define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush"
# define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi"
# define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs"
#define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime"
#define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic"
#define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer"
#define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed"
#define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks"
#define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic"
#define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex"
#define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset"
#define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies"
#define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment"
#define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush"
#define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi"
#define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs"
# define VIR_CPU_X86_DATA_INIT { 0 }
#define VIR_CPU_X86_DATA_INIT { 0 }
typedef enum {
VIR_CPU_X86_DATA_NONE = 0,
@ -98,5 +96,3 @@ struct _virCPUx86Data {
size_t len;
virCPUx86DataItem *items;
};
#endif /* LIBVIRT_CPU_X86_DATA_H */