ia64/xen-unstable

changeset 15326:f5d22922444d

[IA64] Provide pxm_to_node and node_to_pxm translation functions

Required for NUMA node table setup on sn2.

Signed-off-by: Jes Sorensen <jes@sgi.com>
author Alex Williamson <alex.williamson@hp.com>
date Tue Jun 12 15:22:02 2007 -0600 (2007-06-12)
parents 855fe0bf6590
children 67f6dd9f1a1b
files xen/arch/ia64/linux-xen/sn/kernel/setup.c xen/arch/ia64/xen/acpi.c xen/include/asm-ia64/linux-xen/asm/numa.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/sn/kernel/setup.c	Tue Jun 12 15:20:06 2007 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/sn/kernel/setup.c	Tue Jun 12 15:22:02 2007 -0600
     1.3 @@ -72,11 +72,6 @@
     1.4  #include <asm/sn/klconfig.h>
     1.5  #ifdef XEN
     1.6  #include <asm/sn/shubio.h>
     1.7 -
     1.8 -/* Xen has no clue about NUMA ....  grrrr */
     1.9 -#define pxm_to_node(foo)		0
    1.10 -#define node_to_pxm(foo)		0
    1.11 -#define numa_node_id()			0
    1.12  #endif
    1.13  
    1.14  
     2.1 --- a/xen/arch/ia64/xen/acpi.c	Tue Jun 12 15:20:06 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/acpi.c	Tue Jun 12 15:22:02 2007 -0600
     2.3 @@ -388,6 +388,24 @@ int __initdata pxm_to_nid_map[MAX_PXM_DO
     2.4  int __initdata nid_to_pxm_map[MAX_NUMNODES];
     2.5  static struct acpi_table_slit __initdata *slit_table;
     2.6  
     2.7 +#define NID_INVAL			-1
     2.8 +#define PXM_INVAL			-1
     2.9 +
    2.10 +int __init pxm_to_node(int pxm)
    2.11 +{
    2.12 +	if (pxm < 0)
    2.13 +		return NID_INVAL;
    2.14 +	return pxm_to_nid_map[pxm];
    2.15 +}
    2.16 +
    2.17 +int __init node_to_pxm(int node)
    2.18 +{
    2.19 +	if (node < 0)
    2.20 +		return PXM_INVAL;
    2.21 +	return nid_to_pxm_map[node];
    2.22 +}
    2.23 +
    2.24 +
    2.25  /*
    2.26   * ACPI 2.0 SLIT (System Locality Information Table)
    2.27   * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
    2.28 @@ -473,8 +491,8 @@ acpi_numa_arch_fixup (void)
    2.29  	/* calculate total number of nodes in system from PXM bitmap */
    2.30  	numnodes = 0;		/* init total nodes in system */
    2.31  
    2.32 -	memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));
    2.33 -	memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));
    2.34 +	memset(pxm_to_nid_map, PXM_INVAL, sizeof(pxm_to_nid_map));
    2.35 +	memset(nid_to_pxm_map, NID_INVAL, sizeof(nid_to_pxm_map));
    2.36  	for (i = 0; i < MAX_PXM_DOMAINS; i++) {
    2.37  		if (pxm_bit_test(i)) {
    2.38  			pxm_to_nid_map[i] = numnodes;
     3.1 --- a/xen/include/asm-ia64/linux-xen/asm/numa.h	Tue Jun 12 15:20:06 2007 -0600
     3.2 +++ b/xen/include/asm-ia64/linux-xen/asm/numa.h	Tue Jun 12 15:22:02 2007 -0600
     3.3 @@ -75,6 +75,8 @@ extern int paddr_to_nid(unsigned long pa
     3.4  
     3.5  #ifdef XEN
     3.6  #define phys_to_nid(paddr) paddr_to_nid(paddr)
     3.7 +extern int pxm_to_node(int pxm);
     3.8 +extern int node_to_pxm(int node);
     3.9  #endif
    3.10  
    3.11  #endif /* _ASM_IA64_NUMA_H */