Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 925
b: refs/heads/master
c: 9b48b46
h: refs/heads/master
i:
  923: 4810f86
v: v3
  • Loading branch information
Dean Nelson authored and Tony Luck committed May 4, 2005
1 parent 88b2744 commit e3f8ba6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4b07b7b3693228c7b848c00a9d4bbb49506a45f
refs/heads/master: 9b48b46678989b67cd00658ea88964163eaab616
9 changes: 7 additions & 2 deletions trunk/arch/ia64/sn/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ EXPORT_PER_CPU_SYMBOL(__sn_hub_info);
DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]);
EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid);

DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
EXPORT_PER_CPU_SYMBOL(__sn_nodepda);

partid_t sn_partid = -1;
EXPORT_SYMBOL(sn_partid);
char sn_system_serial_number_string[128];
Expand Down Expand Up @@ -480,7 +483,8 @@ void __init sn_cpu_init(void)

cnode = nasid_to_cnodeid(nasid);

pda->p_nodepda = nodepdaindr[cnode];
sn_nodepda = nodepdaindr[cnode];

pda->led_address =
(typeof(pda->led_address)) (LED0 + (slice << LED_CPU_SHIFT));
pda->led_state = LED_ALWAYS_SET;
Expand Down Expand Up @@ -626,7 +630,8 @@ nasid_slice_to_cpuid(int nasid, int slice)
long cpu;

for (cpu=0; cpu < NR_CPUS; cpu++)
if (nodepda->phys_cpuid[cpu].nasid == nasid && nodepda->phys_cpuid[cpu].slice == slice)
if (cpuid_to_nasid(cpu) == nasid &&
cpuid_to_slice(cpu) == slice)
return cpu;

return -1;
Expand Down
15 changes: 6 additions & 9 deletions trunk/include/asm-ia64/sn/nodepda.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <asm/irq.h>
#include <asm/sn/arch.h>
#include <asm/sn/intr.h>
#include <asm/sn/pda.h>
#include <asm/sn/bte.h>

/*
Expand Down Expand Up @@ -67,20 +66,18 @@ typedef struct nodepda_s nodepda_t;
* The next set of definitions provides this.
* Routines are expected to use
*
* nodepda -> to access node PDA for the node on which code is running
* subnodepda -> to access subnode PDA for the subnode on which code is running
*
* NODEPDA(cnode) -> to access node PDA for cnodeid
* SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode
* sn_nodepda - to access node PDA for the node on which code is running
* NODEPDA(cnodeid) - to access node PDA for cnodeid
*/

#define nodepda pda->p_nodepda /* Ptr to this node's PDA */
#define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode])
DECLARE_PER_CPU(struct nodepda_s *, __sn_nodepda);
#define sn_nodepda (__get_cpu_var(__sn_nodepda))
#define NODEPDA(cnodeid) (sn_nodepda->pernode_pdaindr[cnodeid])

/*
* Check if given a compact node id the corresponding node has all the
* cpus disabled.
*/
#define is_headless_node(cnode) (nr_cpus_node(cnode) == 0)
#define is_headless_node(cnodeid) (nr_cpus_node(cnodeid) == 0)

#endif /* _ASM_IA64_SN_NODEPDA_H */
8 changes: 0 additions & 8 deletions trunk/include/asm-ia64/sn/pda.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@

typedef struct pda_s {

/* Having a pointer in the begining of PDA tends to increase
* the chance of having this pointer in cache. (Yes something
* else gets pushed out). Doing this reduces the number of memory
* access to all nodepda variables to be one
*/
struct nodepda_s *p_nodepda; /* Pointer to Per node PDA */
struct subnodepda_s *p_subnodepda; /* Pointer to CPU subnode PDA */

/*
* Support for SN LEDs
*/
Expand Down
18 changes: 9 additions & 9 deletions trunk/include/asm-ia64/sn/sn_cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,24 @@
* NOTE: on non-MP systems, only cpuid 0 exists
*/

extern short physical_node_map[]; /* indexed by nasid to get cnode */
extern short physical_node_map[]; /* indexed by nasid to get cnode */

/*
* Macros for retrieving info about current cpu
*/
#define get_nasid() (nodepda->phys_cpuid[smp_processor_id()].nasid)
#define get_subnode() (nodepda->phys_cpuid[smp_processor_id()].subnode)
#define get_slice() (nodepda->phys_cpuid[smp_processor_id()].slice)
#define get_cnode() (nodepda->phys_cpuid[smp_processor_id()].cnode)
#define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
#define get_nasid() (sn_nodepda->phys_cpuid[smp_processor_id()].nasid)
#define get_subnode() (sn_nodepda->phys_cpuid[smp_processor_id()].subnode)
#define get_slice() (sn_nodepda->phys_cpuid[smp_processor_id()].slice)
#define get_cnode() (sn_nodepda->phys_cpuid[smp_processor_id()].cnode)
#define get_sapicid() ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)

/*
* Macros for retrieving info about an arbitrary cpu
* cpuid - logical cpu id
*/
#define cpuid_to_nasid(cpuid) (nodepda->phys_cpuid[cpuid].nasid)
#define cpuid_to_subnode(cpuid) (nodepda->phys_cpuid[cpuid].subnode)
#define cpuid_to_slice(cpuid) (nodepda->phys_cpuid[cpuid].slice)
#define cpuid_to_nasid(cpuid) (sn_nodepda->phys_cpuid[cpuid].nasid)
#define cpuid_to_subnode(cpuid) (sn_nodepda->phys_cpuid[cpuid].subnode)
#define cpuid_to_slice(cpuid) (sn_nodepda->phys_cpuid[cpuid].slice)
#define cpuid_to_cnodeid(cpuid) (physical_node_map[cpuid_to_nasid(cpuid)])


Expand Down

0 comments on commit e3f8ba6

Please sign in to comment.