ia64/xen: domU xen machine vector without dma api.
arch/ia64/kernel/acpi.c acpi_get_sysname(void) · line 125
Quoted 13 lines · [email protected] wrote:
arch/ia64/kernel/acpi.c +4
-0@@ -118,6 +118,10 @@ acpi_get_sysname(void)return "hpzx1" ; }else if (!strcmp (hdr->oem_id,"SGI" )) {return "sn2" ; +#ifdef CONFIG_XEN + }else if (is_running_on_xen () && !strcmp (hdr->oem_id,"XEN" )) { +return "xen" ; +#endif }
Is the #ifdef necessary? Couldn't you make is_running_on_xen() just evaluate to 0 in the non-Xen case?
J
PATCH 20/28 ia64/xen: domU xen machine vector without dma api.
Signed-off-by Isaku Yamahata <[email protected]>
--- arch/ia64/kernel/acpi.c | 6 ++++++ arch/ia64/xen/machvec.c | 4 ++++ include/asm-ia64/machvec.h | 2 ++ include/asm-ia64/machvec_xen.h | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 arch/ia64/xen/machvec.c create mode 100644 include/asm-ia64/machvec_xen.h
arch/ia64/kernel/acpi.c +6 -0
@@ -118,6 +118,10 @@ acpi_get_sysname(void)return "hpzx1" ; }else if (!strcmp (hdr->oem_id,"SGI" )) {return "sn2" ; +#ifdef CONFIG_XEN + }else if (is_running_on_xen () && !strcmp (hdr->oem_id,"XEN" )) { +return "xen" ; +#endif }return "dig" ;
@@ -132,6 +136,8 @@ acpi_get_sysname(void)return "sn2" ;# elif defined (CONFIG_IA64_DIG )return "dig" ; +# elif defined (CONFIG_IA64_XEN ) +return "xen" ;# else # error Unknown platform. Fix acpi.c.# endif
arch/ia64/xen/machvec.c new file +4 -0
@@ -0,0 +1,4 @@ +#define MACHVEC_PLATFORM_NAME xen +#define MACHVEC_PLATFORM_HEADER <asm/machvec_xen.h> +#include <asm/machvec_init.h> +
include/asm-ia64/machvec.h +2 -0
@@ -120,6 +120,8 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);# include <asm/machvec_hpzx1_swiotlb.h> # elif defined (CONFIG_IA64_SGI_SN2 )# include <asm/machvec_sn2.h> +# elif defined (CONFIG_IA64_XEN ) +# include <asm/machvec_xen.h> # elif defined (CONFIG_IA64_GENERIC )# ifdef MACHVEC_PLATFORM_HEADER
include/asm-ia64/machvec_xen.h new file +22 -0
@@ -0,0 +1,22 @@ +#ifndef _ASM_IA64_MACHVEC_XEN_h +#define _ASM_IA64_MACHVEC_XEN_h + +extern ia64_mv_setup_t xen_setup; +extern ia64_mv_cpu_init_t xen_cpu_init; +extern ia64_mv_irq_init_t xen_irq_init; +extern ia64_mv_send_ipi_t xen_platform_send_ipi; + +/* +* This stuff has dual use! +* +* For a generic kernel, the macros are used to initialize the +* platform's machvec structure. When compiling a non-generic kernel, +* the macros are used directly. +*/ +#define platform_name "xen" +#define platform_setup xen_setup +#define platform_cpu_init xen_cpu_init +#define platform_irq_init xen_irq_init +#define platform_send_ipi xen_platform_send_ipi + +#endif /* _ASM_IA64_MACHVEC_XEN_h */
Signature · 1 line
1.5.3