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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * sercons.c
  3.  *      choose the right serial device at boot time
  4.  *
  5.  * triemer 6-SEP-1998
  6.  *      sercons.c is designed to allow the three different kinds 
  7.  *      of serial devices under the decstation world to co-exist
  8.  *      in the same kernel.  The idea here is to abstract 
  9.  *      the pieces of the drivers that are common to this file
  10.  *      so that they do not clash at compile time and runtime.
  11.  *
  12.  * HK 16-SEP-1998 v0.002
  13.  *      removed the PROM console as this is not a real serial
  14.  *      device. Added support for PROM console in drivers/char/tty_io.c
  15.  *      instead. Although it may work to enable more than one 
  16.  *      console device I strongly recommend to use only one.
  17.  */
  18. #include <linux/config.h>
  19. #include <linux/init.h>
  20. #include <asm/dec/machtype.h>
  21. #ifdef CONFIG_ZS
  22. extern int zs_init(void);
  23. #endif
  24. #ifdef CONFIG_DZ
  25. extern int dz_init(void);
  26. #endif
  27. #ifdef CONFIG_SERIAL_CONSOLE
  28. #ifdef CONFIG_ZS
  29. extern void zs_serial_console_init(void);
  30. #endif
  31. #ifdef CONFIG_DZ
  32. extern void dz_serial_console_init(void);
  33. #endif
  34. #endif
  35. /* rs_init - starts up the serial interface -
  36.    handle normal case of starting up the serial interface */
  37. #ifdef CONFIG_SERIAL
  38. int __init rs_init(void)
  39. {
  40. #if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  41.     if (IOASIC)
  42. return zs_init();
  43.     else
  44. return dz_init();
  45. #else
  46. #ifdef CONFIG_ZS
  47.     return zs_init();
  48. #endif
  49. #ifdef CONFIG_DZ
  50.     return dz_init();
  51. #endif
  52. #endif
  53. }
  54. __initcall(rs_init);
  55. #endif
  56. #ifdef CONFIG_SERIAL_CONSOLE
  57. /* serial_console_init handles the special case of starting
  58.  *   up the console on the serial port
  59.  */
  60. void __init serial_console_init(void)
  61. {
  62. #if defined(CONFIG_ZS) && defined(CONFIG_DZ)
  63.     if (IOASIC)
  64. zs_serial_console_init();
  65.     else
  66. dz_serial_console_init();
  67. #else
  68. #ifdef CONFIG_ZS
  69.     zs_serial_console_init();
  70. #endif
  71. #ifdef CONFIG_DZ
  72.     dz_serial_console_init();
  73. #endif
  74. #endif
  75. }
  76. #endif