[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] Provide pxm_to_node and node_to_pxm translation functions
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1181683322 21600 # Node ID f5d22922444db066d1cd269638ddb04f6604e4fd # Parent 855fe0bf6590bf8dc4c1080bf22adcd04a8fbe2e [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@xxxxxxx> --- xen/arch/ia64/linux-xen/sn/kernel/setup.c | 5 ----- xen/arch/ia64/xen/acpi.c | 22 ++++++++++++++++++++-- xen/include/asm-ia64/linux-xen/asm/numa.h | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-) diff -r 855fe0bf6590 -r f5d22922444d xen/arch/ia64/linux-xen/sn/kernel/setup.c --- a/xen/arch/ia64/linux-xen/sn/kernel/setup.c Tue Jun 12 15:20:06 2007 -0600 +++ b/xen/arch/ia64/linux-xen/sn/kernel/setup.c Tue Jun 12 15:22:02 2007 -0600 @@ -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 855fe0bf6590 -r f5d22922444d xen/arch/ia64/xen/acpi.c --- a/xen/arch/ia64/xen/acpi.c Tue Jun 12 15:20:06 2007 -0600 +++ b/xen/arch/ia64/xen/acpi.c Tue Jun 12 15:22:02 2007 -0600 @@ -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 855fe0bf6590 -r f5d22922444d xen/include/asm-ia64/linux-xen/asm/numa.h --- a/xen/include/asm-ia64/linux-xen/asm/numa.h Tue Jun 12 15:20:06 2007 -0600 +++ b/xen/include/asm-ia64/linux-xen/asm/numa.h Tue Jun 12 15:22:02 2007 -0600 @@ -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-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |