diff options
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 9 | ||||
-rw-r--r-- | include/asm-ia64/sn/nodepda.h | 15 | ||||
-rw-r--r-- | include/asm-ia64/sn/pda.h | 8 | ||||
-rw-r--r-- | include/asm-ia64/sn/sn_cpuid.h | 18 |
4 files changed, 22 insertions, 28 deletions
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index fea71ee891eb..4fb44984afe6 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -76,6 +76,9 @@ EXPORT_PER_CPU_SYMBOL(__sn_hub_info); | |||
76 | DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); | 76 | DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); |
77 | EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); | 77 | EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); |
78 | 78 | ||
79 | DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); | ||
80 | EXPORT_PER_CPU_SYMBOL(__sn_nodepda); | ||
81 | |||
79 | partid_t sn_partid = -1; | 82 | partid_t sn_partid = -1; |
80 | EXPORT_SYMBOL(sn_partid); | 83 | EXPORT_SYMBOL(sn_partid); |
81 | char sn_system_serial_number_string[128]; | 84 | char sn_system_serial_number_string[128]; |
@@ -480,7 +483,8 @@ void __init sn_cpu_init(void) | |||
480 | 483 | ||
481 | cnode = nasid_to_cnodeid(nasid); | 484 | cnode = nasid_to_cnodeid(nasid); |
482 | 485 | ||
483 | pda->p_nodepda = nodepdaindr[cnode]; | 486 | sn_nodepda = nodepdaindr[cnode]; |
487 | |||
484 | pda->led_address = | 488 | pda->led_address = |
485 | (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); | 489 | (typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT)); |
486 | pda->led_state = LED_ALWAYS_SET; | 490 | pda->led_state = LED_ALWAYS_SET; |
@@ -626,7 +630,8 @@ nasid_slice_to_cpuid(int nasid, int slice) | |||
626 | long cpu; | 630 | long cpu; |
627 | 631 | ||
628 | for (cpu=0; cpu < NR_CPUS; cpu++) | 632 | for (cpu=0; cpu < NR_CPUS; cpu++) |
629 | 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) | ||
630 | return cpu; | 635 | return cpu; |
631 | 636 | ||
632 | return -1; | 637 | return -1; |
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h index 13cc1002b294..7138b1eafd6b 100644 --- a/include/asm-ia64/sn/nodepda.h +++ b/include/asm-ia64/sn/nodepda.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <asm/irq.h> | 13 | #include <asm/irq.h> |
14 | #include <asm/sn/arch.h> | 14 | #include <asm/sn/arch.h> |
15 | #include <asm/sn/intr.h> | 15 | #include <asm/sn/intr.h> |
16 | #include <asm/sn/pda.h> | ||
17 | #include <asm/sn/bte.h> | 16 | #include <asm/sn/bte.h> |
18 | 17 | ||
19 | /* | 18 | /* |
@@ -67,20 +66,18 @@ typedef struct nodepda_s nodepda_t; | |||
67 | * The next set of definitions provides this. | 66 | * The next set of definitions provides this. |
68 | * Routines are expected to use | 67 | * Routines are expected to use |
69 | * | 68 | * |
70 | * nodepda -> to access node PDA for the node on which code is running | 69 | * sn_nodepda - to access node PDA for the node on which code is running |
71 | * subnodepda -> to access subnode PDA for the subnode on which code is running | 70 | * NODEPDA(cnodeid) - to access node PDA for cnodeid |
72 | * | ||
73 | * NODEPDA(cnode) -> to access node PDA for cnodeid | ||
74 | * SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode | ||
75 | */ | 71 | */ |
76 | 72 | ||
77 | #define nodepda pda->p_nodepda /* Ptr to this node's PDA */ | 73 | DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda); |
78 | #define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode]) | 74 | #define sn_nodepda (__get_cpu_var(__sn_nodepda)) |
75 | #define NODEPDA(cnodeid) (sn_nodepda->pernode_pdaindr[cnodeid]) | ||
79 | 76 | ||
80 | /* | 77 | /* |
81 | * Check if given a compact node id the corresponding node has all the | 78 | * Check if given a compact node id the corresponding node has all the |
82 | * cpus disabled. | 79 | * cpus disabled. |
83 | */ | 80 | */ |
84 | #define is_headless_node(cnode) (nr_cpus_node(cnode) == 0) | 81 | #define is_headless_node(cnodeid) (nr_cpus_node(cnodeid) == 0) |
85 | 82 | ||
86 | #endif /* _ASM_IA64_SN_NODEPDA_H */ | 83 | #endif /* _ASM_IA64_SN_NODEPDA_H */ |
diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h index a5340cfe9bab..ea5590c76ca4 100644 --- a/include/asm-ia64/sn/pda.h +++ b/include/asm-ia64/sn/pda.h | |||
@@ -24,14 +24,6 @@ | |||
24 | 24 | ||
25 | typedef struct pda_s { | 25 | typedef struct pda_s { |
26 | 26 | ||
27 | /* Having a pointer in the begining of PDA tends to increase | ||
28 | * the chance of having this pointer in cache. (Yes something | ||
29 | * else gets pushed out). Doing this reduces the number of memory | ||
30 | * access to all nodepda variables to be one | ||
31 | */ | ||
32 | struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */ | ||
33 | struct subnodepda_s *p_subnodepda; /* Pointer to CPU subnode PDA */ | ||
34 | |||
35 | /* | 27 | /* |
36 | * Support for SN LEDs | 28 | * Support for SN LEDs |
37 | */ | 29 | */ |
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h index 6b44290aaab4..20b300187669 100644 --- a/include/asm-ia64/sn/sn_cpuid.h +++ b/include/asm-ia64/sn/sn_cpuid.h | |||
@@ -92,24 +92,24 @@ | |||
92 | * NOTE: on non-MP systems, only cpuid 0 exists | 92 | * NOTE: on non-MP systems, only cpuid 0 exists |
93 | */ | 93 | */ |
94 | 94 | ||
95 | extern short physical_node_map[]; /* indexed by nasid to get cnode */ | 95 | extern short physical_node_map[]; /* indexed by nasid to get cnode */ |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * Macros for retrieving info about current cpu | 98 | * Macros for retrieving info about current cpu |
99 | */ | 99 | */ |
100 | #define get_nasid() (nodepda->phys_cpuid[smp_processor_id()].nasid) | 100 | #define get_nasid() (sn_nodepda->phys_cpuid[smp_processor_id()].nasid) |
101 | #define get_subnode() (nodepda->phys_cpuid[smp_processor_id()].subnode) | 101 | #define get_subnode() (sn_nodepda->phys_cpuid[smp_processor_id()].subnode) |
102 | #define get_slice() (nodepda->phys_cpuid[smp_processor_id()].slice) | 102 | #define get_slice() (sn_nodepda->phys_cpuid[smp_processor_id()].slice) |
103 | #define get_cnode() (nodepda->phys_cpuid[smp_processor_id()].cnode) | 103 | #define get_cnode() (sn_nodepda->phys_cpuid[smp_processor_id()].cnode) |
104 | #define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff) | 104 | #define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff) |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * Macros for retrieving info about an arbitrary cpu | 107 | * Macros for retrieving info about an arbitrary cpu |
108 | * cpuid - logical cpu id | 108 | * cpuid - logical cpu id |
109 | */ | 109 | */ |
110 | #define cpuid_to_nasid(cpuid) (nodepda->phys_cpuid[cpuid].nasid) | 110 | #define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid) |
111 | #define cpuid_to_subnode(cpuid) (nodepda->phys_cpuid[cpuid].subnode) | 111 | #define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode) |
112 | #define cpuid_to_slice(cpuid) (nodepda->phys_cpuid[cpuid].slice) | 112 | #define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice) |
113 | #define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)]) | 113 | #define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)]) |
114 | 114 | ||
115 | 115 | ||