ia64/xen-unstable

changeset 17889:220f3d62e272

[IA64] make acpi related files compilable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Wed Jun 11 18:45:13 2008 +0900 (2008-06-11)
parents 0ed5e1c8c778
children 8475d1b9a364
files xen/arch/ia64/linux-xen/Makefile xen/arch/ia64/linux-xen/acpi.c xen/arch/ia64/linux-xen/acpi_numa.c xen/arch/ia64/xen/Makefile xen/include/asm-ia64/linux-xen/asm/acpi.h xen/include/asm-ia64/linux-xen/asm/numa.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/Makefile	Wed Jun 11 15:39:41 2008 +0900
     1.2 +++ b/xen/arch/ia64/linux-xen/Makefile	Wed Jun 11 18:45:13 2008 +0900
     1.3 @@ -23,3 +23,5 @@ obj-y += numa.o
     1.4  obj-y += mm_numa.o
     1.5  obj-y += perfmon.o
     1.6  obj-y += perfmon_default_smpl.o
     1.7 +obj-y += acpi.o
     1.8 +obj-y += acpi_numa.o
     2.1 --- a/xen/arch/ia64/linux-xen/acpi.c	Wed Jun 11 15:39:41 2008 +0900
     2.2 +++ b/xen/arch/ia64/linux-xen/acpi.c	Wed Jun 11 18:45:13 2008 +0900
     2.3 @@ -51,8 +51,14 @@
     2.4  #include <asm/system.h>
     2.5  #include <asm/numa.h>
     2.6  #include <asm/sal.h>
     2.7 +#ifndef XEN
     2.8  #include <asm/cyclone.h>
     2.9  #include <asm/xen/hypervisor.h>
    2.10 +#else
    2.11 +#include <asm/hw_irq.h>
    2.12 +extern u8 numa_slit[MAX_NUMNODES * MAX_NUMNODES];
    2.13 +#endif
    2.14 +
    2.15  
    2.16  #define BAD_MADT_ENTRY(entry, end) (                                        \
    2.17  		(!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
    2.18 @@ -71,7 +77,11 @@ unsigned int acpi_cpei_phys_cpuid;
    2.19  unsigned long acpi_wakeup_address = 0;
    2.20  
    2.21  #ifdef CONFIG_IA64_GENERIC
    2.22 +#ifndef XEN
    2.23  static unsigned long __init acpi_find_rsdp(void)
    2.24 +#else
    2.25 +unsigned long __init acpi_find_rsdp(void)
    2.26 +#endif
    2.27  {
    2.28  	unsigned long rsdp_phys = 0;
    2.29  
    2.30 @@ -122,8 +132,10 @@ acpi_get_sysname(void)
    2.31  			return "uv";
    2.32  		else
    2.33  			return "sn2";
    2.34 +#ifndef XEN
    2.35  	} else if (is_running_on_xen() && !strcmp(hdr->oem_id, "XEN")) {
    2.36  		return "xen";
    2.37 +#endif
    2.38  	}
    2.39  
    2.40  	return "dig";
    2.41 @@ -300,6 +312,11 @@ acpi_parse_plat_int_src(struct acpi_subt
    2.42  }
    2.43  
    2.44  #ifdef CONFIG_HOTPLUG_CPU
    2.45 +
    2.46 +#ifdef XEN
    2.47 +unsigned int force_cpei_retarget = 0;
    2.48 +#endif
    2.49 +
    2.50  unsigned int can_cpei_retarget(void)
    2.51  {
    2.52  	extern int cpe_vector;
    2.53 @@ -388,7 +405,9 @@ static void __init acpi_madt_oem_check(c
    2.54  		 */
    2.55  		sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT;
    2.56  
    2.57 +#ifndef XEN
    2.58  		cyclone_setup();
    2.59 +#endif
    2.60  	}
    2.61  }
    2.62  
    2.63 @@ -476,9 +495,17 @@ void __init acpi_numa_slit_init(struct a
    2.64  	slit_table = slit;
    2.65  }
    2.66  
    2.67 +#ifndef XEN
    2.68  void __init
    2.69  acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
    2.70 +#else
    2.71 +void __init
    2.72 +acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa__)
    2.73 +#endif
    2.74  {
    2.75 +#ifdef XEN
    2.76 +	struct acpi_srat_cpu_affinity *pa = (struct acpi_srat_cpu_affinity *)pa__;
    2.77 +#endif
    2.78  	int pxm;
    2.79  
    2.80  	if (!(pa->flags & ACPI_SRAT_CPU_ENABLED))
    2.81 @@ -497,9 +524,18 @@ acpi_numa_processor_affinity_init(struct
    2.82  	srat_num_cpus++;
    2.83  }
    2.84  
    2.85 +#ifndef XEN
    2.86  void __init
    2.87  acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
    2.88 +#else
    2.89 +void __init
    2.90 +acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma__)
    2.91 +#endif
    2.92  {
    2.93 +#ifdef XEN
    2.94 +	struct acpi_srat_mem_affinity *ma =
    2.95 +		(struct acpi_srat_mem_affinity *)ma__;
    2.96 +#endif
    2.97  	unsigned long paddr, size;
    2.98  	int pxm;
    2.99  	struct node_memblk_s *p, *q, *pend;
   2.100 @@ -606,6 +642,7 @@ void __init acpi_numa_arch_fixup(void)
   2.101  }
   2.102  #endif				/* CONFIG_ACPI_NUMA */
   2.103  
   2.104 +#ifndef XEN
   2.105  /*
   2.106   * success: return IRQ number (>=0)
   2.107   * failure: return < 0
   2.108 @@ -637,6 +674,7 @@ void acpi_unregister_gsi(u32 gsi)
   2.109  
   2.110  	iosapic_unregister_intr(gsi);
   2.111  }
   2.112 +#endif
   2.113  
   2.114  static int __init acpi_parse_fadt(struct acpi_table_header *table)
   2.115  {
   2.116 @@ -652,7 +690,9 @@ static int __init acpi_parse_fadt(struct
   2.117  
   2.118  	fadt = (struct acpi_table_fadt *)fadt_header;
   2.119  
   2.120 +#ifndef XEN
   2.121  	acpi_register_gsi(fadt->sci_interrupt, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
   2.122 +#endif
   2.123  	return 0;
   2.124  }
   2.125  
   2.126 @@ -848,6 +888,7 @@ early_param("additional_cpus", setup_add
   2.127  		cpu_set(i, cpu_possible_map);
   2.128  }
   2.129  
   2.130 +#ifndef XEN
   2.131  int acpi_map_lsapic(acpi_handle handle, int *pcpu)
   2.132  {
   2.133  	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
   2.134 @@ -913,8 +954,10 @@ int acpi_unmap_lsapic(int cpu)
   2.135  }
   2.136  
   2.137  EXPORT_SYMBOL(acpi_unmap_lsapic);
   2.138 +#endif /* XEN */
   2.139  #endif				/* CONFIG_ACPI_HOTPLUG_CPU */
   2.140  
   2.141 +#ifndef XEN
   2.142  #ifdef CONFIG_ACPI_NUMA
   2.143  static acpi_status __devinit
   2.144  acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
   2.145 @@ -1001,6 +1044,7 @@ int acpi_unregister_ioapic(acpi_handle h
   2.146  }
   2.147  
   2.148  EXPORT_SYMBOL(acpi_unregister_ioapic);
   2.149 +#endif /* XEN */
   2.150  
   2.151  /*
   2.152   * acpi_save_state_mem() - save kernel state
     3.1 --- a/xen/arch/ia64/linux-xen/acpi_numa.c	Wed Jun 11 15:39:41 2008 +0900
     3.2 +++ b/xen/arch/ia64/linux-xen/acpi_numa.c	Wed Jun 11 18:45:13 2008 +0900
     3.3 @@ -31,11 +31,23 @@
     3.4  #include <acpi/acpi_bus.h>
     3.5  #include <acpi/acmacros.h>
     3.6  
     3.7 +#ifndef XEN
     3.8  #define ACPI_NUMA	0x80000000
     3.9  #define _COMPONENT	ACPI_NUMA
    3.10  ACPI_MODULE_NAME("numa");
    3.11 +#else
    3.12 +#define NID_INVAL	-1
    3.13 +#define PXM_INVAL	-1
    3.14 +#endif
    3.15  
    3.16 +#ifndef XEN
    3.17  static nodemask_t nodes_found_map = NODE_MASK_NONE;
    3.18 +#else
    3.19 +/* the above causes error: initializer element is not constant
    3.20 + * anyway NODE_MASK_NONE is 0 filled array.
    3.21 + */
    3.22 +static nodemask_t nodes_found_map;
    3.23 +#endif
    3.24  
    3.25  /* maps to convert between proximity domain and logical node ID */
    3.26  static int pxm_to_node_map[MAX_PXM_DOMAINS]
    3.27 @@ -78,6 +90,7 @@ int acpi_map_pxm_to_node(int pxm)
    3.28  	return node;
    3.29  }
    3.30  
    3.31 +#ifndef XEN
    3.32  #if 0
    3.33  void __cpuinit acpi_unmap_pxm_to_node(int node)
    3.34  {
    3.35 @@ -261,3 +274,4 @@ int acpi_get_node(acpi_handle *handle)
    3.36  	return node;
    3.37  }
    3.38  EXPORT_SYMBOL(acpi_get_node);
    3.39 +#endif /* XEN */
     4.1 --- a/xen/arch/ia64/xen/Makefile	Wed Jun 11 15:39:41 2008 +0900
     4.2 +++ b/xen/arch/ia64/xen/Makefile	Wed Jun 11 18:45:13 2008 +0900
     4.3 @@ -3,7 +3,6 @@ subdir-y += oprofile
     4.4  obj-y += relocate_kernel.o
     4.5  obj-y += machine_kexec.o
     4.6  obj-y += crash.o
     4.7 -obj-y += acpi.o
     4.8  obj-y += dom0_ops.o
     4.9  obj-y += domain.o
    4.10  obj-y += dom_fw_asm.o
     5.1 --- a/xen/include/asm-ia64/linux-xen/asm/acpi.h	Wed Jun 11 15:39:41 2008 +0900
     5.2 +++ b/xen/include/asm-ia64/linux-xen/asm/acpi.h	Wed Jun 11 18:45:13 2008 +0900
     5.3 @@ -36,6 +36,9 @@
     5.4  #include <linux/numa.h>
     5.5  #include <asm/system.h>
     5.6  #include <asm/numa.h>
     5.7 +#ifdef XEN
     5.8 +#include <xen/nodemask.h>
     5.9 +#endif
    5.10  
    5.11  #define COMPILER_DEPENDENT_INT64	long
    5.12  #define COMPILER_DEPENDENT_UINT64	unsigned long
     6.1 --- a/xen/include/asm-ia64/linux-xen/asm/numa.h	Wed Jun 11 15:39:41 2008 +0900
     6.2 +++ b/xen/include/asm-ia64/linux-xen/asm/numa.h	Wed Jun 11 18:45:13 2008 +0900
     6.3 @@ -89,6 +89,8 @@ extern int paddr_to_nid(unsigned long pa
     6.4  #define phys_to_nid(paddr) paddr_to_nid(paddr)
     6.5  extern int pxm_to_node(int pxm);
     6.6  extern int node_to_pxm(int node);
     6.7 +extern void __acpi_map_pxm_to_node(int, int);
     6.8 +extern int acpi_map_pxm_to_node(int);
     6.9  #endif
    6.10  
    6.11  #endif /* _ASM_IA64_NUMA_H */