[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-ia64-devel] [patch] provide node_to_pxm and pxm_to_node functions
Hi, This patch provides node_to_pxm and pxm_to_node functions which are needed on SN2 to build our node tables. Cheers, Jes # HG changeset patch # User jes@xxxxxxxxxxxxxxxx # Date 1181640652 -7200 # Node ID 08cea2883d9e48b3f5424bac618f1216a71760fd # Parent 0aad59150773cffc6a9328e0527f672d8144e77f Provide pxm_to_node and node_to_pxm translation functions required for NUMA node table setup on sn2. Signed-off-by: Jes Sorensen <jes@xxxxxxx> diff -r 0aad59150773 -r 08cea2883d9e xen/arch/ia64/linux-xen/sn/kernel/setup.c --- a/xen/arch/ia64/linux-xen/sn/kernel/setup.c Tue Jun 05 09:15:39 2007 +0200 +++ b/xen/arch/ia64/linux-xen/sn/kernel/setup.c Tue Jun 12 11:30:52 2007 +0200 @@ -72,11 +72,6 @@ #include <asm/sn/klconfig.h> #ifdef XEN #include <asm/sn/shubio.h> - -/* Xen has no clue about NUMA .... grrrr */ -#define pxm_to_node(foo) 0 -#define node_to_pxm(foo) 0 -#define numa_node_id() 0 #endif diff -r 0aad59150773 -r 08cea2883d9e xen/arch/ia64/xen/acpi.c --- a/xen/arch/ia64/xen/acpi.c Tue Jun 05 09:15:39 2007 +0200 +++ b/xen/arch/ia64/xen/acpi.c Tue Jun 12 11:30:52 2007 +0200 @@ -388,6 +388,24 @@ int __initdata nid_to_pxm_map[MAX_NUMNOD int __initdata nid_to_pxm_map[MAX_NUMNODES]; static struct acpi_table_slit __initdata *slit_table; +#define NID_INVAL -1 +#define PXM_INVAL -1 + +int __init pxm_to_node(int pxm) +{ + if (pxm < 0) + return NID_INVAL; + return pxm_to_nid_map[pxm]; +} + +int __init node_to_pxm(int node) +{ + if (node < 0) + return PXM_INVAL; + return nid_to_pxm_map[node]; +} + + /* * ACPI 2.0 SLIT (System Locality Information Table) * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf @@ -473,8 +491,8 @@ acpi_numa_arch_fixup (void) /* calculate total number of nodes in system from PXM bitmap */ numnodes = 0; /* init total nodes in system */ - memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map)); - memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map)); + memset(pxm_to_nid_map, PXM_INVAL, sizeof(pxm_to_nid_map)); + memset(nid_to_pxm_map, NID_INVAL, sizeof(nid_to_pxm_map)); for (i = 0; i < MAX_PXM_DOMAINS; i++) { if (pxm_bit_test(i)) { pxm_to_nid_map[i] = numnodes; diff -r 0aad59150773 -r 08cea2883d9e xen/include/asm-ia64/linux-xen/asm/numa.h --- a/xen/include/asm-ia64/linux-xen/asm/numa.h Tue Jun 05 09:15:39 2007 +0200 +++ b/xen/include/asm-ia64/linux-xen/asm/numa.h Tue Jun 12 11:30:52 2007 +0200 @@ -75,6 +75,8 @@ extern int paddr_to_nid(unsigned long pa #ifdef XEN #define phys_to_nid(paddr) paddr_to_nid(paddr) +extern int pxm_to_node(int pxm); +extern int node_to_pxm(int node); #endif #endif /* _ASM_IA64_NUMA_H */ _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ia64-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |