Commit a1027f20 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: A few small clean ups

From: Pat Gefre <pfg@sgi.com>

A few small clean ups
parent 86d60daa
......@@ -26,6 +26,8 @@ extern vertex_hdl_t hwgraph_root;
extern void io_module_init(void);
extern int pci_bus_to_hcl_cvlink(void);
nasid_t master_baseio_nasid;
nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */
/*
* This routine is responsible for the setup of all the IRIX hwgraph style
......
......@@ -29,7 +29,6 @@
#define GRPRINTF(x)
#endif
extern char arg_maxnodes[];
void mark_cpuvertex_as_cpu(vertex_hdl_t vhdl, cpuid_t cpuid);
......@@ -159,7 +158,7 @@ klhwg_add_xbow(cnodeid_t cnode, nasid_t nasid)
printk(KERN_WARNING "klhwg_add_xbow: Check for "
"working routers and router links!");
panic("klhwg_add_xbow: Failed to add "
printk("klhwg_add_xbow: Failed to add "
"edge: vertex 0x%p to vertex 0x%p,"
"error %d\n",
(void *)hubv, (void *)xbow_v, err);
......@@ -346,7 +345,7 @@ klhwg_connect_one_router(vertex_hdl_t hwgraph_root, lboard_t *brd,
/* We don't know what to do with multiple router components */
if (brd->brd_numcompts != 1) {
panic("klhwg_connect_one_router: %d cmpts on router\n",
printk("klhwg_connect_one_router: %d cmpts on router\n",
brd->brd_numcompts);
return;
}
......
......@@ -23,10 +23,6 @@ int maxcpus;
extern xwidgetnum_t hub_widget_id(nasid_t);
nasid_t master_nasid = INVALID_NASID; /* This is the partition master nasid */
nasid_t master_baseio_nasid = INVALID_NASID; /* This is the master base I/O nasid */
/* XXX - Move the meat of this to intr.c ? */
/*
* Set up the platform-dependent fields in the nodepda.
......@@ -34,22 +30,26 @@ nasid_t master_baseio_nasid = INVALID_NASID; /* This is the master base I/O nasi
void init_platform_nodepda(nodepda_t *npda, cnodeid_t node)
{
hubinfo_t hubinfo;
nasid_t nasid;
extern void router_map_init(nodepda_t *);
extern void router_queue_init(nodepda_t *,cnodeid_t);
extern void intr_init_vecblk(nodepda_t *, cnodeid_t, int);
/* Allocate per-node platform-dependent data */
hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s));
nasid = COMPACT_TO_NASID_NODEID(node);
if (node >= numnodes) /* Headless/memless IO nodes */
hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(0), sizeof(struct hubinfo_s));
else
hubinfo = (hubinfo_t)alloc_bootmem_node(NODE_DATA(node), sizeof(struct hubinfo_s));
npda->pdinfo = (void *)hubinfo;
hubinfo->h_nodepda = npda;
hubinfo->h_cnodeid = node;
hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(node);
spin_lock_init(&hubinfo->h_crblock);
hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid);
npda->xbow_peer = INVALID_NASID;
/*
......@@ -69,6 +69,21 @@ void init_platform_nodepda(nodepda_t *npda, cnodeid_t node)
init_MUTEX_LOCKED(&npda->xbow_sema); /* init it locked? */
}
void
init_platform_hubinfo(nodepda_t **nodepdaindr) {
cnodeid_t cnode;
hubinfo_t hubinfo;
nodepda_t *npda;
extern int numionodes;
for (cnode = 0; cnode < numionodes; cnode++) {
npda = nodepdaindr[cnode];
hubinfo = (hubinfo_t)npda->pdinfo;
hubinfo->h_nasid = COMPACT_TO_NASID_NODEID(cnode);
hubinfo->h_widgetid = hub_widget_id(hubinfo->h_nasid);
}
}
void
update_node_information(cnodeid_t cnodeid)
{
......
......@@ -287,6 +287,12 @@ sn_setup(char **cmdline_p)
*/
sn_cpu_init();
/*
* Setup hubinfo stuff. Has to happen AFTER sn_cpu_init(),
* because it uses the cnode to nasid tables.
*/
init_platform_hubinfo(nodepdaindr);
#ifdef CONFIG_SMP
init_smp_config();
#endif
......
......@@ -184,13 +184,9 @@ typedef enum {
typedef int error_handler_f(void *, int, ioerror_mode_t, ioerror_t *);
typedef void *error_handler_arg_t;
extern void sn_ioerror_dump(char *, int, int, ioerror_t *);
#ifdef ERROR_DEBUG
#define IOERROR_DUMP(x, y, z, t) sn_ioerror_dump((x), (y), (z), (t))
#define IOERR_PRINTF(x) (x)
#else
#define IOERROR_DUMP(x, y, z, t)
#define IOERR_PRINTF(x)
#endif /* ERROR_DEBUG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment