home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / fas-2.11.0 / part07 < prev    next >
Text File  |  1993-10-18  |  61KB  |  2,040 lines

  1. Newsgroups: comp.sources.unix
  2. From: fas@geminix.in-berlin.de (FAS Support Account)
  3. Subject: REPOST v27i072: FAS-2.11.0 - asynch serial driver for System V, Part07/08
  4. References: <1.750471074.20539@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: fas@geminix.in-berlin.de (FAS Support Account)
  9. Posting-Number: Volume 27, Issue 72
  10. Archive-Name: fas-2.11.0/part07
  11.  
  12. #!/bin/sh
  13. # this is fas211pl0.07 (part 7 of a multipart archive)
  14. # do not concatenate these parts, unpack them in order with /bin/sh
  15. # file fas.h continued
  16. #
  17. if test ! -r _shar_seq_.tmp; then
  18.     echo 'Please unpack part 1 first!'
  19.     exit 1
  20. fi
  21. (read Scheck
  22.  if test "$Scheck" != 7; then
  23.     echo Please unpack part "$Scheck" next!
  24.     exit 1
  25.  else
  26.     exit 0
  27.  fi
  28. ) < _shar_seq_.tmp || exit 1
  29. if test ! -f _shar_wnt_.tmp; then
  30.     echo 'x - still skipping fas.h'
  31. else
  32. echo 'x - continuing file fas.h'
  33. sed 's/^X//' << 'SHAR_EOF' >> 'fas.h' &&
  34. X    uint    flow_flags;    /* flags about the flow control state */
  35. X    uint    event_flags;    /* flags about scheduled events */
  36. X    uint    o_state;    /* current open state */
  37. X    uint    po_state;    /* previous open state */
  38. X    uint    iflag;        /* current terminal input flags */
  39. X    uint    cflag;        /* current terminal hardware control flags */
  40. X    union {            /* modem control masks */
  41. X        struct {
  42. X            unchar    di;    /* mask for modem disable */
  43. X            unchar    eo;    /* mask for modem enable (dialout) */
  44. X            unchar    ei;    /* mask for modem enable (dialin) */
  45. X            unchar    ca;    /* mask for carrier detect */
  46. X        } m;
  47. X        ulong    l;
  48. X    } modem;
  49. X    union {            /* hardware flow control masks */
  50. X        struct {
  51. X            unchar    ic;    /* control mask for inp. flow ctrl */
  52. X            unchar    oc;    /* control mask for outp. flow ctrl */
  53. X            unchar    oe;    /* enable mask for outp. flow ctrl */
  54. X            unchar    hc;    /* control mask for hdx flow ctrl */
  55. X        } m;
  56. X        ulong    l;
  57. X    } flow;
  58. X    union {            /* muliplexer control port */
  59. X        uint    addr;
  60. X        struct {
  61. X            ushort    addr;
  62. X            unchar    val1;
  63. X            unchar    val2;
  64. X        } p;
  65. X    } ctl_port;
  66. X    union {            /* uart port addresses and control values */
  67. X        uint    addr;
  68. X        struct {
  69. X            ushort    addr;
  70. X            unchar    ctl;
  71. X            unchar    val;
  72. X        } p;
  73. X    } port [NUM_UART_REGS];
  74. X    int    timeout_idx;    /* timeout index for untimeout () */
  75. X    uint    rxfer_timeout;    /* timeout counter for recv char transfer */
  76. X    unchar    start_char;    /* start character for software flow control */
  77. X    unchar    stop_char;    /* stop character for software flow control */
  78. X#if defined (HAVE_VPIX)
  79. X    unchar    v86_intmask;    /* VP/ix pseudorupt mask */
  80. X    v86_t    *v86_proc;    /* VP/ix v86proc pointer for pseudorupts */
  81. X#endif
  82. X    uint    recv_ring_cnt;    /* receiver ring buffer counter */
  83. X    unchar    *recv_ring_put_ptr;    /* recv ring buf put ptr */
  84. X    unchar    *recv_ring_take_ptr;    /* recv ring buf take ptr */
  85. X    uint    xmit_fifo_size;    /* transmitter FIFO size */
  86. X    uint    xmit_ring_size;    /* transmitter ring buffer size */
  87. X    uint    xmit_ring_cnt;    /* transmitter ring buffer counter */
  88. X    unchar    *xmit_ring_put_ptr;    /* xmit ring buf put ptr */
  89. X    unchar    *xmit_ring_take_ptr;    /* xmit ring buf take ptr */
  90. X    unchar    recv_buffer [RECV_BUFF_SIZE];    /* recv ring buf */
  91. X    unchar    xmit_buffer [XMIT_BUFF_SIZE];    /* xmit ring buf */
  92. X};
  93. SHAR_EOF
  94. echo 'File fas.h is complete' &&
  95. true || echo 'restore of fas.h failed'
  96. rm -f _shar_wnt_.tmp
  97. fi
  98. # ============= i_fas-ast4c12 ==============
  99. if test -f 'i_fas-ast4c12' -a X"$1" != X"-c"; then
  100.     echo 'x - skipping i_fas-ast4c12 (File already exists)'
  101.     rm -f _shar_wnt_.tmp
  102. else
  103. > _shar_wnt_.tmp
  104. echo 'x - extracting i_fas-ast4c12 (Text)'
  105. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast4c12' &&
  106. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  107. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  108. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  109. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  110. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  111. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  112. SHAR_EOF
  113. true || echo 'restore of i_fas-ast4c12 failed'
  114. rm -f _shar_wnt_.tmp
  115. fi
  116. # ============= i_fas-ast8c12 ==============
  117. if test -f 'i_fas-ast8c12' -a X"$1" != X"-c"; then
  118.     echo 'x - skipping i_fas-ast8c12 (File already exists)'
  119.     rm -f _shar_wnt_.tmp
  120. else
  121. > _shar_wnt_.tmp
  122. echo 'x - extracting i_fas-ast8c12 (Text)'
  123. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-ast8c12' &&
  124. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  125. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  126. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  127. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  128. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  129. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  130. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  131. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  132. XF8:23:off:/etc/getty -t 60 ttyFM08 9600
  133. XF9:23:off:/etc/getty -t 60 ttyFM09 9600
  134. SHAR_EOF
  135. true || echo 'restore of i_fas-ast8c12 failed'
  136. rm -f _shar_wnt_.tmp
  137. fi
  138. # ============= i_fas-c123 ==============
  139. if test -f 'i_fas-c123' -a X"$1" != X"-c"; then
  140.     echo 'x - skipping i_fas-c123 (File already exists)'
  141.     rm -f _shar_wnt_.tmp
  142. else
  143. > _shar_wnt_.tmp
  144. echo 'x - extracting i_fas-c123 (Text)'
  145. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-c123' &&
  146. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  147. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  148. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  149. SHAR_EOF
  150. true || echo 'restore of i_fas-c123 failed'
  151. rm -f _shar_wnt_.tmp
  152. fi
  153. # ============= i_fas-gen8c12 ==============
  154. if test -f 'i_fas-gen8c12' -a X"$1" != X"-c"; then
  155.     echo 'x - skipping i_fas-gen8c12 (File already exists)'
  156.     rm -f _shar_wnt_.tmp
  157. else
  158. > _shar_wnt_.tmp
  159. echo 'x - extracting i_fas-gen8c12 (Text)'
  160. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-gen8c12' &&
  161. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  162. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  163. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  164. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  165. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  166. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  167. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  168. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  169. XF8:23:off:/etc/getty -t 60 ttyFM08 9600
  170. XF9:23:off:/etc/getty -t 60 ttyFM09 9600
  171. SHAR_EOF
  172. true || echo 'restore of i_fas-gen8c12 failed'
  173. rm -f _shar_wnt_.tmp
  174. fi
  175. # ============= i_fas-hub6c12 ==============
  176. if test -f 'i_fas-hub6c12' -a X"$1" != X"-c"; then
  177.     echo 'x - skipping i_fas-hub6c12 (File already exists)'
  178.     rm -f _shar_wnt_.tmp
  179. else
  180. > _shar_wnt_.tmp
  181. echo 'x - extracting i_fas-hub6c12 (Text)'
  182. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-hub6c12' &&
  183. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  184. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  185. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  186. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  187. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  188. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  189. XF6:23:off:/etc/getty -t 60 ttyFM06 9600
  190. XF7:23:off:/etc/getty -t 60 ttyFM07 9600
  191. SHAR_EOF
  192. true || echo 'restore of i_fas-hub6c12 failed'
  193. rm -f _shar_wnt_.tmp
  194. fi
  195. # ============= i_fas-use4c12 ==============
  196. if test -f 'i_fas-use4c12' -a X"$1" != X"-c"; then
  197.     echo 'x - skipping i_fas-use4c12 (File already exists)'
  198.     rm -f _shar_wnt_.tmp
  199. else
  200. > _shar_wnt_.tmp
  201. echo 'x - extracting i_fas-use4c12 (Text)'
  202. sed 's/^X//' << 'SHAR_EOF' > 'i_fas-use4c12' &&
  203. XF0:23:off:/etc/getty -t 60 ttyFM00 9600
  204. XF1:23:off:/etc/getty -t 60 ttyFM01 9600
  205. XF2:23:off:/etc/getty -t 60 ttyFM02 9600
  206. XF3:23:off:/etc/getty -t 60 ttyFM03 9600
  207. XF4:23:off:/etc/getty -t 60 ttyFM04 9600
  208. XF5:23:off:/etc/getty -t 60 ttyFM05 9600
  209. SHAR_EOF
  210. true || echo 'restore of i_fas-use4c12 failed'
  211. rm -f _shar_wnt_.tmp
  212. fi
  213. # ============= m_fas ==============
  214. if test -f 'm_fas' -a X"$1" != X"-c"; then
  215.     echo 'x - skipping m_fas (File already exists)'
  216.     rm -f _shar_wnt_.tmp
  217. else
  218. > _shar_wnt_.tmp
  219. echo 'x - extracting m_fas (Text)'
  220. sed 's/^X//' << 'SHAR_EOF' > 'm_fas' &&
  221. Xfas    Iocrwi    iHct        fas    0    3    1    16    -1
  222. SHAR_EOF
  223. true || echo 'restore of m_fas failed'
  224. rm -f _shar_wnt_.tmp
  225. fi
  226. # ============= n_fas-ast4c12 ==============
  227. if test -f 'n_fas-ast4c12' -a X"$1" != X"-c"; then
  228.     echo 'x - skipping n_fas-ast4c12 (File already exists)'
  229.     rm -f _shar_wnt_.tmp
  230. else
  231. > _shar_wnt_.tmp
  232. echo 'x - extracting n_fas-ast4c12 (Text)'
  233. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast4c12' &&
  234. Xfas    ttyF00    c    80
  235. Xfas    ttyF01    c    81
  236. Xfas    ttyF02    c    82
  237. Xfas    ttyF03    c    83
  238. Xfas    ttyF04    c    84
  239. Xfas    ttyF05    c    85
  240. Xfas    ttyFM00    c    208
  241. Xfas    ttyFM01    c    209
  242. Xfas    ttyFM02    c    210
  243. Xfas    ttyFM03    c    211
  244. Xfas    ttyFM04    c    212
  245. Xfas    ttyFM05    c    213
  246. SHAR_EOF
  247. true || echo 'restore of n_fas-ast4c12 failed'
  248. rm -f _shar_wnt_.tmp
  249. fi
  250. # ============= n_fas-ast8c12 ==============
  251. if test -f 'n_fas-ast8c12' -a X"$1" != X"-c"; then
  252.     echo 'x - skipping n_fas-ast8c12 (File already exists)'
  253.     rm -f _shar_wnt_.tmp
  254. else
  255. > _shar_wnt_.tmp
  256. echo 'x - extracting n_fas-ast8c12 (Text)'
  257. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-ast8c12' &&
  258. Xfas    ttyF00    c    80
  259. Xfas    ttyF01    c    81
  260. Xfas    ttyF02    c    82
  261. Xfas    ttyF03    c    83
  262. Xfas    ttyF04    c    84
  263. Xfas    ttyF05    c    85
  264. Xfas    ttyF06    c    86
  265. Xfas    ttyF07    c    87
  266. Xfas    ttyF08    c    88
  267. Xfas    ttyF09    c    89
  268. Xfas    ttyFM00    c    208
  269. Xfas    ttyFM01    c    209
  270. Xfas    ttyFM02    c    210
  271. Xfas    ttyFM03    c    211
  272. Xfas    ttyFM04    c    212
  273. Xfas    ttyFM05    c    213
  274. Xfas    ttyFM06    c    214
  275. Xfas    ttyFM07    c    215
  276. Xfas    ttyFM08    c    216
  277. Xfas    ttyFM09    c    217
  278. SHAR_EOF
  279. true || echo 'restore of n_fas-ast8c12 failed'
  280. rm -f _shar_wnt_.tmp
  281. fi
  282. # ============= n_fas-c123 ==============
  283. if test -f 'n_fas-c123' -a X"$1" != X"-c"; then
  284.     echo 'x - skipping n_fas-c123 (File already exists)'
  285.     rm -f _shar_wnt_.tmp
  286. else
  287. > _shar_wnt_.tmp
  288. echo 'x - extracting n_fas-c123 (Text)'
  289. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-c123' &&
  290. Xfas    ttyF00    c    80
  291. Xfas    ttyF01    c    81
  292. Xfas    ttyF02    c    82
  293. Xfas    ttyFM00    c    208
  294. Xfas    ttyFM01    c    209
  295. Xfas    ttyFM02    c    210
  296. SHAR_EOF
  297. true || echo 'restore of n_fas-c123 failed'
  298. rm -f _shar_wnt_.tmp
  299. fi
  300. # ============= n_fas-gen8c12 ==============
  301. if test -f 'n_fas-gen8c12' -a X"$1" != X"-c"; then
  302.     echo 'x - skipping n_fas-gen8c12 (File already exists)'
  303.     rm -f _shar_wnt_.tmp
  304. else
  305. > _shar_wnt_.tmp
  306. echo 'x - extracting n_fas-gen8c12 (Text)'
  307. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-gen8c12' &&
  308. Xfas    ttyF00    c    80
  309. Xfas    ttyF01    c    81
  310. Xfas    ttyF02    c    82
  311. Xfas    ttyF03    c    83
  312. Xfas    ttyF04    c    84
  313. Xfas    ttyF05    c    85
  314. Xfas    ttyF06    c    86
  315. Xfas    ttyF07    c    87
  316. Xfas    ttyF08    c    88
  317. Xfas    ttyF09    c    89
  318. Xfas    ttyFM00    c    208
  319. Xfas    ttyFM01    c    209
  320. Xfas    ttyFM02    c    210
  321. Xfas    ttyFM03    c    211
  322. Xfas    ttyFM04    c    212
  323. Xfas    ttyFM05    c    213
  324. Xfas    ttyFM06    c    214
  325. Xfas    ttyFM07    c    215
  326. Xfas    ttyFM08    c    216
  327. Xfas    ttyFM09    c    217
  328. SHAR_EOF
  329. true || echo 'restore of n_fas-gen8c12 failed'
  330. rm -f _shar_wnt_.tmp
  331. fi
  332. # ============= n_fas-hub6c12 ==============
  333. if test -f 'n_fas-hub6c12' -a X"$1" != X"-c"; then
  334.     echo 'x - skipping n_fas-hub6c12 (File already exists)'
  335.     rm -f _shar_wnt_.tmp
  336. else
  337. > _shar_wnt_.tmp
  338. echo 'x - extracting n_fas-hub6c12 (Text)'
  339. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-hub6c12' &&
  340. Xfas    ttyF00    c    80
  341. Xfas    ttyF01    c    81
  342. Xfas    ttyF02    c    82
  343. Xfas    ttyF03    c    83
  344. Xfas    ttyF04    c    84
  345. Xfas    ttyF05    c    85
  346. Xfas    ttyF06    c    86
  347. Xfas    ttyF07    c    87
  348. Xfas    ttyFM00    c    208
  349. Xfas    ttyFM01    c    209
  350. Xfas    ttyFM02    c    210
  351. Xfas    ttyFM03    c    211
  352. Xfas    ttyFM04    c    212
  353. Xfas    ttyFM05    c    213
  354. Xfas    ttyFM06    c    214
  355. Xfas    ttyFM07    c    215
  356. SHAR_EOF
  357. true || echo 'restore of n_fas-hub6c12 failed'
  358. rm -f _shar_wnt_.tmp
  359. fi
  360. # ============= n_fas-use4c12 ==============
  361. if test -f 'n_fas-use4c12' -a X"$1" != X"-c"; then
  362.     echo 'x - skipping n_fas-use4c12 (File already exists)'
  363.     rm -f _shar_wnt_.tmp
  364. else
  365. > _shar_wnt_.tmp
  366. echo 'x - extracting n_fas-use4c12 (Text)'
  367. sed 's/^X//' << 'SHAR_EOF' > 'n_fas-use4c12' &&
  368. Xfas    ttyF00    c    80
  369. Xfas    ttyF01    c    81
  370. Xfas    ttyF02    c    82
  371. Xfas    ttyF03    c    83
  372. Xfas    ttyF04    c    84
  373. Xfas    ttyF05    c    85
  374. Xfas    ttyFM00    c    208
  375. Xfas    ttyFM01    c    209
  376. Xfas    ttyFM02    c    210
  377. Xfas    ttyFM03    c    211
  378. Xfas    ttyFM04    c    212
  379. Xfas    ttyFM05    c    213
  380. SHAR_EOF
  381. true || echo 'restore of n_fas-use4c12 failed'
  382. rm -f _shar_wnt_.tmp
  383. fi
  384. # ============= optim_att.awk ==============
  385. if test -f 'optim_att.awk' -a X"$1" != X"-c"; then
  386.     echo 'x - skipping optim_att.awk (File already exists)'
  387.     rm -f _shar_wnt_.tmp
  388. else
  389. > _shar_wnt_.tmp
  390. echo 'x - extracting optim_att.awk (Text)'
  391. sed 's/^X//' << 'SHAR_EOF' > 'optim_att.awk' &&
  392. X# optim_att.awk
  393. X#
  394. X# filter AT&T assembler file format
  395. X#
  396. X# Replace all calls to outb(), inb() and fas_mem_copy() with the necessary
  397. X# assembler mnemonics and do some optimizations for bit tests.
  398. X
  399. XBEGIN {
  400. X    nl = 0
  401. X    prevline = ""
  402. X}
  403. X
  404. X{
  405. X    if ($1 == "popl") {
  406. X        print prevline
  407. X        if ($2 == "%ecx" && split(prevline, argsp) > 0 \
  408. X            && argsp[1] == "call") {
  409. X        prevline = "\taddl\t$4,%esp"
  410. X        } else {
  411. X        prevline = $0
  412. X        }
  413. X        next
  414. X    } else if ($1 == "pushl") {
  415. X        if ($2 == "%eax" && split(prevline, argsp) == 2 \
  416. X            && argsp[1] == "movl" && argsp[2] == "%esp,%ebp") {
  417. X        print prevline
  418. X        prevline = "\tsubl\t$4,%esp"
  419. X        next
  420. X        }
  421. X        lines[nl++] = $0
  422. X        getline
  423. X        if ($1 == "pushl") {
  424. X        lines[nl++] = $0
  425. X        getline
  426. X        if ($1 == "call" && $2 == "outb") {
  427. X            lines[nl++] = $0
  428. X            getline
  429. X            if ($1 == "addl" && $2 == "$8,%esp") {
  430. X            split(lines[0], args0)
  431. X            split(lines[1], args1)
  432. X            if (args1[2] == "%eax") {
  433. X                print prevline
  434. X                if (args0[2] == "%edx") {
  435. X                print "\tmovl\t%eax,%ecx"
  436. X                print "\tmovl\t%edx,%eax"
  437. X                print "\tmovl\t%ecx,%edx"
  438. X                } else {
  439. X                print "\tmovl\t%eax,%edx"
  440. X                print "\tmovl\t" args0[2] ",%eax"
  441. X                }
  442. X            } else {
  443. X                if (args0[2] == "%eax") {
  444. X                res = 0
  445. X                if (prevline ~ /,%eax$/) {
  446. X                    argsline = substr(prevline, 1, \
  447. X                            length(prevline) - 5) \
  448. X                        " %eax"
  449. X                    split(argsline, argsp)
  450. X                    res = 1
  451. X                }
  452. X                if (res && argsp[3] == "%eax") {
  453. X                    if (argsp[1] == "movzbl" \
  454. X                        || argsp[1] == "movsbl") {
  455. X                    if (argsp[2] != "%al") {
  456. X                        print "\tmovb\t" argsp[2] ",%al"
  457. X                    }
  458. X                    } else if (argsp[1] == "movzwl" \
  459. X                        || argsp[1] == "movswl") {
  460. X                    if (argsp[2] != "%ax") {
  461. X                        if (argsp[2] ~ /^%/) {
  462. X                        print "\tmovw\t" argsp[2] ",%ax"
  463. X                        } else {
  464. X                        print "\tmovb\t" argsp[2] ",%al"
  465. X                        }
  466. X                    }
  467. X                    } else {
  468. X                    print prevline
  469. X                    }
  470. X                } else {
  471. X                    print prevline
  472. X                }
  473. X                } else {
  474. X                print prevline
  475. X                if (args0[2] ~ /^%/) {
  476. X                    print "\tmovl\t" args0[2] ",%eax"
  477. X                } else {
  478. X                    print "\tmovb\t" args0[2] ",%al"
  479. X                }
  480. X                }
  481. X                if (args1[2] != "%edx") {
  482. X                print "\tmovl\t" args1[2] ",%edx"
  483. X                }
  484. X            }
  485. X            prevline = "\toutb\t(%dx)"
  486. X            nl = 0
  487. X            next
  488. X            }
  489. X        } else if ($1 == "pushl") {
  490. X            lines[nl++] = $0
  491. X            getline
  492. X            if ($1 == "call" && $2 == "fas_mem_copy") {
  493. X            lines[nl++] = $0
  494. X            getline
  495. X            if ($1 == "addl" && $2 == "$12,%esp") {
  496. X                split(lines[0], args0)
  497. X                split(lines[1], args1)
  498. X                split(lines[2], args2)
  499. X                print prevline
  500. X                print "\tmovl\t" args2[2] ",%edi"
  501. X                print "\tmovl\t" args1[2] ",%esi"
  502. X                reg = ""
  503. X                if (args0[2] != "%ecx") {
  504. X                if (args0[2] ~ /^[%$]/) {
  505. X                    reg = args0[2]
  506. X                }
  507. X                print "\tmovl\t" args0[2] ",%ecx"
  508. X                }
  509. X                print "\tcld"
  510. X                if (reg == "") {
  511. X                reg = "%eax"
  512. X                print "\tmovl\t%ecx,%eax"
  513. X                }
  514. X                print "\tshrl\t$2,%ecx"
  515. X                print "\trep"
  516. X                print "\tmovsl"
  517. X                print "\tmovl\t" reg ",%ecx"
  518. X                print "\tandl\t$3,%ecx"
  519. X                print "\trep"
  520. X                prevline = "\tmovsb"
  521. X                nl = 0
  522. X                next
  523. X            }
  524. X            }
  525. X        }
  526. X        } else if ($1 == "call" && $2 == "inb") {
  527. X        lines[nl++] = $0
  528. X        getline
  529. X        if ($1 == "popl" || ($1 == "addl" && $2 == "$4,%esp")) {
  530. X            split(lines[0], args0)
  531. X            print prevline
  532. X            if (args0[2] != "%edx") {
  533. X            print "\tmovl\t" args0[2] ",%edx"
  534. X            }
  535. X            print "\txorl\t%eax,%eax"
  536. X            prevline = "\tinb\t(%dx)"
  537. X            nl = 0
  538. X            next
  539. X        }
  540. X        }
  541. X
  542. X        print prevline
  543. X        prevline = $0
  544. X
  545. X        for (i = 0; i < nl; i++) {
  546. X        print lines[i]
  547. X        }
  548. X        nl = 0
  549. X    } else {
  550. X        print prevline
  551. X        prevline = $0
  552. X    }
  553. X
  554. X    cmd = substr($1, 1, length($1) - 1)
  555. X    class = substr($1, length($1))
  556. X
  557. X    if (cmd == "test" && (class == "l" || class == "w") && $2 ~ /^\$/) {
  558. X        split($2, args, ",")
  559. X        args[2] = substr($2, length(args[1]) + 2)
  560. X        if (args[2] ~ /^%.*x$/) {
  561. X        reg = substr(args[2], length(args[2]) - 1, 1)
  562. X        } else {
  563. X        reg = ""
  564. X        }
  565. X        if (reg != "" || args[2] !~ /^%/) {
  566. X        val = substr(args[1], 2) + 0
  567. X        if (class == "w" && val <= -1 && val >= -65536) {
  568. X            val += 65536
  569. X        }
  570. X        if (val >= 0 && val <= 255) {
  571. X            if (reg != "") {
  572. X            prevline = "\t" cmd "b\t" args[1] ",%" reg "l"
  573. X            } else {
  574. X            prevline = "\t" cmd "b\t" args[1] "," args[2]
  575. X            }
  576. X        } else if (val >= 0 && val <= 65535 && (val % 256) == 0) {
  577. X            if (reg != "") {
  578. X            prevline = "\t" cmd "b\t$" val / 256 ",%" reg "h"
  579. X            } else if (args[2] ~ /^[-(]/) {
  580. X            prevline = "\t" cmd "b\t$" val / 256 ",1" args[2]
  581. X            } else {
  582. X            prevline = "\t" cmd "b\t$" val / 256 ",1+" args[2]
  583. X            }
  584. X        }
  585. X        }
  586. X    }
  587. X}
  588. X
  589. XEND {
  590. X        print prevline
  591. X}
  592. SHAR_EOF
  593. true || echo 'restore of optim_att.awk failed'
  594. rm -f _shar_wnt_.tmp
  595. fi
  596. # ============= os_dep_update ==============
  597. if test -f 'os_dep_update' -a X"$1" != X"-c"; then
  598.     echo 'x - skipping os_dep_update (File already exists)'
  599.     rm -f _shar_wnt_.tmp
  600. else
  601. > _shar_wnt_.tmp
  602. echo 'x - extracting os_dep_update (Text)'
  603. sed 's/^X//' << 'SHAR_EOF' > 'os_dep_update' &&
  604. X# update OS dependent defines
  605. X
  606. Xif [ $# -lt 1 ]
  607. Xthen
  608. X    echo 'illegal numer of parameters' >&2
  609. X    exit 1
  610. Xfi
  611. X
  612. Xfname=$1
  613. Xshift
  614. X
  615. Xfor flag in $*
  616. Xdo
  617. X    echo "#undef ${flag}"
  618. X    echo "#define ${flag}"
  619. Xdone > ${fname}.upd
  620. X
  621. Xsed -e '1,/@@OS_DEP_BEGIN@@/d;/@@OS_DEP_END@@/,$d' ${fname} > ${fname}.cur
  622. Xcmp -s ${fname}.cur ${fname}.upd
  623. Xres=$?
  624. X
  625. Xif [ ${res} -ne 1 ]
  626. Xthen
  627. X    rm -f ${fname}.cur ${fname}.upd
  628. X    exit ${res}
  629. Xfi
  630. X
  631. Xsed -e '1,/@@OS_DEP_BEGIN@@/{
  632. X        /@@OS_DEP_BEGIN@@/r '${fname}.upd'
  633. X        b
  634. X    }
  635. X    /@@OS_DEP_END@@/,$b
  636. X    d' ${fname} > ${fname}.tmp
  637. X
  638. Xmv -f ${fname}.tmp ${fname}
  639. Xrm -f ${fname}.cur ${fname}.upd
  640. X
  641. Xexit 0
  642. SHAR_EOF
  643. true || echo 'restore of os_dep_update failed'
  644. rm -f _shar_wnt_.tmp
  645. fi
  646. # ============= s_fas-ast4c12 ==============
  647. if test -f 's_fas-ast4c12' -a X"$1" != X"-c"; then
  648.     echo 'x - skipping s_fas-ast4c12 (File already exists)'
  649.     rm -f _shar_wnt_.tmp
  650. else
  651. > _shar_wnt_.tmp
  652. echo 'x - extracting s_fas-ast4c12 (Text)'
  653. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast4c12' &&
  654. Xfas    Y    4    7    1    5    2a0    2bf    0    0
  655. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  656. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  657. SHAR_EOF
  658. true || echo 'restore of s_fas-ast4c12 failed'
  659. rm -f _shar_wnt_.tmp
  660. fi
  661. # ============= s_fas-ast8c12 ==============
  662. if test -f 's_fas-ast8c12' -a X"$1" != X"-c"; then
  663.     echo 'x - skipping s_fas-ast8c12 (File already exists)'
  664.     rm -f _shar_wnt_.tmp
  665. else
  666. > _shar_wnt_.tmp
  667. echo 'x - extracting s_fas-ast8c12 (Text)'
  668. sed 's/^X//' << 'SHAR_EOF' > 's_fas-ast8c12' &&
  669. Xfas    Y    4    7    1    5    2a0    2bf    0    0
  670. Xfas    Y    4    7    1    9    1a0    1bf    0    0
  671. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  672. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  673. SHAR_EOF
  674. true || echo 'restore of s_fas-ast8c12 failed'
  675. rm -f _shar_wnt_.tmp
  676. fi
  677. # ============= s_fas-c123 ==============
  678. if test -f 's_fas-c123' -a X"$1" != X"-c"; then
  679.     echo 'x - skipping s_fas-c123 (File already exists)'
  680.     rm -f _shar_wnt_.tmp
  681. else
  682. > _shar_wnt_.tmp
  683. echo 'x - extracting s_fas-c123 (Text)'
  684. sed 's/^X//' << 'SHAR_EOF' > 's_fas-c123' &&
  685. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  686. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  687. Xfas    Y    1    7    1    5    3e8    3ef    0    0
  688. SHAR_EOF
  689. true || echo 'restore of s_fas-c123 failed'
  690. rm -f _shar_wnt_.tmp
  691. fi
  692. # ============= s_fas-gen8c12 ==============
  693. if test -f 's_fas-gen8c12' -a X"$1" != X"-c"; then
  694.     echo 'x - skipping s_fas-gen8c12 (File already exists)'
  695.     rm -f _shar_wnt_.tmp
  696. else
  697. > _shar_wnt_.tmp
  698. echo 'x - extracting s_fas-gen8c12 (Text)'
  699. sed 's/^X//' << 'SHAR_EOF' > 's_fas-gen8c12' &&
  700. Xfas    Y    8    7    1    5    100    13f    0    0
  701. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  702. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  703. SHAR_EOF
  704. true || echo 'restore of s_fas-gen8c12 failed'
  705. rm -f _shar_wnt_.tmp
  706. fi
  707. # ============= s_fas-hub6c12 ==============
  708. if test -f 's_fas-hub6c12' -a X"$1" != X"-c"; then
  709.     echo 'x - skipping s_fas-hub6c12 (File already exists)'
  710.     rm -f _shar_wnt_.tmp
  711. else
  712. > _shar_wnt_.tmp
  713. echo 'x - extracting s_fas-hub6c12 (Text)'
  714. sed 's/^X//' << 'SHAR_EOF' > 's_fas-hub6c12' &&
  715. Xfas    Y    6    7    1    5    302    308    0    0
  716. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  717. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  718. SHAR_EOF
  719. true || echo 'restore of s_fas-hub6c12 failed'
  720. rm -f _shar_wnt_.tmp
  721. fi
  722. # ============= s_fas-use4c12 ==============
  723. if test -f 's_fas-use4c12' -a X"$1" != X"-c"; then
  724.     echo 'x - skipping s_fas-use4c12 (File already exists)'
  725.     rm -f _shar_wnt_.tmp
  726. else
  727. > _shar_wnt_.tmp
  728. echo 'x - extracting s_fas-use4c12 (Text)'
  729. sed 's/^X//' << 'SHAR_EOF' > 's_fas-use4c12' &&
  730. Xfas    Y    4    7    1    15    2c0    2df    0    0
  731. Xfas    Y    1    7    1    4    3f8    3ff    0    0
  732. Xfas    Y    1    7    1    3    2f8    2ff    0    0
  733. SHAR_EOF
  734. true || echo 'restore of s_fas-use4c12 failed'
  735. rm -f _shar_wnt_.tmp
  736. fi
  737. # ============= space-ast4c12 ==============
  738. if test -f 'space-ast4c12' -a X"$1" != X"-c"; then
  739.     echo 'x - skipping space-ast4c12 (File already exists)'
  740.     rm -f _shar_wnt_.tmp
  741. else
  742. > _shar_wnt_.tmp
  743. echo 'x - extracting space-ast4c12 (Text)'
  744. sed 's/^X//' << 'SHAR_EOF' > 'space-ast4c12' &&
  745. X/* Device configuration file for the FAS async driver. */
  746. X
  747. X/* This version is for the AST 4-port card in shared interrupts mode plus
  748. X   the standard COM1 and COM2 ports.
  749. X*/
  750. X/* FAS was developed by
  751. XUwe Doering <fas@geminix.in-berlin.de>
  752. XBillstedter Pfad 17 b
  753. X13591 Berlin
  754. XGermany
  755. X*/
  756. X
  757. X#if !defined (M_I286)
  758. X#ident    "@(#)space.c    2.11"
  759. X#endif
  760. X
  761. X#if defined (LOCAL_INCLUDE)
  762. X#include "fas.h"
  763. X#else
  764. X#include <sys/fas.h>
  765. X#endif
  766. X
  767. X/* This is the number of devices to be handled by this driver.
  768. X   If it is changed, make sure that the initializer parts of all arrays
  769. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  770. X   entries. You may define up to 16 devices.
  771. X*/
  772. X#define NUM_PHYSICAL_UNITS    6
  773. X
  774. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  775. X#undef NUM_PHYSICAL_UNITS
  776. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  777. X#endif
  778. X
  779. X/* array of base port addresses
  780. X   These values are the base i/o addresses of the UART chips.
  781. X*/
  782. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  783. X{
  784. X    0x2a0,    0x2a8,    0x2b0,    0x2b8,
  785. X    0x3f8,    0x2f8
  786. X};
  787. X
  788. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  789. X   FAS doesn't need informations about interrupt vectors during normal
  790. X   operation. Therefore, the only function of these values is to be
  791. X   displayed by the FAS boot message. So if you want vector infos at
  792. X   boot time you can enter the vector numbers here. But make sure that
  793. X   the values correspond with the entries in the kernel config files.
  794. X   A value of `-1' means that no vector number is displayed for the
  795. X   respective port.
  796. X   Users of other UNIX flavors can savely ignore this array.
  797. X*/
  798. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  799. X{
  800. X    -1,    -1,    -1,    -1,
  801. X    -1,    -1
  802. X};
  803. X
  804. X/* array of modifier flags
  805. X   You can modify certain features of each port. See fas.h for possible
  806. X   names and values.
  807. X*/
  808. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  809. X{
  810. X    0,    0,    0,    0,
  811. X    0,    0
  812. X};
  813. X
  814. X/* array of FIFO operating mode values
  815. X   These values select the mode to which the UART FIFOs are set when
  816. X   a port is activated. For device types that don't have FIFOs the
  817. X   respective value is ignored, so you can set up this array for
  818. X   FIFO operation now and add the FIFO UARTs later. There are several
  819. X   operating modes predefined. See fas.h for possible names and values.
  820. X*/
  821. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  822. X{
  823. X    FIFO_DEFAULT,
  824. X    FIFO_DEFAULT,
  825. X    FIFO_DEFAULT,
  826. X    FIFO_DEFAULT,
  827. X    FIFO_DEFAULT,
  828. X    FIFO_DEFAULT
  829. X};
  830. X
  831. X/* initialization sequence for serial cards
  832. X   This array contains pairs of values of the form:
  833. X
  834. X        portaddress, value,
  835. X              :
  836. X              :
  837. X        portaddress, value,
  838. X        0
  839. X
  840. X   For every line `value' will be written to `portaddress'. If
  841. X   `value' is replaced with the macro `READ_PORT' then a value
  842. X   is read from `portaddress' instead. The value itself will be
  843. X   discarded. Therefore, this makes only sense if the read access
  844. X   to the port has a side effect like setting or resetting
  845. X   certain flags.
  846. X
  847. X   NOTE: This array *must* be terminated with a value of 0
  848. X         in the portaddress column!
  849. X*/
  850. Xuint    fas_init_seq [] =
  851. X{
  852. X    0x2bf,    0x80,
  853. X    0
  854. X};
  855. X
  856. X/* interrupt acknowledge sequence for serial cards
  857. X   This sequence is executed by the fasintr () function after all pending
  858. X   interrupts on all serial cards have been processed. The contents of this
  859. X   array has the same form as in the fas_init_seq [] array above.
  860. X*/
  861. Xuint    fas_int_ack_seq [] =
  862. X{
  863. X    0
  864. X};
  865. X
  866. X/* initial modem control port info
  867. X   This value is ored into the modem control value for each UART. This is
  868. X   normaly used to force out2 which is used to enable the interrupts of
  869. X   the standard com1 and com2 ports. Several brands of cards have modes
  870. X   that allow them to work in compatible mode like com1 and com2 or as a
  871. X   shared interrupts card. One of these cards is the AST 4-port card. When
  872. X   this card is used in shared interrupts mode out2 must _not_ be set.
  873. X
  874. X   Note: This is one of the major trouble-spots with shared interrupts
  875. X   cards. Check your manual.
  876. X*/
  877. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  878. X{
  879. X    0,    0,    0,    0,
  880. X    MC_SET_OUT2,    MC_SET_OUT2
  881. X};
  882. X
  883. X/* array of modem control flags
  884. X   You can choose which signals to use for modem control. See fas.h
  885. X   for possible names and values. Whether or not modem control is
  886. X   used is determined by the minor device number at open time.
  887. X*/
  888. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  889. X{
  890. X    EO_DTR | EI_DTR | CA_DCD,
  891. X    EO_DTR | EI_DTR | CA_DCD,
  892. X    EO_DTR | EI_DTR | CA_DCD,
  893. X    EO_DTR | EI_DTR | CA_DCD,
  894. X    EO_DTR | EI_DTR | CA_DCD,
  895. X    EO_DTR | EI_DTR | CA_DCD
  896. X};
  897. X
  898. X/* array of hardware flow control flags
  899. X   You can choose which signals to use for hardware handshake. See fas.h
  900. X   for possible names and values. Whether or not hardware handshake is
  901. X   used is determined by the minor device number at open time and by the
  902. X   RTSFLOW/CTSFLOW termio(7) flags.
  903. X*/
  904. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  905. X{
  906. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  907. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  908. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  909. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  910. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  911. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  912. X};
  913. X
  914. X/* array of control register addresses
  915. X   There are serial boards available that have all serial ports
  916. X   multiplexed to one address location in order to save I/O address
  917. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  918. X   by a special register that needs to be written to before the actual
  919. X   port registers can be accessed. This array contains the addresses
  920. X   of these special registers.
  921. X   Enter the addresses on a per unit base. An address of zero
  922. X   disables this feature.
  923. X*/
  924. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  925. X{
  926. X    0,    0,    0,    0,
  927. X    0,    0
  928. X};
  929. X
  930. X/* array of control register values
  931. X   These values are written to the corresponding control register
  932. X   before the first access to the actual port registers. If not only
  933. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  934. X   single registers of the UART chips need to be multiplexed to one
  935. X   address you have to "or" a bit mask (shifted 8 times to the left)
  936. X   to the control register value. This mask determines at which bit
  937. X   locations the UART chip register number is "xored" into the control
  938. X   register value at runtime. This implies that you can also use
  939. X   negative logic by setting the bits in the control register value
  940. X   to 1 at the locations corresponding to the bit mask.
  941. X*/
  942. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  943. X{
  944. X    0,    0,    0,    0,
  945. X    0,    0
  946. X};
  947. X
  948. X/* This is the number of available port layout tables.
  949. X   If this number is changed the arrays below must be filled
  950. X   in accordingly.
  951. X*/
  952. X#define NUM_PORT_LAYOUTS    1
  953. X
  954. X/* array of port layout table selection values
  955. X   These values select the port layout table in fas_layout [] []
  956. X   that is used for the respective port.
  957. X*/
  958. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  959. X{
  960. X    0,    0,    0,    0,
  961. X    0,    0
  962. X};
  963. X
  964. X/* array of port layout tables
  965. X   This two-dimensional array contains the base port offsets of the
  966. X   seven UART registers used by FAS. There are one or more port layout
  967. X   tables that are selected by the values in fas_pl_select [].
  968. X
  969. X   Each port layout table is arranged like this (the position of the values
  970. X   corresponds to the respective UART register acronym):
  971. X
  972. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  973. X*/
  974. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  975. X{
  976. X  {    /* table 0 */
  977. X    0,    1,    2,    3,    4,    5,    6
  978. X  }
  979. X};
  980. X
  981. X/* This is the number of available baud rate tables.
  982. X   You may define up to 256 tables.  If this number is changed
  983. X   the arrays below must be filled in accordingly.
  984. X*/
  985. X#define NUM_BAUD_TABLES    2
  986. X
  987. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  988. X#undef NUM_BAUD_TABLES
  989. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  990. X#endif
  991. X
  992. X/* array of baud rate table selection values
  993. X   These values select the baud rate table in fas_baud [] []
  994. X   that is used for the respective port.
  995. X*/
  996. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  997. X{
  998. X    0,    0,    0,    0,
  999. X    0,    0
  1000. X};
  1001. X
  1002. X/* array of baud rate tables
  1003. X   This two-dimensional array contains the 15 possible UNIX baud rates
  1004. X   plus the baud rate base that these 15 baud rates are derived from. There
  1005. X   are one or more baud rate tables that are selected by the values in
  1006. X   fas_bt_select [].
  1007. X
  1008. X   The values in the baud rate tables are multiplied by ten to allow an
  1009. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  1010. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  1011. X   is also mutiplied by ten to make its scale match the scale of the baud
  1012. X   rate values.
  1013. X
  1014. X   Each baud rate table is arranged like this (the position of the values
  1015. X   corresponds to the respective baud rate symbol):
  1016. X
  1017. X    BASE,        B50,        B75,        B110,
  1018. X    B134,        B150,        B200,        B300,
  1019. X    B600,        B1200,        B1800,        B2400,
  1020. X    B4800,        B9600,        B19200,        B38400
  1021. X*/
  1022. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  1023. X{
  1024. X  {    /* table 0 */
  1025. X    1152000,    500,        750,        1100,
  1026. X    1345,        1500,        2000,        3000,
  1027. X    6000,        12000,        18000,        24000,
  1028. X    48000,        96000,        192000,        384000
  1029. X  },
  1030. X  {    /* table 1 */
  1031. X    1152000,    500,        750,        1100,
  1032. X    1345,        1500,        2000,        3000,
  1033. X    6000,        12000,        18000,        24000,
  1034. X    48000,        96000,        576000,        1152000
  1035. X  }
  1036. X};
  1037. X
  1038. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1039. X   ============================================
  1040. X*/
  1041. X
  1042. X/* let the driver know the number of devices */
  1043. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1044. X
  1045. X/* let the driver know the number of port layout tables */
  1046. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  1047. X
  1048. X/* let the driver know the number of baud rate tables */
  1049. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  1050. X
  1051. X/* array of structures to hold all info for a physical minor device */
  1052. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  1053. X
  1054. X/* array of tty structures for logical devices */
  1055. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1056. X
  1057. X/* array of fas_speed structure arrays that contain baud rate dependent
  1058. X   informations
  1059. X*/
  1060. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  1061. X
  1062. X/* array of pointers to fas_internals structures
  1063. X   this prevents time consuming multiplications for index calculation
  1064. X*/
  1065. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  1066. X
  1067. X/* array of pointers to tty structures
  1068. X   this prevents time consuming multiplications for index calculation
  1069. X*/
  1070. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1071. X
  1072. X/* array of pointers to fas_speed structure arrays
  1073. X   this prevents time consuming multiplications for index calculation
  1074. X*/
  1075. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  1076. X
  1077. X/* array of pointers to the baud rate tables in fas_baud [] []
  1078. X   this prevents time consuming multiplications for index calculation
  1079. X*/
  1080. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  1081. SHAR_EOF
  1082. true || echo 'restore of space-ast4c12 failed'
  1083. rm -f _shar_wnt_.tmp
  1084. fi
  1085. # ============= space-ast8c12 ==============
  1086. if test -f 'space-ast8c12' -a X"$1" != X"-c"; then
  1087.     echo 'x - skipping space-ast8c12 (File already exists)'
  1088.     rm -f _shar_wnt_.tmp
  1089. else
  1090. > _shar_wnt_.tmp
  1091. echo 'x - extracting space-ast8c12 (Text)'
  1092. sed 's/^X//' << 'SHAR_EOF' > 'space-ast8c12' &&
  1093. X/* Device configuration file for the FAS async driver. */
  1094. X
  1095. X/* This version is for two AST 4-port cards (or a card with two AST 4-port
  1096. X   blocks on a single PCB) in shared interrupts mode plus the standard COM1
  1097. X   and COM2 ports.
  1098. X*/
  1099. X/* FAS was developed by
  1100. XUwe Doering <fas@geminix.in-berlin.de>
  1101. XBillstedter Pfad 17 b
  1102. X13591 Berlin
  1103. XGermany
  1104. X*/
  1105. X
  1106. X#if !defined (M_I286)
  1107. X#ident    "@(#)space.c    2.11"
  1108. X#endif
  1109. X
  1110. X#if defined (LOCAL_INCLUDE)
  1111. X#include "fas.h"
  1112. X#else
  1113. X#include <sys/fas.h>
  1114. X#endif
  1115. X
  1116. X/* This is the number of devices to be handled by this driver.
  1117. X   If it is changed, make sure that the initializer parts of all arrays
  1118. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1119. X   entries. You may define up to 16 devices.
  1120. X*/
  1121. X#define NUM_PHYSICAL_UNITS    10
  1122. X
  1123. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1124. X#undef NUM_PHYSICAL_UNITS
  1125. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1126. X#endif
  1127. X
  1128. X/* array of base port addresses
  1129. X   These values are the base i/o addresses of the UART chips.
  1130. X*/
  1131. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1132. X{
  1133. X    0x2a0,    0x2a8,    0x2b0,    0x2b8,
  1134. X    0x1a0,    0x1a8,    0x1b0,    0x1b8,
  1135. X    0x3f8,    0x2f8
  1136. X};
  1137. X
  1138. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1139. X   FAS doesn't need informations about interrupt vectors during normal
  1140. X   operation. Therefore, the only function of these values is to be
  1141. X   displayed by the FAS boot message. So if you want vector infos at
  1142. X   boot time you can enter the vector numbers here. But make sure that
  1143. X   the values correspond with the entries in the kernel config files.
  1144. X   A value of `-1' means that no vector number is displayed for the
  1145. X   respective port.
  1146. X   Users of other UNIX flavors can savely ignore this array.
  1147. X*/
  1148. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1149. X{
  1150. X    -1,    -1,    -1,    -1,
  1151. X    -1,    -1,    -1,    -1,
  1152. X    -1,    -1
  1153. X};
  1154. X
  1155. X/* array of modifier flags
  1156. X   You can modify certain features of each port. See fas.h for possible
  1157. X   names and values.
  1158. X*/
  1159. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1160. X{
  1161. X    0,    0,    0,    0,
  1162. X    0,    0,    0,    0,
  1163. X    0,    0
  1164. X};
  1165. X
  1166. X/* array of FIFO operating mode values
  1167. X   These values select the mode to which the UART FIFOs are set when
  1168. X   a port is activated. For device types that don't have FIFOs the
  1169. X   respective value is ignored, so you can set up this array for
  1170. X   FIFO operation now and add the FIFO UARTs later. There are several
  1171. X   operating modes predefined. See fas.h for possible names and values.
  1172. X*/
  1173. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1174. X{
  1175. X    FIFO_DEFAULT,
  1176. X    FIFO_DEFAULT,
  1177. X    FIFO_DEFAULT,
  1178. X    FIFO_DEFAULT,
  1179. X    FIFO_DEFAULT,
  1180. X    FIFO_DEFAULT,
  1181. X    FIFO_DEFAULT,
  1182. X    FIFO_DEFAULT,
  1183. X    FIFO_DEFAULT,
  1184. X    FIFO_DEFAULT
  1185. X};
  1186. X
  1187. X/* initialization sequence for serial cards
  1188. X   This array contains pairs of values of the form:
  1189. X
  1190. X        portaddress, value,
  1191. X              :
  1192. X              :
  1193. X        portaddress, value,
  1194. X        0
  1195. X
  1196. X   For every line `value' will be written to `portaddress'. If
  1197. X   `value' is replaced with the macro `READ_PORT' then a value
  1198. X   is read from `portaddress' instead. The value itself will be
  1199. X   discarded. Therefore, this makes only sense if the read access
  1200. X   to the port has a side effect like setting or resetting
  1201. X   certain flags.
  1202. X
  1203. X   NOTE: This array *must* be terminated with a value of 0
  1204. X         in the portaddress column!
  1205. X*/
  1206. Xuint    fas_init_seq [] =
  1207. X{
  1208. X    0x2bf,    0x80,
  1209. X    0x1bf,    0x80,
  1210. X    0
  1211. X};
  1212. X
  1213. X/* interrupt acknowledge sequence for serial cards
  1214. X   This sequence is executed by the fasintr () function after all pending
  1215. X   interrupts on all serial cards have been processed. The contents of this
  1216. X   array has the same form as in the fas_init_seq [] array above.
  1217. X*/
  1218. Xuint    fas_int_ack_seq [] =
  1219. X{
  1220. X    0
  1221. X};
  1222. X
  1223. X/* initial modem control port info
  1224. X   This value is ored into the modem control value for each UART. This is
  1225. X   normaly used to force out2 which is used to enable the interrupts of
  1226. X   the standard com1 and com2 ports. Several brands of cards have modes
  1227. X   that allow them to work in compatible mode like com1 and com2 or as a
  1228. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1229. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1230. X
  1231. X   Note: This is one of the major trouble-spots with shared interrupts
  1232. X   cards. Check your manual.
  1233. X*/
  1234. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1235. X{
  1236. X    0,    0,    0,    0,
  1237. X    0,    0,    0,    0,
  1238. X    MC_SET_OUT2,    MC_SET_OUT2
  1239. X};
  1240. X
  1241. X/* array of modem control flags
  1242. X   You can choose which signals to use for modem control. See fas.h
  1243. X   for possible names and values. Whether or not modem control is
  1244. X   used is determined by the minor device number at open time.
  1245. X*/
  1246. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1247. X{
  1248. X    EO_DTR | EI_DTR | CA_DCD,
  1249. X    EO_DTR | EI_DTR | CA_DCD,
  1250. X    EO_DTR | EI_DTR | CA_DCD,
  1251. X    EO_DTR | EI_DTR | CA_DCD,
  1252. X    EO_DTR | EI_DTR | CA_DCD,
  1253. X    EO_DTR | EI_DTR | CA_DCD,
  1254. X    EO_DTR | EI_DTR | CA_DCD,
  1255. X    EO_DTR | EI_DTR | CA_DCD,
  1256. X    EO_DTR | EI_DTR | CA_DCD,
  1257. X    EO_DTR | EI_DTR | CA_DCD
  1258. X};
  1259. X
  1260. X/* array of hardware flow control flags
  1261. X   You can choose which signals to use for hardware handshake. See fas.h
  1262. X   for possible names and values. Whether or not hardware handshake is
  1263. X   used is determined by the minor device number at open time and by the
  1264. X   RTSFLOW/CTSFLOW termio(7) flags.
  1265. X*/
  1266. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1267. X{
  1268. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1269. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1270. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1271. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1272. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1273. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1274. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1275. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1276. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1277. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1278. X};
  1279. X
  1280. X/* array of control register addresses
  1281. X   There are serial boards available that have all serial ports
  1282. X   multiplexed to one address location in order to save I/O address
  1283. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1284. X   by a special register that needs to be written to before the actual
  1285. X   port registers can be accessed. This array contains the addresses
  1286. X   of these special registers.
  1287. X   Enter the addresses on a per unit base. An address of zero
  1288. X   disables this feature.
  1289. X*/
  1290. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1291. X{
  1292. X    0,    0,    0,    0,
  1293. X    0,    0,    0,    0,
  1294. X    0,    0
  1295. X};
  1296. X
  1297. X/* array of control register values
  1298. X   These values are written to the corresponding control register
  1299. X   before the first access to the actual port registers. If not only
  1300. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1301. X   single registers of the UART chips need to be multiplexed to one
  1302. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1303. X   to the control register value. This mask determines at which bit
  1304. X   locations the UART chip register number is "xored" into the control
  1305. X   register value at runtime. This implies that you can also use
  1306. X   negative logic by setting the bits in the control register value
  1307. X   to 1 at the locations corresponding to the bit mask.
  1308. X*/
  1309. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1310. X{
  1311. X    0,    0,    0,    0,
  1312. X    0,    0,    0,    0,
  1313. X    0,    0
  1314. X};
  1315. X
  1316. X/* This is the number of available port layout tables.
  1317. X   If this number is changed the arrays below must be filled
  1318. X   in accordingly.
  1319. X*/
  1320. X#define NUM_PORT_LAYOUTS    1
  1321. X
  1322. X/* array of port layout table selection values
  1323. X   These values select the port layout table in fas_layout [] []
  1324. X   that is used for the respective port.
  1325. X*/
  1326. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  1327. X{
  1328. X    0,    0,    0,    0,
  1329. X    0,    0,    0,    0,
  1330. X    0,    0
  1331. X};
  1332. X
  1333. X/* array of port layout tables
  1334. X   This two-dimensional array contains the base port offsets of the
  1335. X   seven UART registers used by FAS. There are one or more port layout
  1336. X   tables that are selected by the values in fas_pl_select [].
  1337. X
  1338. X   Each port layout table is arranged like this (the position of the values
  1339. X   corresponds to the respective UART register acronym):
  1340. X
  1341. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  1342. X*/
  1343. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  1344. X{
  1345. X  {    /* table 0 */
  1346. X    0,    1,    2,    3,    4,    5,    6
  1347. X  }
  1348. X};
  1349. X
  1350. X/* This is the number of available baud rate tables.
  1351. X   You may define up to 256 tables.  If this number is changed
  1352. X   the arrays below must be filled in accordingly.
  1353. X*/
  1354. X#define NUM_BAUD_TABLES    2
  1355. X
  1356. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  1357. X#undef NUM_BAUD_TABLES
  1358. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  1359. X#endif
  1360. X
  1361. X/* array of baud rate table selection values
  1362. X   These values select the baud rate table in fas_baud [] []
  1363. X   that is used for the respective port.
  1364. X*/
  1365. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  1366. X{
  1367. X    0,    0,    0,    0,
  1368. X    0,    0,    0,    0,
  1369. X    0,    0
  1370. X};
  1371. X
  1372. X/* array of baud rate tables
  1373. X   This two-dimensional array contains the 15 possible UNIX baud rates
  1374. X   plus the baud rate base that these 15 baud rates are derived from. There
  1375. X   are one or more baud rate tables that are selected by the values in
  1376. X   fas_bt_select [].
  1377. X
  1378. X   The values in the baud rate tables are multiplied by ten to allow an
  1379. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  1380. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  1381. X   is also mutiplied by ten to make its scale match the scale of the baud
  1382. X   rate values.
  1383. X
  1384. X   Each baud rate table is arranged like this (the position of the values
  1385. X   corresponds to the respective baud rate symbol):
  1386. X
  1387. X    BASE,        B50,        B75,        B110,
  1388. X    B134,        B150,        B200,        B300,
  1389. X    B600,        B1200,        B1800,        B2400,
  1390. X    B4800,        B9600,        B19200,        B38400
  1391. X*/
  1392. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  1393. X{
  1394. X  {    /* table 0 */
  1395. X    1152000,    500,        750,        1100,
  1396. X    1345,        1500,        2000,        3000,
  1397. X    6000,        12000,        18000,        24000,
  1398. X    48000,        96000,        192000,        384000
  1399. X  },
  1400. X  {    /* table 1 */
  1401. X    1152000,    500,        750,        1100,
  1402. X    1345,        1500,        2000,        3000,
  1403. X    6000,        12000,        18000,        24000,
  1404. X    48000,        96000,        576000,        1152000
  1405. X  }
  1406. X};
  1407. X
  1408. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1409. X   ============================================
  1410. X*/
  1411. X
  1412. X/* let the driver know the number of devices */
  1413. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1414. X
  1415. X/* let the driver know the number of port layout tables */
  1416. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  1417. X
  1418. X/* let the driver know the number of baud rate tables */
  1419. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  1420. X
  1421. X/* array of structures to hold all info for a physical minor device */
  1422. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  1423. X
  1424. X/* array of tty structures for logical devices */
  1425. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1426. X
  1427. X/* array of fas_speed structure arrays that contain baud rate dependent
  1428. X   informations
  1429. X*/
  1430. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  1431. X
  1432. X/* array of pointers to fas_internals structures
  1433. X   this prevents time consuming multiplications for index calculation
  1434. X*/
  1435. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  1436. X
  1437. X/* array of pointers to tty structures
  1438. X   this prevents time consuming multiplications for index calculation
  1439. X*/
  1440. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1441. X
  1442. X/* array of pointers to fas_speed structure arrays
  1443. X   this prevents time consuming multiplications for index calculation
  1444. X*/
  1445. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  1446. X
  1447. X/* array of pointers to the baud rate tables in fas_baud [] []
  1448. X   this prevents time consuming multiplications for index calculation
  1449. X*/
  1450. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  1451. SHAR_EOF
  1452. true || echo 'restore of space-ast8c12 failed'
  1453. rm -f _shar_wnt_.tmp
  1454. fi
  1455. # ============= space-c123 ==============
  1456. if test -f 'space-c123' -a X"$1" != X"-c"; then
  1457.     echo 'x - skipping space-c123 (File already exists)'
  1458.     rm -f _shar_wnt_.tmp
  1459. else
  1460. > _shar_wnt_.tmp
  1461. echo 'x - extracting space-c123 (Text)'
  1462. sed 's/^X//' << 'SHAR_EOF' > 'space-c123' &&
  1463. X/* Device configuration file for the FAS async driver. */
  1464. X
  1465. X/* This version is for the standard COM1 and COM2 and additional COM3
  1466. X   ports.
  1467. X*/
  1468. X/* FAS was developed by
  1469. XUwe Doering <fas@geminix.in-berlin.de>
  1470. XBillstedter Pfad 17 b
  1471. X13591 Berlin
  1472. XGermany
  1473. X*/
  1474. X
  1475. X#if !defined (M_I286)
  1476. X#ident    "@(#)space.c    2.11"
  1477. X#endif
  1478. X
  1479. X#if defined (LOCAL_INCLUDE)
  1480. X#include "fas.h"
  1481. X#else
  1482. X#include <sys/fas.h>
  1483. X#endif
  1484. X
  1485. X/* This is the number of devices to be handled by this driver.
  1486. X   If it is changed, make sure that the initializer parts of all arrays
  1487. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1488. X   entries. You may define up to 16 devices.
  1489. X*/
  1490. X#define NUM_PHYSICAL_UNITS    3
  1491. X
  1492. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1493. X#undef NUM_PHYSICAL_UNITS
  1494. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1495. X#endif
  1496. X
  1497. X/* array of base port addresses
  1498. X   These values are the base i/o addresses of the UART chips.
  1499. X*/
  1500. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1501. X{
  1502. X    0x3f8,    0x2f8,    0x3e8
  1503. X};
  1504. X
  1505. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1506. X   FAS doesn't need informations about interrupt vectors during normal
  1507. X   operation. Therefore, the only function of these values is to be
  1508. X   displayed by the FAS boot message. So if you want vector infos at
  1509. X   boot time you can enter the vector numbers here. But make sure that
  1510. X   the values correspond with the entries in the kernel config files.
  1511. X   A value of `-1' means that no vector number is displayed for the
  1512. X   respective port.
  1513. X   Users of other UNIX flavors can savely ignore this array.
  1514. X*/
  1515. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1516. X{
  1517. X    -1,    -1,    -1
  1518. X};
  1519. X
  1520. X/* array of modifier flags
  1521. X   You can modify certain features of each port. See fas.h for possible
  1522. X   names and values.
  1523. X*/
  1524. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1525. X{
  1526. X    0,    0,    0
  1527. X};
  1528. X
  1529. X/* array of FIFO operating mode values
  1530. X   These values select the mode to which the UART FIFOs are set when
  1531. X   a port is activated. For device types that don't have FIFOs the
  1532. X   respective value is ignored, so you can set up this array for
  1533. X   FIFO operation now and add the FIFO UARTs later. There are several
  1534. X   operating modes predefined. See fas.h for possible names and values.
  1535. X*/
  1536. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1537. X{
  1538. X    FIFO_DEFAULT,
  1539. X    FIFO_DEFAULT,
  1540. X    FIFO_DEFAULT
  1541. X};
  1542. X
  1543. X/* initialization sequence for serial cards
  1544. X   This array contains pairs of values of the form:
  1545. X
  1546. X        portaddress, value,
  1547. X              :
  1548. X              :
  1549. X        portaddress, value,
  1550. X        0
  1551. X
  1552. X   For every line `value' will be written to `portaddress'. If
  1553. X   `value' is replaced with the macro `READ_PORT' then a value
  1554. X   is read from `portaddress' instead. The value itself will be
  1555. X   discarded. Therefore, this makes only sense if the read access
  1556. X   to the port has a side effect like setting or resetting
  1557. X   certain flags.
  1558. X
  1559. X   NOTE: This array *must* be terminated with a value of 0
  1560. X         in the portaddress column!
  1561. X*/
  1562. Xuint    fas_init_seq [] =
  1563. X{
  1564. X    0
  1565. X};
  1566. X
  1567. X/* interrupt acknowledge sequence for serial cards
  1568. X   This sequence is executed by the fasintr () function after all pending
  1569. X   interrupts on all serial cards have been processed. The contents of this
  1570. X   array has the same form as in the fas_init_seq [] array above.
  1571. X*/
  1572. Xuint    fas_int_ack_seq [] =
  1573. X{
  1574. X    0
  1575. X};
  1576. X
  1577. X/* initial modem control port info
  1578. X   This value is ored into the modem control value for each UART. This is
  1579. X   normaly used to force out2 which is used to enable the interrupts of
  1580. X   the standard com1 and com2 ports. Several brands of cards have modes
  1581. X   that allow them to work in compatible mode like com1 and com2 or as a
  1582. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1583. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1584. X
  1585. X   Note: This is one of the major trouble-spots with shared interrupts
  1586. X   cards. Check your manual.
  1587. X*/
  1588. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1589. X{
  1590. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2
  1591. X};
  1592. X
  1593. X/* array of modem control flags
  1594. X   You can choose which signals to use for modem control. See fas.h
  1595. X   for possible names and values. Whether or not modem control is
  1596. X   used is determined by the minor device number at open time.
  1597. X*/
  1598. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1599. X{
  1600. X    EO_DTR | EI_DTR | CA_DCD,
  1601. X    EO_DTR | EI_DTR | CA_DCD,
  1602. X    EO_DTR | EI_DTR | CA_DCD
  1603. X};
  1604. X
  1605. X/* array of hardware flow control flags
  1606. X   You can choose which signals to use for hardware handshake. See fas.h
  1607. X   for possible names and values. Whether or not hardware handshake is
  1608. X   used is determined by the minor device number at open time and by the
  1609. X   RTSFLOW/CTSFLOW termio(7) flags.
  1610. X*/
  1611. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1612. X{
  1613. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1614. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1615. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1616. X};
  1617. X
  1618. X/* array of control register addresses
  1619. X   There are serial boards available that have all serial ports
  1620. X   multiplexed to one address location in order to save I/O address
  1621. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1622. X   by a special register that needs to be written to before the actual
  1623. X   port registers can be accessed. This array contains the addresses
  1624. X   of these special registers.
  1625. X   Enter the addresses on a per unit base. An address of zero
  1626. X   disables this feature.
  1627. X*/
  1628. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1629. X{
  1630. X    0,    0,    0
  1631. X};
  1632. X
  1633. X/* array of control register values
  1634. X   These values are written to the corresponding control register
  1635. X   before the first access to the actual port registers. If not only
  1636. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1637. X   single registers of the UART chips need to be multiplexed to one
  1638. X   address you have to "or" a bit mask (shifted 8 times to the left)
  1639. X   to the control register value. This mask determines at which bit
  1640. X   locations the UART chip register number is "xored" into the control
  1641. X   register value at runtime. This implies that you can also use
  1642. X   negative logic by setting the bits in the control register value
  1643. X   to 1 at the locations corresponding to the bit mask.
  1644. X*/
  1645. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  1646. X{
  1647. X    0,    0,    0
  1648. X};
  1649. X
  1650. X/* This is the number of available port layout tables.
  1651. X   If this number is changed the arrays below must be filled
  1652. X   in accordingly.
  1653. X*/
  1654. X#define NUM_PORT_LAYOUTS    1
  1655. X
  1656. X/* array of port layout table selection values
  1657. X   These values select the port layout table in fas_layout [] []
  1658. X   that is used for the respective port.
  1659. X*/
  1660. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  1661. X{
  1662. X    0,    0,    0
  1663. X};
  1664. X
  1665. X/* array of port layout tables
  1666. X   This two-dimensional array contains the base port offsets of the
  1667. X   seven UART registers used by FAS. There are one or more port layout
  1668. X   tables that are selected by the values in fas_pl_select [].
  1669. X
  1670. X   Each port layout table is arranged like this (the position of the values
  1671. X   corresponds to the respective UART register acronym):
  1672. X
  1673. X    RBR/THR, IER,    IIR/FCR, LCR,    MCR,    LSR,    MSR
  1674. X*/
  1675. Xuint    fas_layout [NUM_PORT_LAYOUTS] [NUM_UART_REGS] =
  1676. X{
  1677. X  {    /* table 0 */
  1678. X    0,    1,    2,    3,    4,    5,    6
  1679. X  }
  1680. X};
  1681. X
  1682. X/* This is the number of available baud rate tables.
  1683. X   You may define up to 256 tables.  If this number is changed
  1684. X   the arrays below must be filled in accordingly.
  1685. X*/
  1686. X#define NUM_BAUD_TABLES    2
  1687. X
  1688. X#if NUM_BAUD_TABLES > MAX_BAUD_TABLES
  1689. X#undef NUM_BAUD_TABLES
  1690. X#define NUM_BAUD_TABLES    MAX_BAUD_TABLES
  1691. X#endif
  1692. X
  1693. X/* array of baud rate table selection values
  1694. X   These values select the baud rate table in fas_baud [] []
  1695. X   that is used for the respective port.
  1696. X*/
  1697. Xuint    fas_bt_select [NUM_PHYSICAL_UNITS] =
  1698. X{
  1699. X    0,    0,    0
  1700. X};
  1701. X
  1702. X/* array of baud rate tables
  1703. X   This two-dimensional array contains the 15 possible UNIX baud rates
  1704. X   plus the baud rate base that these 15 baud rates are derived from. There
  1705. X   are one or more baud rate tables that are selected by the values in
  1706. X   fas_bt_select [].
  1707. X
  1708. X   The values in the baud rate tables are multiplied by ten to allow an
  1709. X   accuracy of 0.1 baud. The baud rate base can be computed by dividing the
  1710. X   external oscillator frequency (fed to the UART) by 16, and afterwards it
  1711. X   is also mutiplied by ten to make its scale match the scale of the baud
  1712. X   rate values.
  1713. X
  1714. X   Each baud rate table is arranged like this (the position of the values
  1715. X   corresponds to the respective baud rate symbol):
  1716. X
  1717. X    BASE,        B50,        B75,        B110,
  1718. X    B134,        B150,        B200,        B300,
  1719. X    B600,        B1200,        B1800,        B2400,
  1720. X    B4800,        B9600,        B19200,        B38400
  1721. X*/
  1722. Xulong    fas_baud [NUM_BAUD_TABLES] [CBAUD + 1] =
  1723. X{
  1724. X  {    /* table 0 */
  1725. X    1152000,    500,        750,        1100,
  1726. X    1345,        1500,        2000,        3000,
  1727. X    6000,        12000,        18000,        24000,
  1728. X    48000,        96000,        192000,        384000
  1729. X  },
  1730. X  {    /* table 1 */
  1731. X    1152000,    500,        750,        1100,
  1732. X    1345,        1500,        2000,        3000,
  1733. X    6000,        12000,        18000,        24000,
  1734. X    48000,        96000,        576000,        1152000
  1735. X  }
  1736. X};
  1737. X
  1738. X/* NOTHING NEEDS TO BE CHANGED BELOW THIS LINE.
  1739. X   ============================================
  1740. X*/
  1741. X
  1742. X/* let the driver know the number of devices */
  1743. Xuint    fas_physical_units = NUM_PHYSICAL_UNITS;
  1744. X
  1745. X/* let the driver know the number of port layout tables */
  1746. Xuint    fas_port_layouts = NUM_PORT_LAYOUTS;
  1747. X
  1748. X/* let the driver know the number of baud rate tables */
  1749. Xuint    fas_baud_tables = NUM_BAUD_TABLES;
  1750. X
  1751. X/* array of structures to hold all info for a physical minor device */
  1752. Xstruct fas_internals    fas_internals [NUM_PHYSICAL_UNITS];
  1753. X
  1754. X/* array of tty structures for logical devices */
  1755. Xstruct tty    fas_tty [NUM_PHYSICAL_UNITS * 2];
  1756. X
  1757. X/* array of fas_speed structure arrays that contain baud rate dependent
  1758. X   informations
  1759. X*/
  1760. Xstruct fas_speed    fas_speed [NUM_BAUD_TABLES] [CBAUD + 1];
  1761. X
  1762. X/* array of pointers to fas_internals structures
  1763. X   this prevents time consuming multiplications for index calculation
  1764. X*/
  1765. Xstruct fas_internals    *fas_internals_ptr [NUM_PHYSICAL_UNITS];
  1766. X
  1767. X/* array of pointers to tty structures
  1768. X   this prevents time consuming multiplications for index calculation
  1769. X*/
  1770. Xstruct tty    *fas_tty_ptr [NUM_PHYSICAL_UNITS * 2];
  1771. X
  1772. X/* array of pointers to fas_speed structure arrays
  1773. X   this prevents time consuming multiplications for index calculation
  1774. X*/
  1775. Xstruct fas_speed    *fas_speed_ptr [NUM_BAUD_TABLES];
  1776. X
  1777. X/* array of pointers to the baud rate tables in fas_baud [] []
  1778. X   this prevents time consuming multiplications for index calculation
  1779. X*/
  1780. Xulong    *fas_baud_ptr [NUM_BAUD_TABLES];
  1781. SHAR_EOF
  1782. true || echo 'restore of space-c123 failed'
  1783. rm -f _shar_wnt_.tmp
  1784. fi
  1785. # ============= space-gen8c12 ==============
  1786. if test -f 'space-gen8c12' -a X"$1" != X"-c"; then
  1787.     echo 'x - skipping space-gen8c12 (File already exists)'
  1788.     rm -f _shar_wnt_.tmp
  1789. else
  1790. > _shar_wnt_.tmp
  1791. echo 'x - extracting space-gen8c12 (Text)'
  1792. sed 's/^X//' << 'SHAR_EOF' > 'space-gen8c12' &&
  1793. X/* Device configuration file for the FAS async driver. */
  1794. X
  1795. X/* This is a generic version for 8-port cards plus the standard
  1796. X   COM1 and COM2 ports.
  1797. X*/
  1798. X/* FAS was developed by
  1799. XUwe Doering <fas@geminix.in-berlin.de>
  1800. XBillstedter Pfad 17 b
  1801. X13591 Berlin
  1802. XGermany
  1803. X*/
  1804. X
  1805. X#if !defined (M_I286)
  1806. X#ident    "@(#)space.c    2.11"
  1807. X#endif
  1808. X
  1809. X#if defined (LOCAL_INCLUDE)
  1810. X#include "fas.h"
  1811. X#else
  1812. X#include <sys/fas.h>
  1813. X#endif
  1814. X
  1815. X/* This is the number of devices to be handled by this driver.
  1816. X   If it is changed, make sure that the initializer parts of all arrays
  1817. X   dimensioned with `NUM_PHYSICAL_UNITS' have a corresponding number of
  1818. X   entries. You may define up to 16 devices.
  1819. X*/
  1820. X#define NUM_PHYSICAL_UNITS    10
  1821. X
  1822. X#if NUM_PHYSICAL_UNITS > MAX_UNITS
  1823. X#undef NUM_PHYSICAL_UNITS
  1824. X#define NUM_PHYSICAL_UNITS    MAX_UNITS
  1825. X#endif
  1826. X
  1827. X/* array of base port addresses
  1828. X   These values are the base i/o addresses of the UART chips.
  1829. X*/
  1830. Xuint    fas_port [NUM_PHYSICAL_UNITS] =
  1831. X{
  1832. X    0x100,    0x108,    0x110,    0x118,
  1833. X    0x120,    0x128,    0x130,    0x138,
  1834. X    0x3f8,    0x2f8
  1835. X};
  1836. X
  1837. X/* array of interrupt vectors (SCO UNIX and Xenix, only)
  1838. X   FAS doesn't need informations about interrupt vectors during normal
  1839. X   operation. Therefore, the only function of these values is to be
  1840. X   displayed by the FAS boot message. So if you want vector infos at
  1841. X   boot time you can enter the vector numbers here. But make sure that
  1842. X   the values correspond with the entries in the kernel config files.
  1843. X   A value of `-1' means that no vector number is displayed for the
  1844. X   respective port.
  1845. X   Users of other UNIX flavors can savely ignore this array.
  1846. X*/
  1847. Xint    fas_vec [NUM_PHYSICAL_UNITS] =
  1848. X{
  1849. X    -1,    -1,    -1,    -1,
  1850. X    -1,    -1,    -1,    -1,
  1851. X    -1,    -1
  1852. X};
  1853. X
  1854. X/* array of modifier flags
  1855. X   You can modify certain features of each port. See fas.h for possible
  1856. X   names and values.
  1857. X*/
  1858. Xuint    fas_modify [NUM_PHYSICAL_UNITS] =
  1859. X{
  1860. X    0,    0,    0,    0,
  1861. X    0,    0,    0,    0,
  1862. X    0,    0
  1863. X};
  1864. X
  1865. X/* array of FIFO operating mode values
  1866. X   These values select the mode to which the UART FIFOs are set when
  1867. X   a port is activated. For device types that don't have FIFOs the
  1868. X   respective value is ignored, so you can set up this array for
  1869. X   FIFO operation now and add the FIFO UARTs later. There are several
  1870. X   operating modes predefined. See fas.h for possible names and values.
  1871. X*/
  1872. Xuint    fas_fifo_ctl [NUM_PHYSICAL_UNITS] =
  1873. X{
  1874. X    FIFO_DEFAULT,
  1875. X    FIFO_DEFAULT,
  1876. X    FIFO_DEFAULT,
  1877. X    FIFO_DEFAULT,
  1878. X    FIFO_DEFAULT,
  1879. X    FIFO_DEFAULT,
  1880. X    FIFO_DEFAULT,
  1881. X    FIFO_DEFAULT,
  1882. X    FIFO_DEFAULT,
  1883. X    FIFO_DEFAULT
  1884. X};
  1885. X
  1886. X/* initialization sequence for serial cards
  1887. X   This array contains pairs of values of the form:
  1888. X
  1889. X        portaddress, value,
  1890. X              :
  1891. X              :
  1892. X        portaddress, value,
  1893. X        0
  1894. X
  1895. X   For every line `value' will be written to `portaddress'. If
  1896. X   `value' is replaced with the macro `READ_PORT' then a value
  1897. X   is read from `portaddress' instead. The value itself will be
  1898. X   discarded. Therefore, this makes only sense if the read access
  1899. X   to the port has a side effect like setting or resetting
  1900. X   certain flags.
  1901. X
  1902. X   NOTE: This array *must* be terminated with a value of 0
  1903. X         in the portaddress column!
  1904. X*/
  1905. Xuint    fas_init_seq [] =
  1906. X{
  1907. X    0
  1908. X};
  1909. X
  1910. X/* interrupt acknowledge sequence for serial cards
  1911. X   This sequence is executed by the fasintr () function after all pending
  1912. X   interrupts on all serial cards have been processed. The contents of this
  1913. X   array has the same form as in the fas_init_seq [] array above.
  1914. X*/
  1915. Xuint    fas_int_ack_seq [] =
  1916. X{
  1917. X    0
  1918. X};
  1919. X
  1920. X/* initial modem control port info
  1921. X   This value is ored into the modem control value for each UART. This is
  1922. X   normaly used to force out2 which is used to enable the interrupts of
  1923. X   the standard com1 and com2 ports. Several brands of cards have modes
  1924. X   that allow them to work in compatible mode like com1 and com2 or as a
  1925. X   shared interrupts card. One of these cards is the AST 4-port card. When
  1926. X   this card is used in shared interrupts mode out2 must _not_ be set.
  1927. X
  1928. X   Note: This is one of the major trouble-spots with shared interrupts
  1929. X   cards. Check your manual.
  1930. X*/
  1931. Xuint    fas_mcb [NUM_PHYSICAL_UNITS] =
  1932. X{
  1933. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,
  1934. X    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,    MC_SET_OUT2,
  1935. X    MC_SET_OUT2,    MC_SET_OUT2
  1936. X};
  1937. X
  1938. X/* array of modem control flags
  1939. X   You can choose which signals to use for modem control. See fas.h
  1940. X   for possible names and values. Whether or not modem control is
  1941. X   used is determined by the minor device number at open time.
  1942. X*/
  1943. Xulong    fas_modem [NUM_PHYSICAL_UNITS] =
  1944. X{
  1945. X    EO_DTR | EI_DTR | CA_DCD,
  1946. X    EO_DTR | EI_DTR | CA_DCD,
  1947. X    EO_DTR | EI_DTR | CA_DCD,
  1948. X    EO_DTR | EI_DTR | CA_DCD,
  1949. X    EO_DTR | EI_DTR | CA_DCD,
  1950. X    EO_DTR | EI_DTR | CA_DCD,
  1951. X    EO_DTR | EI_DTR | CA_DCD,
  1952. X    EO_DTR | EI_DTR | CA_DCD,
  1953. X    EO_DTR | EI_DTR | CA_DCD,
  1954. X    EO_DTR | EI_DTR | CA_DCD
  1955. X};
  1956. X
  1957. X/* array of hardware flow control flags
  1958. X   You can choose which signals to use for hardware handshake. See fas.h
  1959. X   for possible names and values. Whether or not hardware handshake is
  1960. X   used is determined by the minor device number at open time and by the
  1961. X   RTSFLOW/CTSFLOW termio(7) flags.
  1962. X*/
  1963. Xulong    fas_flow [NUM_PHYSICAL_UNITS] =
  1964. X{
  1965. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1966. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1967. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1968. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1969. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1970. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1971. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1972. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1973. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS,
  1974. X    HI_RTS | HO_CTS_ON_DSR | HX_RTS
  1975. X};
  1976. X
  1977. X/* array of control register addresses
  1978. X   There are serial boards available that have all serial ports
  1979. X   multiplexed to one address location in order to save I/O address
  1980. X   space (Bell Tech HUB-6 card etc.). This multiplexing is controlled
  1981. X   by a special register that needs to be written to before the actual
  1982. X   port registers can be accessed. This array contains the addresses
  1983. X   of these special registers.
  1984. X   Enter the addresses on a per unit base. An address of zero
  1985. X   disables this feature.
  1986. X*/
  1987. Xuint    fas_ctl_port [NUM_PHYSICAL_UNITS] =
  1988. X{
  1989. X    0,    0,    0,    0,
  1990. X    0,    0,    0,    0,
  1991. X    0,    0
  1992. X};
  1993. X
  1994. X/* array of control register values
  1995. X   These values are written to the corresponding control register
  1996. X   before the first access to the actual port registers. If not only
  1997. X   entire UART chips (blocks of 8 contiguous addresses) but even the
  1998. X   single registers of the UART chips need to be multiplexed to one
  1999. X   address you have to "or" a bit mask (shifted 8 times to the left)
  2000. X   to the control register value. This mask determines at which bit
  2001. X   locations the UART chip register number is "xored" into the control
  2002. X   register value at runtime. This implies that you can also use
  2003. X   negative logic by setting the bits in the control register value
  2004. X   to 1 at the locations corresponding to the bit mask.
  2005. X*/
  2006. Xuint    fas_ctl_val [NUM_PHYSICAL_UNITS] =
  2007. X{
  2008. X    0,    0,    0,    0,
  2009. X    0,    0,    0,    0,
  2010. X    0,    0
  2011. X};
  2012. X
  2013. X/* This is the number of available port layout tables.
  2014. X   If this number is changed the arrays below must be filled
  2015. X   in accordingly.
  2016. X*/
  2017. X#define NUM_PORT_LAYOUTS    1
  2018. X
  2019. X/* array of port layout table selection values
  2020. X   These values select the port layout table in fas_layout [] []
  2021. X   that is used for the respective port.
  2022. X*/
  2023. Xuint    fas_pl_select [NUM_PHYSICAL_UNITS] =
  2024. X{
  2025. X    0,    0,    0,    0,
  2026. X    0,    0,    0,    0,
  2027. X    0,    0
  2028. X};
  2029. SHAR_EOF
  2030. true || echo 'restore of space-gen8c12 failed'
  2031. fi
  2032. echo 'End of  part 7'
  2033. echo 'File space-gen8c12 is continued in part 8'
  2034. echo 8 > _shar_seq_.tmp
  2035. exit 0
  2036.