#include <linux/compiler.h>
#include <linux/sched.h>
#include <linux/root_dev.h>
+#include <linux/nodemask.h>
#include <asm/io.h>
#include <asm/sal.h>
{
int cnode;
- for (cnode = 0; cnode < numnodes; cnode++)
+ for_each_online_node(cnode) {
if (is_shub_1_1(cnodeid_to_nasid(cnode)))
shub_1_1_found = 1;
+ }
}
/**
memset(pda->cnodeid_to_nasid_table, -1,
sizeof(pda->cnodeid_to_nasid_table));
- for (cnode = 0; cnode < numnodes; cnode++)
+ for_each_online_node(cnode)
pda->cnodeid_to_nasid_table[cnode] =
pxm_to_nasid(nid_to_pxm_map[cnode]);
- numionodes = numnodes;
+ numionodes = num_online_nodes();
scan_for_ionodes();
/*
* Allocate & initalize the nodepda for each node.
*/
- for (cnode = 0; cnode < numnodes; cnode++) {
+ for_each_online_node(cnode) {
nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
/*
* Allocate & initialize nodepda for TIOs. For now, put them on node 0.
*/
- for (cnode = numnodes; cnode < numionodes; cnode++) {
+ for (cnode = num_online_nodes(); cnode < numionodes; cnode++) {
nodepdaindr[cnode] =
alloc_bootmem_node(NODE_DATA(0), sizeof(nodepda_t));
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
* The following routine actually sets up the hubinfo struct
* in nodepda.
*/
- for (cnode = 0; cnode < numnodes; cnode++) {
+ for_each_online_node(cnode) {
bte_init_node(nodepdaindr[cnode], cnode);
}
if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice))
BUG();
- for (i=0; i < NR_NODES; i++) {
+ for (i=0; i < MAX_NUMNODES; i++) {
if (nodepdaindr[i]) {
nodepdaindr[i]->phys_cpuid[cpuid].nasid = nasid;
nodepdaindr[i]->phys_cpuid[cpuid].slice = slice;
int buddy_nasid;
buddy_nasid =
cnodeid_to_nasid(numa_node_id() ==
- numnodes - 1 ? 0 : numa_node_id() + 1);
+ num_online_nodes() - 1 ? 0 : numa_node_id() + 1);
pda->pio_shub_war_cam_addr =
(volatile unsigned long *)GLOBAL_MMR_ADDR(nasid,
SH_PI_CAM_CONTROL);
/* Setup ionodes with memory */
for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
- u64 klgraph_header;
+ char *klgraph_header;
cnodeid_t cnodeid;
if (physical_node_map[nasid] == -1)
continue;
- klgraph_header = cnodeid = -1;
- klgraph_header = ia64_sn_get_klconfig_addr(nasid);
- if (klgraph_header <= 0) {
+ cnodeid = -1;
+ klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
+ if (!klgraph_header) {
if (IS_RUNNING_ON_SIMULATOR())
continue;
BUG(); /* All nodes must have klconfig tables! */