2 * Copyright (c) 2001 Brian Somers <brian@Awfulhak.org>
3 * based on work by Slawa Olhovchenkov
4 * John Prince <johnp@knight-trosoft.com>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 volatile ushort cstart;
39 volatile ushort istart;
45 volatile ushort tpjmp;
46 volatile ushort tcjmp;
48 volatile ushort rpjmp;
62 volatile ushort rhigh;
66 volatile ushort edelay;
68 volatile ushort btime;
70 volatile ushort iflag;
71 volatile ushort oflag;
72 volatile ushort cflag;
73 volatile ushort gmask;
76 volatile ushort delay;
77 volatile ushort imask;
78 volatile ushort tflush;
80 volatile u_char _1[16];
84 volatile u_char bstat;
85 volatile u_char tbusy;
86 volatile u_char iempty;
88 volatile u_char idata;
89 volatile u_char eflag;
91 volatile u_char tflag;
92 volatile u_char rflag;
93 volatile u_char xmask;
95 volatile u_char mstat;
96 volatile u_char mchange;
98 volatile u_char lstat;
100 volatile u_char mtran;
101 volatile u_char orun;
102 volatile u_char startca;
103 volatile u_char stopca;
104 volatile u_char startc;
105 volatile u_char stopc;
106 volatile u_char vnext;
107 volatile u_char hflow;
109 volatile u_char fillc;
110 volatile u_char ochar;
111 volatile u_char omask;
114 volatile u_char _3[28];
117 #define SRXLWATER 0xe0
118 #define SRXHWATER 0xe1
121 #define RESUMETX 0xe4
122 #define SAUXONOFFC 0xe6
123 #define SENDBREAK 0xe8
124 #define SETMODEM 0xe9
125 #define SETIFLAGS 0xeA
127 #define STXLWATER 0xeC
129 #define RESUMERX 0xeF
130 #define RESETCHAN 0xf0
131 #define SETBUFFER 0xf2
132 #define SETCOOKED 0xf3
133 #define SETHFLOW 0xf4
134 #define SETCFLAGS 0xf5
135 #define SETVNEXT 0xf6
136 #define SETBSLICE 0xf7
137 #define SETRSMODE 0xfd
138 #define SETCMDACK 0xfe
141 #define BREAK_IND 0x01
142 #define LOWTX_IND 0x02
143 #define EMPTYTX_IND 0x04
144 #define DATA_IND 0x08
145 #define MODEMCHG_IND 0x20
146 #define RECV_OVR_IND 0x40
147 #define CMD_ACK_IND 0x40
148 #define UART_OVR_IND 0x80
150 #define ALL_IND (BREAK_IND|LOWTX_IND|EMPTYTX_IND|DATA_IND|MODEMCHG_IND)
152 #define FEPTIMEOUT 2000
160 /* #define FEPMASK 0x4 */
162 #define BOTWIN 0x100L
163 #define TOPWIN 0xFF00L
164 #define MISCGLOBAL 0x0C00L
165 #define FEPCODESEG 0x0200L
167 /* #define BIOSCODE 0xff800 */ /* Window 15, offset 7800h */
168 #define FEPCODE 0x0d000
170 #define FEP_CSTART 0x400L
171 #define FEP_CMAX 0x800L
172 #define FEP_ISTART 0x800L
173 #define FEP_IMAX 0xC00L
175 #define FEP_CIN 0xD10L
176 #define FEP_GLOBAL 0xD10L
177 #define FEP_EIN 0xD18L
178 #define FEPSTAT 0xD20L
179 #define CHANSTRUCT 0x1000L
180 #define RXTXBUF 0x4000L
182 #define BIOSOFFSET 0x1000L
183 #define BIOSCODE 0xf800L
184 #define FEPOFFSET 0x2000L
187 #define FEP_CSIZE 0x000030
188 #define FEP_CS5 0x000000
189 #define FEP_CS6 0x000010
190 #define FEP_CS7 0x000020
191 #define FEP_CS8 0x000030
192 #define FEP_CSTOPB 0x000040
193 #define FEP_CREAD 0x000080
194 #define FEP_PARENB 0x000100
195 #define FEP_PARODD 0x000200
196 #define FEP_CLOCAL 0x000800
197 #define FEP_FASTBAUD 0x000400
200 #define FEP_IGNBRK 0000001
201 #define FEP_BRKINT 0000002
202 #define FEP_IGNPAR 0000004
203 #define FEP_PARMRK 0000010
204 #define FEP_INPCK 0000020
205 #define FEP_ISTRIP 0000040
206 #define FEP_IXON 0002000
207 #define FEP_IXANY 0004000
208 #define FEP_IXOFF 0010000