nodepda.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  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
  4.  * for more details.
  5.  *
  6.  * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
  7.  */
  8. #ifndef _ASM_IA64_SN_NODEPDA_H
  9. #define _ASM_IA64_SN_NODEPDA_H
  10. #include <linux/config.h>
  11. #include <asm/irq.h>
  12. #include <asm/sn/intr.h>
  13. #include <asm/sn/router.h>
  14. #if defined(CONFIG_IA64_SGI_SN1)
  15. #include <asm/sn/sn1/synergy.h>
  16. #endif
  17. #include <asm/sn/pda.h>
  18. #include <asm/sn/module.h>
  19. #include <asm/sn/bte.h>
  20. #if defined(CONFIG_IA64_SGI_SN1)
  21. #include <asm/sn/sn1/hubstat.h>
  22. #endif
  23. /*
  24.  * NUMA Node-Specific Data structures are defined in this file.
  25.  * In particular, this is the location of the node PDA.
  26.  * A pointer to the right node PDA is saved in each CPU PDA.
  27.  */
  28. /*
  29.  * Subnode PDA structures. Each node needs a few data structures that 
  30.  * correspond to the PIs on the HUB chip that supports the node.
  31.  */
  32. #if defined(CONFIG_IA64_SGI_SN1)
  33. struct subnodepda_s {
  34. intr_vecblk_t intr_dispatch0;
  35. intr_vecblk_t intr_dispatch1;
  36. };
  37. typedef struct subnodepda_s subnode_pda_t;
  38. struct synergy_perf_s;
  39. #endif
  40. /*
  41.  * Node-specific data structure.
  42.  *
  43.  * One of these structures is allocated on each node of a NUMA system.
  44.  *
  45.  * This structure provides a convenient way of keeping together 
  46.  * all per-node data structures. 
  47.  */
  48. struct nodepda_s {
  49. cpuid_t         node_first_cpu; /* Starting cpu number for node */
  50. /* WARNING: no guarantee that   */
  51. /*  the second cpu on a node is */
  52. /*  node_first_cpu+1.           */
  53. devfs_handle_t  xbow_vhdl;
  54. nasid_t xbow_peer; /* NASID of our peer hub on xbow */
  55. struct semaphore xbow_sema; /* Sema for xbow synchronization */
  56. slotid_t slotdesc;
  57. moduleid_t module_id; /* Module ID (redundant local copy) */
  58. module_t *module; /* Pointer to containing module */
  59. xwidgetnum_t  basew_id;
  60. devfs_handle_t  basew_xc;
  61. int hubticks;
  62. int num_routers; /* XXX not setup! Total routers in the system */
  63. char *hwg_node_name; /* hwgraph node name */
  64. devfs_handle_t node_vertex; /* Hwgraph vertex for this node */
  65. void  *pdinfo; /* Platform-dependent per-node info */
  66. nodepda_router_info_t *npda_rip_first;
  67. nodepda_router_info_t **npda_rip_last;
  68. /*
  69.  * The BTEs on this node are shared by the local cpus
  70.  */
  71. bteinfo_t node_bte_info[BTES_PER_NODE];
  72. #if defined(CONFIG_IA64_SGI_SN1)
  73. subnode_pda_t snpda[NUM_SUBNODES];
  74. /*
  75.  * New extended memory reference counters
  76.    */
  77. void *migr_refcnt_counterbase;
  78. void *migr_refcnt_counterbuffer;
  79. size_t migr_refcnt_cbsize;
  80. int migr_refcnt_numsets;
  81. hubstat_t hubstats;
  82. int synergy_perf_enabled;
  83.         int        synergy_perf_freq;
  84. spinlock_t synergy_perf_lock;
  85.         uint64_t        synergy_inactive_intervals;
  86.         uint64_t        synergy_active_intervals;
  87.         struct synergy_perf_s *synergy_perf_data;
  88.         struct synergy_perf_s *synergy_perf_first; /* reporting consistency .. */
  89. #endif /* CONFIG_IA64_SGI_SN1 */
  90. /* 
  91.  * Array of pointers to the nodepdas for each node.
  92.  */
  93. struct nodepda_s *pernode_pdaindr[MAX_COMPACT_NODES]; 
  94. };
  95. typedef struct nodepda_s nodepda_t;
  96. #ifdef CONFIG_IA64_SGI_SN2
  97. struct irqpda_s {
  98. int num_irq_used;
  99. char irq_flags[NR_IRQS];
  100. };
  101. typedef struct irqpda_s irqpda_t;
  102. #endif /* CONFIG_IA64_SGI_SN2 */
  103. /*
  104.  * Access Functions for node PDA.
  105.  * Since there is one nodepda for each node, we need a convenient mechanism
  106.  * to access these nodepdas without cluttering code with #ifdefs.
  107.  * The next set of definitions provides this.
  108.  * Routines are expected to use 
  109.  *
  110.  * nodepda -> to access node PDA for the node on which code is running
  111.  * subnodepda -> to access subnode PDA for the subnode on which code is running
  112.  *
  113.  * NODEPDA(cnode) -> to access node PDA for cnodeid 
  114.  * SUBNODEPDA(cnode,sn) -> to access subnode PDA for cnodeid/subnode
  115.  */
  116. #define nodepda pda.p_nodepda /* Ptr to this node's PDA */
  117. #define NODEPDA(cnode) (nodepda->pernode_pdaindr[cnode])
  118. #if defined(CONFIG_IA64_SGI_SN1)
  119. #define subnodepda pda.p_subnodepda /* Ptr to this node's subnode PDA */
  120. #define SUBNODEPDA(cnode,sn) (&(NODEPDA(cnode)->snpda[sn]))
  121. #define SNPDA(npda,sn) (&(npda)->snpda[sn])
  122. #endif
  123. /*
  124.  * Macros to access data structures inside nodepda 
  125.  */
  126. #define NODE_MODULEID(cnode) (NODEPDA(cnode)->module_id)
  127. #define NODE_SLOTID(cnode) (NODEPDA(cnode)->slotdesc)
  128. /*
  129.  * Quickly convert a compact node ID into a hwgraph vertex
  130.  */
  131. #define cnodeid_to_vertex(cnodeid) (NODEPDA(cnodeid)->node_vertex)
  132. /*
  133.  * Check if given a compact node id the corresponding node has all the
  134.  * cpus disabled. 
  135.  */
  136. #define is_headless_node(cnode) ((cnode == CNODEID_NONE) ||
  137.  (node_data(cnode)->active_cpu_count == 0))
  138. /*
  139.  * Check if given a node vertex handle the corresponding node has all the
  140.  * cpus disabled. 
  141.  */
  142. #define is_headless_node_vertex(_nodevhdl) 
  143. is_headless_node(nodevertex_to_cnodeid(_nodevhdl))
  144. #endif /* _ASM_IA64_SN_NODEPDA_H */