2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
8 #ifndef _ASM_IA64_SN_NODEPDA_H
9 #define _ASM_IA64_SN_NODEPDA_H
12 #include <asm/semaphore.h>
14 #include <asm/sn/intr.h>
15 #include <asm/sn/router.h>
16 #include <asm/sn/pda.h>
17 #include <asm/sn/module.h>
18 #include <asm/sn/bte.h>
19 #include <asm/sn/sn2/arch.h>
22 * NUMA Node-Specific Data structures are defined in this file.
23 * In particular, this is the location of the node PDA.
24 * A pointer to the right node PDA is saved in each CPU PDA.
28 * Node-specific data structure.
30 * One of these structures is allocated on each node of a NUMA system.
32 * This structure provides a convenient way of keeping together
33 * all per-node data structures.
41 cpuid_t node_first_cpu; /* Starting cpu number for node */
42 /* WARNING: no guarantee that */
43 /* the second cpu on a node is */
44 /* node_first_cpu+1. */
46 vertex_hdl_t xbow_vhdl;
47 nasid_t xbow_peer; /* NASID of our peer hub on xbow */
48 struct semaphore xbow_sema; /* Sema for xbow synchronization */
51 module_t *module; /* Pointer to containing module */
52 xwidgetnum_t basew_id;
53 vertex_hdl_t basew_xc;
55 int num_routers; /* XXX not setup! Total routers in the system */
58 char *hwg_node_name; /* hwgraph node name */
59 vertex_hdl_t node_vertex; /* Hwgraph vertex for this node */
61 void *pdinfo; /* Platform-dependent per-node info */
64 nodepda_router_info_t *npda_rip_first;
65 nodepda_router_info_t **npda_rip_last;
71 * The BTEs on this node are shared by the local cpus
73 struct bteinfo_s bte_if[BTES_PER_NODE]; /* Virtual Interface */
74 struct timer_list bte_recovery_timer;
75 spinlock_t bte_recovery_lock;
78 * Array of pointers to the nodepdas for each node.
80 struct nodepda_s *pernode_pdaindr[MAX_COMPACT_NODES];
84 typedef struct nodepda_s nodepda_t;
88 char irq_flags[NR_IRQS];
89 struct pci_dev *device_dev[NR_IRQS];
90 char share_count[NR_IRQS];
94 typedef struct irqpda_s irqpda_t;
98 * Access Functions for node PDA.
99 * Since there is one nodepda for each node, we need a convenient mechanism
100 * to access these nodepdas without cluttering code with #ifdefs.
101 * The next set of definitions provides this.
102 * Routines are expected to use
104 * nodepda -> to access node PDA for the node on which code is running
105 * subnodepda -> to access subnode PDA for the subnode on which code is running
107 * NODEPDA(cnode) -> to access node PDA for cnodeid
108 * SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode
111 #define nodepda pda->p_nodepda /* Ptr to this node's PDA */
112 #define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode])
116 * Macros to access data structures inside nodepda
118 #define NODE_MODULEID(cnode) geo_module((NODEPDA(cnode)->geoid))
119 #define NODE_SLOTID(cnode) (NODEPDA(cnode)->slotdesc)
123 * Quickly convert a compact node ID into a hwgraph vertex
125 #define cnodeid_to_vertex(cnodeid) (NODEPDA(cnodeid)->node_vertex)
129 * Check if given a compact node id the corresponding node has all the
132 #define is_headless_node(cnode) (nr_cpus_node(cnode) == 0)
135 * Check if given a node vertex handle the corresponding node has all the
138 #define is_headless_node_vertex(_nodevhdl) \
139 is_headless_node(nodevertex_to_cnodeid(_nodevhdl))
142 #endif /* _ASM_IA64_SN_NODEPDA_H */