summaryrefslogtreecommitdiffstats
path: root/usr.bin/doscmd/com.h
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>2001-10-02 11:28:59 +0000
committertg <tg@FreeBSD.org>2001-10-02 11:28:59 +0000
commit5a5faeb1fdc45ba96f1845430e14e114bf638d07 (patch)
tree15ee4fccd16594c90a39dddc748220e18b5aa6f0 /usr.bin/doscmd/com.h
parentb377b771103513eea4b0a6853c82cc12a35fc3e7 (diff)
downloadFreeBSD-src-5a5faeb1fdc45ba96f1845430e14e114bf638d07.zip
FreeBSD-src-5a5faeb1fdc45ba96f1845430e14e114bf638d07.tar.gz
- First shot at PIC emulation;
- better 8250 emulation; - fake vertical retrace bit in Input Status #1 register (this was lost in the VGA emu rewrite). Submitted by: Igor Serikov <bt@turtle.pangeatech.com>
Diffstat (limited to 'usr.bin/doscmd/com.h')
-rw-r--r--usr.bin/doscmd/com.h59
1 files changed, 15 insertions, 44 deletions
diff --git a/usr.bin/doscmd/com.h b/usr.bin/doscmd/com.h
index b2281d9..495ca88 100644
--- a/usr.bin/doscmd/com.h
+++ b/usr.bin/doscmd/com.h
@@ -34,13 +34,11 @@
/* com.h for doscmd int14.c */
-#define BUFSIZE 1024
-
/* NS16550A register definitions */
/* interrupt enable register */
-#define IE_NOP 0xF0 /* not used */
+#define IE_NOP 0xF0 /* Not used */
#define IE_MODEM_STAT 0x08 /* modem status int. */
#define IE_LINE_STAT 0x04 /* receiver-line status int. */
#define IE_TRANS_HLD 0x02 /* transmitter holding register empty int. */
@@ -49,12 +47,13 @@
/* interrupt identification register */
#define II_FIFOS_EN 0xC0 /* if FIFOs are enabled */
-#define II_NOP 0x38 /* not used */
-#define II_INT_ID 0x06 /* mask: bits see below */
+#define II_NOP 0x30 /* not used */
+#define II_INT_ID 0x0E /* mask: bits see below */
#define II_PEND_INT 0x01 /* 1=no interrupt pending */
/* bit masks for II_INT_ID */
+#define II_TO 0x0C
#define II_LINE_STAT 0x06
#define II_RCV_DATA 0x04
#define II_TRANS_HLD 0x02
@@ -62,6 +61,13 @@
/* FIFO control reg */
+#define FC_FIFO_SZ_MASK 0xC0
+#define FC_FIFO_1B 0x80
+#define FC_FIFO_4B 0x40
+#define FC_FIFO_8B 0x80
+#define FC_FIFO_14B 0xC0
+#define FC_FIFO_CTR 0x04
+#define FC_FIFO_CRV 0x02
#define FC_FIFO_EN 0x01
/* line control register */
@@ -77,8 +83,8 @@
/* line status register */
#define LS_NOP 0x80 /* not used */
-#define LS_X_SHFT_E 0x40 /* 0=data transfer, 1=transmitter idle */
-#define LS_X_HOLD_E 0x20 /* 0=ready, 1=transferring character */
+#define LS_X_DATA_E 0x40 /* 1=empty */
+#define LS_X_HOLD_E 0x20 /* 1=empty */
#define LS_BREAK 0x10 /* break received */
#define LS_FRM_ERR 0x08 /* framing error */
#define LS_PAR_ERR 0x04 /* parity error */
@@ -96,31 +102,6 @@
#define MS_DELTA_DSR 0x02 /* Data Set Ready changed state */
#define MS_DELTA_CTS 0x01 /* Clear To Send changed state */
-/* data structure definitions */
-
-#define N_OF_COM_REGS 8
-
-struct com_data_struct {
- int fd; /* BSD/386 file descriptor */
- char *path; /* BSD/386 pathname */
- int addr; /* ISA I/O address */
- unsigned char irq; /* ISA IRQ */
- unsigned char flags; /* some general software flags */
-
- struct queue *com_queue; /* XXX DEBUG obsolete MCL? */
-
- unsigned char div_latch[2]; /* mirror of 16550 R0':R1' read/write */
- unsigned char last_char_read; /* mirror of 16550 R0 read only */
- unsigned char int_enable; /* mirror of 16550 R1 read/write */
- unsigned char int_id; /* mirror of 16550 R2 read only */
- unsigned char fifo_ctrl; /* mirror of 16550 R2 write only */
- unsigned char line_ctrl; /* mirror of 16550 R3 read/write */
- unsigned char modem_ctrl; /* mirror of 16550 R4 read/write */
- unsigned char line_stat; /* mirror of 16550 R5 read/write */
- unsigned char modem_stat; /* mirror of 16550 R6 read/write */
- unsigned char uart_spare; /* mirror of 16550 R7 read/write */
-};
-
/* DOS definitions -- parameters */
#define BITRATE_110 0x00
@@ -139,25 +120,15 @@ struct com_data_struct {
#define TXLEN_7BITS 0x02
#define TXLEN_8BITS 0x03
+#define N_OF_COM_REGS 8
+
/* DOS definitions -- return codes */
#define LS_SW_TIME_OUT LS_NOP /* return value used by DOS */
-/* miscellaneous definitions */
-
-#define DIV_LATCH_LOW 0
-#define DIV_LATCH_HIGH 1
-
-#define DIV_LATCH_LOW_WRITTEN 0x01
-#define DIV_LATCH_HIGH_WRITTEN 0x02
-#define DIV_LATCH_BOTH_WRITTEN 0x03
-
/* routine declarations */
void int14(regcontext_t *REGS);
-void com_set_line(struct com_data_struct *, unsigned char, unsigned char);
void init_com(int, char *, int, unsigned char);
-u_char com_port_in(int);
-void com_port_out(int, unsigned char);
/* end of file com.h */
OpenPOWER on IntegriCloud