hw/xen/arch_hvm: Unify x86 and ARM variants
PATCH 1/1 hw/xen/arch_hvm: Unify x86 and ARM variants
As each target declares the same prototypes, we can use a single header, removing the TARGET_XXX uses.
--- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 14 ++++++++++---- hw/arm/xen-pvh.c | 1 - 4 files changed, 10 insertions(+), 25 deletions(-) delete mode 100644 include/hw/arm/xen_arch_hvm.h delete mode 100644 include/hw/i386/xen_arch_hvm.h
include/hw/arm/xen_arch_hvm.h deleted +0 -9
@@ -1,9 +0,0 @@ -#ifndef HW_XEN_ARCH_ARM_HVM_H -#define HW_XEN_ARCH_ARM_HVM_H - -#include <xen/hvm/ioreq.h> -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif
include/hw/i386/xen_arch_hvm.h deleted +0 -11
@@ -1,11 +0,0 @@ -#ifndef HW_XEN_ARCH_I386_HVM_H -#define HW_XEN_ARCH_I386_HVM_H - -#include <xen/hvm/ioreq.h> -#include "hw/xen/xen-hvm-common.h" - -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif
include/hw/xen/arch_hvm.h +10 -4
@@ -1,5 +1,11 @@ -#if defined(TARGET_I386 ) || defined(TARGET_X86_64 ) -#include "hw/i386/xen_arch_hvm.h" -#elif defined(TARGET_ARM ) || defined(TARGET_AARCH64 ) -#include "hw/arm/xen_arch_hvm.h" +#ifndef HW_XEN_ARCH_HVM_H +#define HW_XEN_ARCH_HVM_H + +#include <xen/hvm/ioreq.h> +#include "hw/xen/xen-hvm-common.h" + +void arch_handle_ioreq (XenIOState *state,ioreq_t *req); +void arch_xen_set_memory (XenIOState *state, +MemoryRegionSection *section, +bool add);#endif
hw/arm/xen-pvh.c +0 -1
@@ -10,7 +10,6 @@#include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")
Signature · 1 line
2.47.1
Quoted 70 lines · Philippe Mathieu-Daudé
As each target declares the same prototypes, we can use a single header, removing the
TARGET_XXXuses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 14 ++++++++++---- hw/arm/xen-pvh.c | 1 - 4 files changed, 10 insertions(+), 25 deletions(-)delete mode 100644
include/hw/arm/xen_arch_hvm.hdelete mode 100644include/hw/i386/xen_arch_hvm.hinclude/hw/arm/xen_arch_hvm.h deleted +0
-9@@ -1,9 +0,0 @@ -#ifndef HW_XEN_ARCH_ARM_HVM_H -#define HW_XEN_ARCH_ARM_HVM_H - -#include <xen/hvm/ioreq.h> -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif include/hw/i386/xen_arch_hvm.h deleted +0
-11@@ -1,11 +0,0 @@ -#ifndef HW_XEN_ARCH_I386_HVM_H -#define HW_XEN_ARCH_I386_HVM_H - -#include <xen/hvm/ioreq.h> -#include "hw/xen/xen-hvm-common.h" - -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif include/hw/xen/arch_hvm.h +10
-4@@ -1,5 +1,11 @@ -#if defined(TARGET_I386 ) || defined(TARGET_X86_64 ) -#include "hw/i386/xen_arch_hvm.h" -#elif defined(TARGET_ARM ) || defined(TARGET_AARCH64 ) -#include "hw/arm/xen_arch_hvm.h" +#ifndef HW_XEN_ARCH_HVM_H +#define HW_XEN_ARCH_HVM_H + +#include <xen/hvm/ioreq.h> +#include "hw/xen/xen-hvm-common.h" + +void arch_handle_ioreq (XenIOState *state,ioreq_t *req); +void arch_xen_set_memory (XenIOState *state, +MemoryRegionSection *section, +bool add);#endif hw/arm/xen-pvh.c +0
-0
hw/arm/xen-pvh.c line 15
Quoted 7 lines
hw/arm/xen-pvh.c +0
-1@@ -10,7 +10,6 @@#include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")
Quoted 4 lines · Philippe Mathieu-Daudé
As each target declares the same prototypes, we can use a single header, removing the
TARGET_XXXuses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 76 lines
--- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 14 ++++++++++---- hw/arm/xen-pvh.c | 1 - 4 files changed, 10 insertions(+), 25 deletions(-) delete mode 100644 include/hw/arm/xen_arch_hvm.h delete mode 100644 include/hw/i386/xen_arch_hvm.hinclude/hw/arm/xen_arch_hvm.h deleted +0
-9@@ -1,9 +0,0 @@ -#ifndef HW_XEN_ARCH_ARM_HVM_H -#define HW_XEN_ARCH_ARM_HVM_H - -#include <xen/hvm/ioreq.h> -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif include/hw/i386/xen_arch_hvm.h deleted +0
-11@@ -1,11 +0,0 @@ -#ifndef HW_XEN_ARCH_I386_HVM_H -#define HW_XEN_ARCH_I386_HVM_H - -#include <xen/hvm/ioreq.h> -#include "hw/xen/xen-hvm-common.h" - -void arch_handle_ioreq (XenIOState *state,ioreq_t *req); -void arch_xen_set_memory (XenIOState *state, -MemoryRegionSection *section, -bool add); -#endif include/hw/xen/arch_hvm.h +10
-4@@ -1,5 +1,11 @@ -#if defined(TARGET_I386 ) || defined(TARGET_X86_64 ) -#include "hw/i386/xen_arch_hvm.h" -#elif defined(TARGET_ARM ) || defined(TARGET_AARCH64 ) -#include "hw/arm/xen_arch_hvm.h" +#ifndef HW_XEN_ARCH_HVM_H +#define HW_XEN_ARCH_HVM_H + +#include <xen/hvm/ioreq.h> +#include "hw/xen/xen-hvm-common.h" + +void arch_handle_ioreq (XenIOState *state,ioreq_t *req); +void arch_xen_set_memory (XenIOState *state, +MemoryRegionSection *section, +bool add);#endif hw/arm/xen-pvh.c +0
-1@@ -10,7 +10,6 @@#include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")Signature · 1 line
2.47.1
Quoted 4 lines · Philippe Mathieu-Daudé
As each target declares the same prototypes, we can use a single header, removing the
TARGET_XXXuses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
...
hw/arm/xen-pvh.c line 15
Quoted 12 lines
hw/arm/xen-pvh.c +0
-1@@ -10,7 +10,6 @@#include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")
This chunk seems unrelated.
Quoted 6 lines · Xiaoyao Li
Quoted 4 lines · Philippe Mathieu-Daudé
As each target declares the same prototypes, we can use a single header, removing the
TARGET_XXXuses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>...
Quoted 12 lines
hw/arm/xen-pvh.c line 13
Quoted 10 lines
hw/arm/xen-pvh.c +0
-1@@ -10,7 +10,6 @@ #include "hw/boards.h" #include "system/system.h" #include "hw/xen/xen-pvh-common.h" -#include "hw/xen/arch_hvm.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh")This chunk seems unrelated.
I'll split in 2 patches, thanks.
Philippe Mathieu-Daudé
AppliedQuoted 4 lines · Philippe Mathieu-Daudé
As each target declares the same prototypes, we can use a single header, removing the
TARGET_XXXuses.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 8 lines
--- include/hw/arm/xen_arch_hvm.h | 9 --------- include/hw/i386/xen_arch_hvm.h | 11 ----------- include/hw/xen/arch_hvm.h | 14 ++++++++++---- hw/arm/xen-pvh.c | 1 - 4 files changed, 10 insertions(+), 25 deletions(-)delete mode 100644
include/hw/arm/xen_arch_hvm.hdelete mode 100644include/hw/i386/xen_arch_hvm.h
Queued, thanks.