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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* $Id$
  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-2001 Silicon Graphics, Inc. All rights reserved.
  8.  */
  9. #include <linux/config.h>
  10. #include <linux/types.h>
  11. #include <asm/sn/sgi.h>
  12. #include <asm/sn/sn_sal.h>
  13. #include <asm/sn/io.h>
  14. #include <asm/sn/sn_cpuid.h>
  15. #include <asm/sn/klconfig.h>
  16. #include <asm/sn/module.h>
  17. #include <asm/sn/nic.h>
  18. #include <asm/sn/sn_private.h>
  19. cpuid_t         master_procid = 0;
  20. char arg_maxnodes[4];
  21. extern void init_all_devices(void);
  22. #if defined(CONFIG_IA64_SGI_SN1)
  23. synergy_da_t *Synergy_da_indr[MAX_COMPACT_NODES * 2];
  24. #endif
  25. /*
  26.  * Return non-zero if the given variable was specified
  27.  */
  28. int
  29. is_specified(char *s)
  30. {
  31.         return (strlen(s) != 0);
  32. }
  33. void xbmon_init(void)
  34. {
  35. FIXME("xbmon_init : no-opn");
  36. }
  37. void pciiox_init(void)
  38. {
  39. FIXME("pciiox_init : no-opn");
  40. }
  41. void usrpci_init(void)
  42. {
  43. FIXME("usrpci_init : no-opn");
  44. }
  45. void ioc3_init(void)
  46. {
  47. FIXME("ioc3_init : no-opn");
  48. }
  49. void initialize_io(void)
  50. {
  51. init_all_devices();
  52. }
  53. /*
  54.  * Routines provided by ml/SN/promif.c.
  55.  */
  56. static __psunsigned_t master_bridge_base = (__psunsigned_t)NULL;
  57. nasid_t console_nasid = (nasid_t)-1;
  58. static char console_wid;
  59. static char console_pcislot;
  60. void
  61. set_master_bridge_base(void)
  62. {
  63.         console_wid = WIDGETID_GET(KL_CONFIG_CH_CONS_INFO(master_nasid)->memory_base);
  64.         console_pcislot = KL_CONFIG_CH_CONS_INFO(master_nasid)->npci;
  65.         master_bridge_base = (__psunsigned_t)NODE_SWIN_BASE(console_nasid, console_wid);
  66. // FIXME("WARNING: set_master_bridge_base: NON NASID 0 DOES NOT WORKn");
  67. }
  68. int
  69. check_nasid_equiv(nasid_t nasida, nasid_t nasidb)
  70. {
  71.         if ((nasida == nasidb) || (nasida == NODEPDA(NASID_TO_COMPACT_NODEID(nasidb))->xbow_peer))
  72.                 return 1;
  73.         else
  74.                 return 0;
  75. }
  76. int
  77. is_master_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid)
  78. {
  79.         /*
  80.          * If the widget numbers are different, we're not the master.
  81.          */
  82.         if (test_wid != (xwidgetnum_t)console_wid)
  83.                 return 0;
  84.         /*
  85.          * If the NASIDs are the same or equivalent, we're the master.
  86.          */
  87.         if (check_nasid_equiv(test_nasid, console_nasid)) {
  88.                 return 1;
  89.         } else {
  90.                 return 0;
  91.         }
  92. }
  93. /*
  94.  * Routines provided by ml/SN/nvram.c
  95.  */
  96. void
  97. nvram_baseinit(void)
  98. {
  99. FIXME("nvram_baseinit : no-opn");
  100. }