aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/sn/kernel/setup.c')
-rw-r--r--arch/ia64/sn/kernel/setup.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index d35f2a6f9c94..4fb44984afe6 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,12 @@ 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
79DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
80EXPORT_PER_CPU_SYMBOL(__sn_nodepda);
81
76partid_t sn_partid = -1; 82partid_t sn_partid = -1;
77EXPORT_SYMBOL(sn_partid); 83EXPORT_SYMBOL(sn_partid);
78char sn_system_serial_number_string[128]; 84char sn_system_serial_number_string[128];
@@ -373,11 +379,11 @@ static void __init sn_init_pdas(char **cmdline_p)
373{ 379{
374 cnodeid_t cnode; 380 cnodeid_t cnode;
375 381
376 memset(pda->cnodeid_to_nasid_table, -1, 382 memset(sn_cnodeid_to_nasid, -1,
377 sizeof(pda->cnodeid_to_nasid_table)); 383 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
378 for_each_online_node(cnode) 384 for_each_online_node(cnode)
379 pda->cnodeid_to_nasid_table[cnode] = 385 sn_cnodeid_to_nasid[cnode] =
380 pxm_to_nasid(nid_to_pxm_map[cnode]); 386 pxm_to_nasid(nid_to_pxm_map[cnode]);
381 387
382 numionodes = num_online_nodes(); 388 numionodes = num_online_nodes();
383 scan_for_ionodes(); 389 scan_for_ionodes();
@@ -477,7 +483,8 @@ void __init sn_cpu_init(void)
477 483
478 cnode = nasid_to_cnodeid(nasid); 484 cnode = nasid_to_cnodeid(nasid);
479 485
480 pda->p_nodepda = nodepdaindr[cnode]; 486 sn_nodepda = nodepdaindr[cnode];
487
481 pda->led_address = 488 pda->led_address =
482 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); 489 (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT));
483 pda->led_state = LED_ALWAYS_SET; 490 pda->led_state = LED_ALWAYS_SET;
@@ -486,15 +493,18 @@ void __init sn_cpu_init(void)
486 pda->idle_flag = 0; 493 pda->idle_flag = 0;
487 494
488 if (cpuid != 0) { 495 if (cpuid != 0) {
489 memcpy(pda->cnodeid_to_nasid_table, 496 /* copy cpu 0's sn_cnodeid_to_nasid table to this cpu's */
490 pdacpu(0)->cnodeid_to_nasid_table, 497 memcpy(sn_cnodeid_to_nasid,
491 sizeof(pda->cnodeid_to_nasid_table)); 498 (&per_cpu(__sn_cnodeid_to_nasid, 0)),
499 sizeof(__ia64_per_cpu_var(__sn_cnodeid_to_nasid)));
492 } 500 }
493 501
494 /* 502 /*
495 * Check for WARs. 503 * Check for WARs.
496 * Only needs to be done once, on BSP. 504 * 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]. 505 * Has to be done after loop above, because it uses this cpu's
506 * sn_cnodeid_to_nasid table which was just initialized if this
507 * isn't cpu 0.
498 * Has to be done before assignment below. 508 * Has to be done before assignment below.
499 */ 509 */
500 if (!wars_have_been_checked) { 510 if (!wars_have_been_checked) {
@@ -580,8 +590,7 @@ static void __init scan_for_ionodes(void)
580 brd = find_lboard_any(brd, KLTYPE_SNIA); 590 brd = find_lboard_any(brd, KLTYPE_SNIA);
581 591
582 while (brd) { 592 while (brd) {
583 pda->cnodeid_to_nasid_table[numionodes] = 593 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
584 brd->brd_nasid;
585 physical_node_map[brd->brd_nasid] = numionodes; 594 physical_node_map[brd->brd_nasid] = numionodes;
586 root_lboard[numionodes] = brd; 595 root_lboard[numionodes] = brd;
587 numionodes++; 596 numionodes++;
@@ -602,8 +611,7 @@ static void __init scan_for_ionodes(void)
602 root_lboard[nasid_to_cnodeid(nasid)], 611 root_lboard[nasid_to_cnodeid(nasid)],
603 KLTYPE_TIO); 612 KLTYPE_TIO);
604 while (brd) { 613 while (brd) {
605 pda->cnodeid_to_nasid_table[numionodes] = 614 sn_cnodeid_to_nasid[numionodes] = brd->brd_nasid;
606 brd->brd_nasid;
607 physical_node_map[brd->brd_nasid] = numionodes; 615 physical_node_map[brd->brd_nasid] = numionodes;
608 root_lboard[numionodes] = brd; 616 root_lboard[numionodes] = brd;
609 numionodes++; 617 numionodes++;
@@ -614,7 +622,6 @@ static void __init scan_for_ionodes(void)
614 brd = find_lboard_any(brd, KLTYPE_TIO); 622 brd = find_lboard_any(brd, KLTYPE_TIO);
615 } 623 }
616 } 624 }
617
618} 625}
619 626
620int 627int
@@ -623,7 +630,8 @@ nasid_slice_to_cpuid(int nasid, int slice)
623 long cpu; 630 long cpu;
624 631
625 for (cpu=0; cpu < NR_CPUS; cpu++) 632 for (cpu=0; cpu < NR_CPUS; cpu++)
626 if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice) 633 if (cpuid_to_nasid(cpu) == nasid &&
634 cpuid_to_slice(cpu) == slice)
627 return cpu; 635 return cpu;
628 636
629 return -1; 637 return -1;