aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2005-03-21 21:41:00 -0500
committerTony Luck <tony.luck@intel.com>2005-05-03 15:07:46 -0400
commit2e34f07ff0c944399a6456e2d91cf0ca1d9a497c (patch)
treed09796e3f37d7cd809eceb5d931f1e2171a32f5b
parentce0a3956b32650e229b68964c4400bbdc5ad3ca1 (diff)
[PATCH] move cnodeid_to_nasid_table out of pda
Another step in the effort to eliminate the SN pda structure. This patch moves the cnodeid_to_nasid_table field out of the pda, making it a standalone per-cpu data item, and exports it so it can be accessed by kernel modules. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/sn/kernel/setup.c31
-rw-r--r--include/asm-ia64/sn/arch.h11
-rw-r--r--include/asm-ia64/sn/pda.h1
-rw-r--r--include/asm-ia64/sn/sn_cpuid.h7
4 files changed, 29 insertions, 21 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index d35f2a6f9c94..fea71ee891eb 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/config.h> 9#include <linux/config.h>
@@ -73,6 +73,9 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
73DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); 73DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
74EXPORT_PER_CPU_SYMBOL(__sn_hub_info); 74EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
75 75
76DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
77EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);
78
76partid_t sn_partid = -1; 79partid_t sn_partid = -1;
77EXPORT_SYMBOL(sn_partid); 80EXPORT_SYMBOL(sn_partid);
78char sn_system_serial_number_string[128]; 81char sn_system_serial_number_string[128];
@@ -373,11 +376,11 @@ static void __init sn_init_pdas(char **cmdline_p)
373{ 376{
374 cnodeid_t cnode; 377 cnodeid_t cnode;
375 378
376 memset(pda->cnodeid_to_nasid_table, -1, 379 memset(sn_cnodeid_to_nasid, -1,
377 sizeof(pda->cnodeid_to_nasid_table)); 380 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
378 for_each_online_node(cnode) 381 for_each_online_node(cnode)
379 pda->cnodeid_to_nasid_table[cnode] = 382 sn_cnodeid_to_nasid[cnode] =
380 pxm_to_nasid(nid_to_pxm_map[cnode]); 383 pxm_to_nasid(nid_to_pxm_map[cnode]);
381 384
382 numionodes = num_online_nodes(); 385 numionodes = num_online_nodes();
383 scan_for_ionodes(); 386 scan_for_ionodes();
@@ -486,15 +489,18 @@ void __init sn_cpu_init(void)
486 pda->idle_flag = 0; 489 pda->idle_flag = 0;
487 490
488 if (cpuid != 0) { 491 if (cpuid != 0) {
489 memcpy(pda->cnodeid_to_nasid_table, 492 /* copy cpu 0's sn_cnodeid_to_nasid table to this cpu's */
490 pdacpu(0)->cnodeid_to_nasid_table, 493 memcpy(sn_cnodeid_to_nasid,
491 sizeof(pda->cnodeid_to_nasid_table)); 494 (&per_cpu(__sn_cnodeid_to_nasid, 0)),
495 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
492 } 496 }
493 497
494 /* 498 /*
495 * Check for WARs. 499 * Check for WARs.
496 * Only needs to be done once, on BSP. 500 * Only needs to be done once, on BSP.
497 * Has to be done after loop above, because it uses pda.cnodeid_to_nasid_table[i]. 501 * Has to be done after loop above, because it uses this cpu's
502 * sn_cnodeid_to_nasid table which was just initialized if this
503 * isn't cpu 0.
498 * Has to be done before assignment below. 504 * Has to be done before assignment below.
499 */ 505 */
500 if (!wars_have_been_checked) { 506 if (!wars_have_been_checked) {
@@ -580,8 +586,7 @@ static void __init scan_for_ionodes(void)
580 brd = find_lboard_any(brd, KLTYPE_SNIA); 586 brd = find_lboard_any(brd, KLTYPE_SNIA);
581 587
582 while (brd) { 588 while (brd) {
583 pda->cnodeid_to_nasid_table[numionodes] = 589 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
584 brd->brd_nasid;
585 physical_node_map[brd->brd_nasid] = numionodes; 590 physical_node_map[brd->brd_nasid] = numionodes;
586 root_lboard[numionodes] = brd; 591 root_lboard[numionodes] = brd;
587 numionodes++; 592 numionodes++;
@@ -602,8 +607,7 @@ static void __init scan_for_ionodes(void)
602 root_lboard[nasid_to_cnodeid(nasid)], 607 root_lboard[nasid_to_cnodeid(nasid)],
603 KLTYPE_TIO); 608 KLTYPE_TIO);
604 while (brd) { 609 while (brd) {
605 pda->cnodeid_to_nasid_table[numionodes] = 610 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
606 brd->brd_nasid;
607 physical_node_map[brd->brd_nasid] = numionodes; 611 physical_node_map[brd->brd_nasid] = numionodes;
608 root_lboard[numionodes] = brd; 612 root_lboard[numionodes] = brd;
609 numionodes++; 613 numionodes++;
@@ -614,7 +618,6 @@ static void __init scan_for_ionodes(void)
614 brd = find_lboard_any(brd, KLTYPE_TIO); 618 brd = find_lboard_any(brd, KLTYPE_TIO);
615 } 619 }
616 } 620 }
617
618} 621}
619 622
620int 623int
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index 7c349f07916a..e6d9aa6bb561 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * SGI specific setup. 6 * SGI specific setup.
7 * 7 *
8 * Copyright (C) 1995-1997,1999,2001-2004 Silicon Graphics, Inc. All rights reserved. 8 * Copyright (C) 1995-1997,1999,2001-2005 Silicon Graphics, Inc. All rights reserved.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
10 */ 10 */
11#ifndef _ASM_IA64_SN_ARCH_H 11#ifndef _ASM_IA64_SN_ARCH_H
@@ -47,6 +47,15 @@ DECLARE_PER_CPU(struct sn_hub_info_s, __sn_hub_info);
47#define MAX_COMPACT_NODES 2048 47#define MAX_COMPACT_NODES 2048
48#define CPUS_PER_NODE 4 48#define CPUS_PER_NODE 4
49 49
50
51/*
52 * Compact node ID to nasid mappings kept in the per-cpu data areas of each
53 * cpu.
54 */
55DECLARE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
56#define sn_cnodeid_to_nasid (&__get_cpu_var(__sn_cnodeid_to_nasid[0]))
57
58
50extern void sn_flush_all_caches(long addr, long bytes); 59extern void sn_flush_all_caches(long addr, long bytes);
51 60
52#endif /* _ASM_IA64_SN_ARCH_H */ 61#endif /* _ASM_IA64_SN_ARCH_H */
diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h
index cd19f17bf91a..a5340cfe9bab 100644
--- a/include/asm-ia64/sn/pda.h
+++ b/include/asm-ia64/sn/pda.h
@@ -49,7 +49,6 @@ typedef struct pda_s {
49 49
50 unsigned long sn_soft_irr[4]; 50 unsigned long sn_soft_irr[4];
51 unsigned long sn_in_service_ivecs[4]; 51 unsigned long sn_in_service_ivecs[4];
52 short cnodeid_to_nasid_table[MAX_NUMNODES];
53 int sn_lb_int_war_ticks; 52 int sn_lb_int_war_ticks;
54 int sn_last_irq; 53 int sn_last_irq;
55 int sn_first_irq; 54 int sn_first_irq;
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index 685435af170d..6b44290aaab4 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -4,7 +4,7 @@
4 * License. See the file "COPYING" in the main directory of this archive 4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details. 5 * for more details.
6 * 6 *
7 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 7 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
8 */ 8 */
9 9
10 10
@@ -123,11 +123,8 @@ extern int nasid_slice_to_cpuid(int, int);
123 123
124/* 124/*
125 * cnodeid_to_nasid - convert a cnodeid to a NASID 125 * cnodeid_to_nasid - convert a cnodeid to a NASID
126 * Macro relies on pg_data for a node being on the node itself.
127 * Just extract the NASID from the pointer.
128 *
129 */ 126 */
130#define cnodeid_to_nasid(cnodeid) pda->cnodeid_to_nasid_table[cnodeid] 127#define cnodeid_to_nasid(cnodeid) (sn_cnodeid_to_nasid[cnodeid])
131 128
132/* 129/*
133 * nasid_to_cnodeid - convert a NASID to a cnodeid 130 * nasid_to_cnodeid - convert a NASID to a cnodeid