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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id: sn_private.h,v 1.1 2002/02/28 17:31:26 marcelo Exp $
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1992 - 1997, 2000-2002 Silicon Graphics, Inc. All rights reserved.
  8.  */
  9. #ifndef _ASM_IA64_SN_SN2_SN_PRIVATE_H
  10. #define _ASM_IA64_SN_SN2_SN_PRIVATE_H
  11. #include <asm/sn/nodepda.h>
  12. #include <asm/sn/io.h>
  13. #include <asm/sn/xtalk/xwidget.h>
  14. #include <asm/sn/xtalk/xtalk_private.h>
  15. extern nasid_t master_nasid;
  16. /* promif.c */
  17. extern void he_arcs_set_vectors(void);
  18. extern void mem_init(void);
  19. extern void cpu_unenable(cpuid_t);
  20. extern nasid_t get_lowest_nasid(void);
  21. extern __psunsigned_t get_master_bridge_base(void);
  22. extern void set_master_bridge_base(void);
  23. extern int check_nasid_equiv(nasid_t, nasid_t);
  24. extern nasid_t get_console_nasid(void);
  25. extern char get_console_pcislot(void);
  26. extern int is_master_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid);
  27. /* memsupport.c */
  28. extern void poison_state_alter_range(__psunsigned_t start, int len, int poison);
  29. extern int memory_present(paddr_t);
  30. extern int memory_read_accessible(paddr_t);
  31. extern int memory_write_accessible(paddr_t);
  32. extern void memory_set_access(paddr_t, int, int);
  33. extern void show_dir_state(paddr_t, void (*)(char *, ...));
  34. extern void check_dir_state(nasid_t, int, void (*)(char *, ...));
  35. extern void set_dir_owner(paddr_t, int);
  36. extern void set_dir_state(paddr_t, int);
  37. extern void set_dir_state_POISONED(paddr_t);
  38. extern void set_dir_state_UNOWNED(paddr_t);
  39. extern int is_POISONED_dir_state(paddr_t);
  40. extern int is_UNOWNED_dir_state(paddr_t);
  41. extern void get_dir_ent(paddr_t paddr, int *state,
  42. uint64_t *vec_ptr, hubreg_t *elo);
  43. /* intr.c */
  44. extern int intr_reserve_level(cpuid_t cpu, int level, int err, devfs_handle_t owner_dev, char *name);
  45. extern void intr_unreserve_level(cpuid_t cpu, int level);
  46. extern int intr_connect_level(cpuid_t cpu, int bit, ilvl_t mask_no, 
  47. intr_func_t intr_prefunc);
  48. extern int intr_disconnect_level(cpuid_t cpu, int bit);
  49. extern cpuid_t intr_heuristic(devfs_handle_t dev, device_desc_t dev_desc,
  50.       int req_bit,int intr_resflags,devfs_handle_t owner_dev,
  51.       char *intr_name,int *resp_bit);
  52. extern void intr_block_bit(cpuid_t cpu, int bit);
  53. extern void intr_unblock_bit(cpuid_t cpu, int bit);
  54. extern void setrtvector(intr_func_t);
  55. extern void install_cpuintr(cpuid_t cpu);
  56. extern void install_dbgintr(cpuid_t cpu);
  57. extern void install_tlbintr(cpuid_t cpu);
  58. extern void hub_migrintr_init(cnodeid_t /*cnode*/);
  59. extern int cause_intr_connect(int level, intr_func_t handler, uint intr_spl_mask);
  60. extern int cause_intr_disconnect(int level);
  61. extern void intr_dumpvec(cnodeid_t cnode, void (*pf)(char *, ...));
  62. /* error_dump.c */
  63. extern char *hub_rrb_err_type[];
  64. extern char *hub_wrb_err_type[];
  65. void nmi_dump(void);
  66. void install_cpu_nmi_handler(int slice);
  67. /* klclock.c */
  68. extern void hub_rtc_init(cnodeid_t);
  69. /* bte.c */
  70. void bte_lateinit(void);
  71. void bte_wait_for_xfer_completion(void *);
  72. /* klgraph.c */
  73. void klhwg_add_all_nodes(devfs_handle_t);
  74. void klhwg_add_all_modules(devfs_handle_t);
  75. /* klidbg.c */
  76. void install_klidbg_functions(void);
  77. /* klnuma.c */
  78. extern void replicate_kernel_text(int numnodes);
  79. extern __psunsigned_t get_freemem_start(cnodeid_t cnode);
  80. extern void setup_replication_mask(int maxnodes);
  81. /* init.c */
  82. extern cnodeid_t get_compact_nodeid(void); /* get compact node id */
  83. extern void init_platform_nodepda(nodepda_t *npda, cnodeid_t node);
  84. extern void init_platform_pda(cpuid_t cpu);
  85. extern void per_cpu_init(void);
  86. extern int is_fine_dirmode(void);
  87. extern void update_node_information(cnodeid_t);
  88.  
  89. /* shubio.c */
  90. extern void hubio_init(void);
  91. extern void hub_merge_clean(nasid_t nasid);
  92. extern void hub_set_piomode(nasid_t nasid, int conveyor);
  93. /* shuberror.c */
  94. extern void hub_error_init(cnodeid_t);
  95. extern void dump_error_spool(cpuid_t cpu, void (*pf)(char *, ...));
  96. extern void hubni_error_handler(char *, int);
  97. extern int check_ni_errors(void);
  98. /* Used for debugger to signal upper software a breakpoint has taken place */
  99. extern void *debugger_update;
  100. extern __psunsigned_t debugger_stopped;
  101. /* 
  102.  * piomap, created by shub_pio_alloc.
  103.  * xtalk_info MUST BE FIRST, since this structure is cast to a
  104.  * xtalk_piomap_s by generic xtalk routines.
  105.  */
  106. struct hub_piomap_s {
  107. struct xtalk_piomap_s hpio_xtalk_info;/* standard crosstalk pio info */
  108. devfs_handle_t hpio_hub; /* which shub's mapping registers are set up */
  109. short hpio_holdcnt; /* count of current users of bigwin mapping */
  110. char hpio_bigwin_num;/* if big window map, which one */
  111. int  hpio_flags; /* defined below */
  112. };
  113. /* hub_piomap flags */
  114. #define HUB_PIOMAP_IS_VALID 0x1
  115. #define HUB_PIOMAP_IS_BIGWINDOW 0x2
  116. #define HUB_PIOMAP_IS_FIXED 0x4
  117. #define hub_piomap_xt_piomap(hp) (&hp->hpio_xtalk_info)
  118. #define hub_piomap_hub_v(hp) (hp->hpio_hub)
  119. #define hub_piomap_winnum(hp) (hp->hpio_bigwin_num)
  120. /* 
  121.  * dmamap, created by shub_pio_alloc.
  122.  * xtalk_info MUST BE FIRST, since this structure is cast to a
  123.  * xtalk_dmamap_s by generic xtalk routines.
  124.  */
  125. struct hub_dmamap_s {
  126. struct xtalk_dmamap_s hdma_xtalk_info;/* standard crosstalk dma info */
  127. devfs_handle_t hdma_hub; /* which shub we go through */
  128. int hdma_flags; /* defined below */
  129. };
  130. /* shub_dmamap flags */
  131. #define HUB_DMAMAP_IS_VALID 0x1
  132. #define HUB_DMAMAP_USED 0x2
  133. #define HUB_DMAMAP_IS_FIXED 0x4
  134. /* 
  135.  * interrupt handle, created by shub_intr_alloc.
  136.  * xtalk_info MUST BE FIRST, since this structure is cast to a
  137.  * xtalk_intr_s by generic xtalk routines.
  138.  */
  139. struct hub_intr_s {
  140. struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */
  141. ilvl_t i_swlevel; /* software level for blocking intr */
  142. cpuid_t i_cpuid; /* which cpu */
  143. int i_bit; /* which bit */
  144. int i_flags;
  145. };
  146. /* flag values */
  147. #define HUB_INTR_IS_ALLOCED 0x1 /* for debug: allocated */
  148. #define HUB_INTR_IS_CONNECTED 0x4 /* for debug: connected to a software driver */
  149. typedef struct hubinfo_s {
  150. nodepda_t *h_nodepda; /* pointer to node's private data area */
  151. cnodeid_t h_cnodeid; /* compact nodeid */
  152. nasid_t h_nasid; /* nasid */
  153. /* structures for PIO management */
  154. xwidgetnum_t h_widgetid; /* my widget # (as viewed from xbow) */
  155. struct hub_piomap_s h_small_window_piomap[HUB_WIDGET_ID_MAX+1];
  156. sv_t h_bwwait; /* wait for big window to free */
  157. spinlock_t h_bwlock; /* guard big window piomap's */
  158. spinlock_t h_crblock;      /* gaurd CRB error handling */
  159. int h_num_big_window_fixed; /* count number of FIXED maps */
  160. struct hub_piomap_s h_big_window_piomap[HUB_NUM_BIG_WINDOW];
  161. hub_intr_t hub_ii_errintr;
  162. } *hubinfo_t;
  163. #define hubinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL 
  164. (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t *)infoptr))
  165. #define hubinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL 
  166. (vhdl, INFO_LBL_NODE_INFO, (arbitrary_info_t)infoptr)
  167. #define hubinfo_to_hubv(hinfo, hub_v) (hinfo->h_nodepda->node_vertex)
  168. /*
  169.  * Hub info PIO map access functions.
  170.  */
  171. #define hubinfo_bwin_piomap_get(hinfo, win) 
  172. (&hinfo->h_big_window_piomap[win])
  173. #define hubinfo_swin_piomap_get(hinfo, win)
  174. (&hinfo->h_small_window_piomap[win])
  175. /* cpu-specific information stored under INFO_LBL_CPU_INFO */
  176. typedef struct cpuinfo_s {
  177. cpuid_t ci_cpuid; /* CPU ID */
  178. } *cpuinfo_t;
  179. #define cpuinfo_get(vhdl, infoptr) ((void)hwgraph_info_get_LBL 
  180. (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t *)infoptr))
  181. #define cpuinfo_set(vhdl, infoptr) (void)hwgraph_info_add_LBL 
  182. (vhdl, INFO_LBL_CPU_INFO, (arbitrary_info_t)infoptr)
  183. /* Special initialization function for xswitch vertices created during startup. */
  184. extern void xswitch_vertex_init(devfs_handle_t xswitch);
  185. extern xtalk_provider_t hub_provider;
  186. /* du.c */
  187. int ducons_write(char *buf, int len);
  188. /* memerror.c */
  189. extern void install_eccintr(cpuid_t cpu);
  190. extern void memerror_get_stats(cnodeid_t cnode,
  191.        int *bank_stats, int *bank_stats_max);
  192. extern void probe_md_errors(nasid_t);
  193. /* sysctlr.c */
  194. extern void sysctlr_init(void);
  195. extern void sysctlr_power_off(int sdonly);
  196. extern void sysctlr_keepalive(void);
  197. #define valid_cpuid(_x) (((_x) >= 0) && ((_x) < maxcpus))
  198. /* Useful definitions to get the memory dimm given a physical
  199.  * address.
  200.  */
  201. #define paddr_dimm(_pa) ((_pa & MD_BANK_MASK) >> MD_BANK_SHFT)
  202. #define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa)))
  203. extern void membank_pathname_get(paddr_t,char *);
  204. /* To redirect the output into the error buffer */
  205. #define errbuf_print(_s) printf("#%s",_s)
  206. extern void crbx(nasid_t nasid, void (*pf)(char *, ...));
  207. void bootstrap(void);
  208. /* sndrv.c */
  209. extern int sndrv_attach(devfs_handle_t vertex);
  210. #endif /* _ASM_IA64_SN_SN2_SN_PRIVATE_H */