summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
authorbriggs <briggs@cvs.openbsd.org>1996-06-08 16:21:18 +0000
committerbriggs <briggs@cvs.openbsd.org>1996-06-08 16:21:18 +0000
commit2bab80e13b5eaee0ddea9e7da2792683ccbe9e71 (patch)
tree7d239eb7fe87ff54152b3e8d59ab2f6aac76af76 /sys/arch/mac68k
parent4c3cd18b4bdf76dbd4529239affa4193c2d44d4c (diff)
Sync up with latest NetBSD.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/dev/ite.c9
-rw-r--r--sys/arch/mac68k/dev/mac68k5380.c4
-rw-r--r--sys/arch/mac68k/dev/ncr5380.c8
-rw-r--r--sys/arch/mac68k/dev/sbc.c51
-rw-r--r--sys/arch/mac68k/dev/z8530tty.c5
-rw-r--r--sys/arch/mac68k/dev/zs.c64
-rw-r--r--sys/arch/mac68k/include/cpu.h10
-rw-r--r--sys/arch/mac68k/include/viareg.h5
-rw-r--r--sys/arch/mac68k/include/z8530var.h8
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c27
-rw-r--r--sys/arch/mac68k/mac68k/mem.c23
-rw-r--r--sys/arch/mac68k/mac68k/via.c24
12 files changed, 178 insertions, 60 deletions
diff --git a/sys/arch/mac68k/dev/ite.c b/sys/arch/mac68k/dev/ite.c
index 645c1faa39e..499c550a22b 100644
--- a/sys/arch/mac68k/dev/ite.c
+++ b/sys/arch/mac68k/dev/ite.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ite.c,v 1.3 1996/05/26 18:35:27 briggs Exp $ */
-/* $NetBSD: ite.c,v 1.22 1996/05/25 00:56:38 briggs Exp $ */
+/* $OpenBSD: ite.c,v 1.4 1996/06/08 16:21:10 briggs Exp $ */
+/* $NetBSD: ite.c,v 1.23 1996/06/01 00:13:39 scottr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -833,9 +833,10 @@ iteopen(dev, mode, devtype, p)
if (!ite_initted)
return (ENXIO);
- if (ite_tty == NULL)
+ if (ite_tty == NULL) {
tp = ite_tty = ttymalloc();
- else
+ tty_attach(tp);
+ } else
tp = ite_tty;
if ((tp->t_state & (TS_ISOPEN | TS_XCLUDE)) == (TS_ISOPEN | TS_XCLUDE)
&& p->p_ucred->cr_uid != 0)
diff --git a/sys/arch/mac68k/dev/mac68k5380.c b/sys/arch/mac68k/dev/mac68k5380.c
index b5956522c4d..675350b5696 100644
--- a/sys/arch/mac68k/dev/mac68k5380.c
+++ b/sys/arch/mac68k/dev/mac68k5380.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mac68k5380.c,v 1.5 1996/05/26 18:35:28 briggs Exp $ */
-/* $NetBSD: mac68k5380.c,v 1.24 1996/05/25 16:42:24 briggs Exp $ */
+/* $OpenBSD: mac68k5380.c,v 1.6 1996/06/08 16:21:11 briggs Exp $ */
+/* $NetBSD: mac68k5380.c,v 1.25 1996/06/07 01:45:43 briggs Exp $ */
/*
* Copyright (c) 1995 Allen Briggs
diff --git a/sys/arch/mac68k/dev/ncr5380.c b/sys/arch/mac68k/dev/ncr5380.c
index 0b581a1f383..f4359ba4a1b 100644
--- a/sys/arch/mac68k/dev/ncr5380.c
+++ b/sys/arch/mac68k/dev/ncr5380.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ncr5380.c,v 1.7 1996/05/26 18:35:30 briggs Exp $ */
-/* $NetBSD: ncr5380.c,v 1.29 1996/05/22 17:16:45 briggs Exp $ */
+/* $OpenBSD: ncr5380.c,v 1.8 1996/06/08 16:21:11 briggs Exp $ */
+/* $NetBSD: ncr5380.c,v 1.30 1996/06/07 02:44:15 briggs Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@@ -128,7 +128,7 @@ u_char opcode;
*/
extern __inline__ int wait_req_true(void)
{
- int timeout = 25000;
+ int timeout = 2500000;
while (!(GET_5380_REG(NCR5380_IDSTAT) & SC_S_REQ) && --timeout)
delay(1);
@@ -141,7 +141,7 @@ extern __inline__ int wait_req_true(void)
*/
extern __inline__ int wait_req_false(void)
{
- int timeout = 25000;
+ int timeout = 2500000;
while ((GET_5380_REG(NCR5380_IDSTAT) & SC_S_REQ) && --timeout)
delay(1);
diff --git a/sys/arch/mac68k/dev/sbc.c b/sys/arch/mac68k/dev/sbc.c
index b46460122dd..bfeb2980e6b 100644
--- a/sys/arch/mac68k/dev/sbc.c
+++ b/sys/arch/mac68k/dev/sbc.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sbc.c,v 1.1 1996/05/26 19:02:09 briggs Exp $ */
-/* $NetBSD: sbc.c,v 1.6 1996/05/08 03:44:56 scottr Exp $ */
+/* $OpenBSD: sbc.c,v 1.2 1996/06/08 16:21:12 briggs Exp $ */
+/* $NetBSD: sbc.c,v 1.7 1996/05/29 14:26:33 scottr Exp $ */
/*
* Copyright (c) 1996 Scott Reynolds
@@ -750,8 +750,8 @@ sbc_drq_intr(p)
if (setjmp((label_t *) nofault)) {
nofault = (int *) 0;
- count = ( (u_long) mac68k_buserr_addr
- - (u_long) sc->sc_drq_addr);
+ count = (( (u_long) mac68k_buserr_addr
+ - (u_long) sc->sc_drq_addr));
if ((count < 0) || (count > dh->dh_len)) {
printf("%s: complete=0x%x (pending 0x%x)\n",
@@ -772,6 +772,7 @@ sbc_drq_intr(p)
}
if (dh->dh_flags & SBC_DH_OUT) { /* Data Out */
+#ifdef notyet
/*
* Get the source address aligned.
*/
@@ -817,6 +818,32 @@ sbc_drq_intr(p)
dh->dh_len -= dcount;
dh->dh_addr += dcount;
}
+#else
+ while (dh->dh_len) {
+ dcount = count = min(dh->dh_len, MAX_DMA_LEN);
+ drq = (volatile u_int8_t *) sc->sc_drq_addr;
+ data = (u_int8_t *) dh->dh_addr;
+#define W1 *drq++ = *data++
+ while (count) {
+ W1; count--;
+ }
+#undef W1
+ dh->dh_len -= dcount;
+ dh->dh_addr += dcount;
+ }
+#endif
+
+ /* Wait for the GLUE to raise /ACK */
+ while ((*ncr_sc->sci_csr & SCI_CSR_ACK) == 0)
+ ;
+
+ /*
+ * If the SCSI bus is still busy, trigger a bus error
+ * by writing another byte to the SBC.
+ */
+ if (*ncr_sc->sci_bus_csr & SCI_BUS_BSY)
+ *((u_int8_t *) sc->sc_drq_addr) = 0;
+
} else { /* Data In */
/*
* Get the dest address aligned.
@@ -891,6 +918,13 @@ sbc_drq_intr(p)
* so we no longer short-circuit bus errors.
*/
nofault = (int *) 0;
+
+#ifdef SBC_DEBUG
+ if (sbc_debug & (SBC_DB_REG | SBC_DB_INTR))
+ printf("%s: drq intr complete: csr=0x%x, bus_csr=0x%x\n",
+ ncr_sc->sc_dev.dv_xname, *ncr_sc->sci_csr,
+ *ncr_sc->sci_bus_csr);
+#endif
}
void
@@ -1000,22 +1034,25 @@ void
sbc_dma_start(ncr_sc)
struct ncr5380_softc *ncr_sc;
{
+ register struct sbc_softc *sc = (struct sbc_softc *) ncr_sc;
struct sci_req *sr = ncr_sc->sc_current;
struct sbc_pdma_handle *dh = sr->sr_dma_hand;
/*
- * Match bus phase, set DMA mode, and assert data bus (for
- * writing only), then start the transfer.
+ * Match bus phase, clear pending interrupts, set DMA mode, and
+ * assert data bus (for writing only), then start the transfer.
*/
if (dh->dh_flags & SBC_DH_OUT) {
*ncr_sc->sci_tcmd = PHASE_DATA_OUT;
SCI_CLR_INTR(ncr_sc);
+ *sc->sc_iflag = 0x80 | (V2IF_SCSIIRQ | V2IF_SCSIDRQ);
*ncr_sc->sci_mode |= SCI_MODE_DMA;
*ncr_sc->sci_icmd = SCI_ICMD_DATA;
*ncr_sc->sci_dma_send = 0;
} else {
*ncr_sc->sci_tcmd = PHASE_DATA_IN;
SCI_CLR_INTR(ncr_sc);
+ *sc->sc_iflag = 0x80 | (V2IF_SCSIIRQ | V2IF_SCSIDRQ);
*ncr_sc->sci_mode |= SCI_MODE_DMA;
*ncr_sc->sci_icmd = 0;
*ncr_sc->sci_irecv = 0;
@@ -1040,6 +1077,7 @@ void
sbc_dma_stop(ncr_sc)
struct ncr5380_softc *ncr_sc;
{
+ register struct sbc_softc *sc = (struct sbc_softc *) ncr_sc;
struct sci_req *sr = ncr_sc->sc_current;
struct sbc_pdma_handle *dh = sr->sr_dma_hand;
register int ntrans;
@@ -1072,6 +1110,7 @@ sbc_dma_stop(ncr_sc)
/* Clear any pending interrupts. */
SCI_CLR_INTR(ncr_sc);
+ *sc->sc_iflag = 0x80 | (V2IF_SCSIIRQ | V2IF_SCSIDRQ);
}
/* Put SBIC back into PIO mode. */
diff --git a/sys/arch/mac68k/dev/z8530tty.c b/sys/arch/mac68k/dev/z8530tty.c
index fa4cb3274de..1a2d7876152 100644
--- a/sys/arch/mac68k/dev/z8530tty.c
+++ b/sys/arch/mac68k/dev/z8530tty.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: z8530tty.c,v 1.1 1996/05/26 19:02:12 briggs Exp $ */
-/* $NetBSD: z8530tty.c,v 1.2 1996/05/23 02:06:53 briggs Exp $ */
+/* $OpenBSD: z8530tty.c,v 1.2 1996/06/08 16:21:13 briggs Exp $ */
+/* $NetBSD: z8530tty.c,v 1.3 1996/06/01 00:13:41 scottr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -200,6 +200,7 @@ zstty_attach(parent, self, aux)
tp->t_hwiflow = zshwiflow;
ttychars(tp);
bcopy(tp->t_cc, zst->zst_cc, sizeof(tp->t_cc));
+ tty_attach(tp);
zst->zst_tty = tp;
zst->zst_rbhiwat = zstty_rbuf_size; /* impossible value */
diff --git a/sys/arch/mac68k/dev/zs.c b/sys/arch/mac68k/dev/zs.c
index 26c758fbe24..35803cffde3 100644
--- a/sys/arch/mac68k/dev/zs.c
+++ b/sys/arch/mac68k/dev/zs.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: zs.c,v 1.2 1996/06/08 16:01:42 briggs Exp $ */
-/* $NetBSD: zs.c,v 1.2 1996/05/23 05:18:48 briggs Exp $ */
+/* $OpenBSD: zs.c,v 1.3 1996/06/08 16:21:13 briggs Exp $ */
+/* $NetBSD: zs.c,v 1.4 1996/06/07 10:41:35 briggs Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@@ -286,7 +286,7 @@ zsc_attach(parent, self, aux)
if (channel == 0) {
zs_write_reg(cs, 9, 0);
- chip = zs_checkchip(cs);
+ chip = 0; /* We'll turn chip checking on post 1.2 */
printf(" chip type %d \n",chip);
}
cs->cs_chip = chip;
@@ -327,6 +327,8 @@ zstty_mdattach(zsc, zst, cs, tp)
struct zs_chanstate *cs;
struct tty *tp;
{
+ int theflags;
+
zst->zst_resetdef = 0;
cs->cs_clock_count = 3; /* internal + externals */
cs->cs_cclk_flag = 0; /* Not doing anything fancy by default */
@@ -334,10 +336,52 @@ zstty_mdattach(zsc, zst, cs, tp)
cs->cs_clocks[0].clk = mac68k_machine.sccClkConst*32;
cs->cs_clocks[0].flags = ZSC_RTXBRG; /* allowing divide by 16 will
melt the driver! */
- cs->cs_clocks[1].clk = 0;
+
cs->cs_clocks[1].flags = ZSC_RTXBRG | ZSC_RTXDIV | ZSC_VARIABLE | ZSC_EXTERN;
- cs->cs_clocks[2].clk = 0;
cs->cs_clocks[2].flags = ZSC_TRXDIV | ZSC_VARIABLE;
+ if (zst->zst_dev.dv_unit == 0) {
+ theflags = mac68k_machine.modem_flags;
+ cs->cs_clocks[1].clk = mac68k_machine.modem_dcd_clk;
+ cs->cs_clocks[2].clk = mac68k_machine.modem_cts_clk;
+ } else if (zst->zst_dev.dv_unit == 1) {
+ theflags = mac68k_machine.print_flags;
+ cs->cs_clocks[1].flags = ZSC_VARIABLE;
+ /*
+ * Yes, we aren't defining ANY clock source enables for the
+ * printer's DCD clock in. The hardware won't let us
+ * use it. But a clock will freak out the chip, so we
+ * let you set it, telling us to bar interrupts on the line.
+ */
+ cs->cs_clocks[1].clk = mac68k_machine.print_dcd_clk;
+ cs->cs_clocks[2].clk = mac68k_machine.print_cts_clk;
+ }
+
+ if (cs->cs_clocks[1].clk)
+ zst->zst_hwflags |= ZS_HWFLAG_IGDCD;
+ if (cs->cs_clocks[2].clk)
+ zst->zst_hwflags |= ZS_HWFLAG_IGCTS;
+
+ if (theflags & ZSMAC_RAW) {
+ zst->zst_cflag = ZSTTY_RAW_CFLAG;
+ zst->zst_iflag = ZSTTY_RAW_IFLAG;
+ zst->zst_lflag = ZSTTY_RAW_LFLAG;
+ zst->zst_oflag = ZSTTY_RAW_OFLAG;
+ printf(" (raw defaults)");
+ }
+ if (theflags & ZSMAC_LOCALTALK) {
+ printf(" shielding from LocalTalk");
+ zst->zst_ospeed = tp->t_ospeed = 1;
+ zst->zst_ispeed = tp->t_ispeed = 1;
+ cs->cs_defspeed = 1;
+ cs->cs_creg[ZSRR_BAUDLO] = cs->cs_preg[ZSRR_BAUDLO] = 0xff;
+ cs->cs_creg[ZSRR_BAUDHI] = cs->cs_preg[ZSRR_BAUDHI] = 0xff;
+ zs_write_reg(cs, ZSRR_BAUDLO, 0xff);
+ zs_write_reg(cs, ZSRR_BAUDHI, 0xff);
+ /*
+ * If we might have LocalTalk, then make sure we have the
+ * Baud rate low-enough to not do any damage.
+ */
+ }
/* For the mac, we have rtscts = check CTS for output control, no
* input control. mdmbuf means check DCD for output, and use DTR
@@ -364,9 +408,13 @@ void
zsmd_setclock(cs)
struct zs_chanstate *cs;
{
- if (cs->cs_pclk_flag & ZSC_EXTERN) {
- /* XXX need to set the via! */
- }
+ if (cs->cs_channel != 0)
+ return;
+ /*
+ * If the new clock has the external bit set, then select the
+ * external source.
+ */
+ via_set_modem((cs->cs_pclk_flag & ZSC_EXTERN) ? 1 : 0);
}
int
diff --git a/sys/arch/mac68k/include/cpu.h b/sys/arch/mac68k/include/cpu.h
index aa568c5b976..489c567e33e 100644
--- a/sys/arch/mac68k/include/cpu.h
+++ b/sys/arch/mac68k/include/cpu.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: cpu.h,v 1.6 1996/05/26 18:35:46 briggs Exp $ */
-/* $NetBSD: cpu.h,v 1.36 1996/05/25 14:48:38 briggs Exp $ */
+/* $OpenBSD: cpu.h,v 1.7 1996/06/08 16:21:14 briggs Exp $ */
+/* $NetBSD: cpu.h,v 1.37 1996/06/07 00:15:33 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -241,6 +241,12 @@ struct mac68k_machine_S {
int do_graybars;
int serial_boot_echo;
int serial_console;
+ int modem_flags;
+ int modem_cts_clk;
+ int modem_dcd_clk;
+ int print_flags;
+ int print_cts_clk;
+ int print_dcd_clk;
/*
* Misc. hardware info.
*/
diff --git a/sys/arch/mac68k/include/viareg.h b/sys/arch/mac68k/include/viareg.h
index 5b400205d35..e0cdded2d34 100644
--- a/sys/arch/mac68k/include/viareg.h
+++ b/sys/arch/mac68k/include/viareg.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: viareg.h,v 1.2 1996/05/26 18:36:10 briggs Exp $ */
-/* $NetBSD: viareg.h,v 1.3 1996/05/05 06:18:07 briggs Exp $ */
+/* $OpenBSD: viareg.h,v 1.3 1996/06/08 16:21:14 briggs Exp $ */
+/* $NetBSD: viareg.h,v 1.4 1996/06/07 10:41:37 briggs Exp $ */
/*-
* Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo,
@@ -172,6 +172,7 @@ extern int VIA2;
void VIA_initialize __P((void));
int rbv_vidstatus __P((void));
void via_shutdown __P((void));
+void via_set_modem __P((int));
int add_nubus_intr __P((int, void (*) __P((void *, int)), void *));
void enable_nubus_intr __P((void));
void mac68k_register_scsi_irq __P((void (*)(void *), void *clnt));
diff --git a/sys/arch/mac68k/include/z8530var.h b/sys/arch/mac68k/include/z8530var.h
index 88a42a73950..f88b31f9c39 100644
--- a/sys/arch/mac68k/include/z8530var.h
+++ b/sys/arch/mac68k/include/z8530var.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: z8530var.h,v 1.2 1996/05/26 18:36:11 briggs Exp $ */
-/* $NetBSD: z8530var.h,v 1.1 1996/05/18 18:54:45 briggs Exp $ */
+/* $OpenBSD: z8530var.h,v 1.3 1996/06/08 16:21:15 briggs Exp $ */
+/* $NetBSD: z8530var.h,v 1.2 1996/06/07 10:27:19 briggs Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -104,4 +104,8 @@ void zsmd_setclock __P((struct zs_chanstate *cs));
#define ZSTTY_RAW_OFLAG (ONLCR | OXTABS)
/* Above taken from looking at a tty after a stty raw */
+/* Booter flags interface */
+#define ZSMAC_RAW 0x01
+#define ZSMAC_LOCALTALK 0x02
+
#define zsprintf printf
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index b96c1d508ad..8808b98e14d 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: machdep.c,v 1.14 1996/05/26 18:36:22 briggs Exp $ */
-/* $NetBSD: machdep.c,v 1.105 1996/05/25 14:45:31 briggs Exp $ */
+/* $OpenBSD: machdep.c,v 1.15 1996/06/08 16:21:16 briggs Exp $ */
+/* $NetBSD: machdep.c,v 1.108 1996/06/07 10:48:26 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -1691,12 +1691,12 @@ static romvec_t romvecs[] =
(caddr_t) 0x4080c5cc, /* InitUtil */
(caddr_t) 0x4080b186, /* ReadXPRam */
(caddr_t) 0x4080b190, /* WriteXPRam */
- (caddr_t) 0x408b39b2, /* jClkNoMem */ /* From PB180 */
+ (caddr_t) 0x408b39b2, /* jClkNoMem */ /* From PB180 */
(caddr_t) 0x4080a818, /* ADBAlternateInit */
(caddr_t) 0x40814800, /* Egret */
- (caddr_t) 0x40888400, /* InitPwrMgr */ /* From PB180 */
- (caddr_t) 0x0, /* ADBReInit_JTBL */
- (caddr_t) 0x0, /* ROMResourceMap List Head */
+ (caddr_t) 0x40888400, /* InitPwrMgr */ /* From PB180 */
+ (caddr_t) 0x408cce28, /* ADBReInit_JTBL -- from PB160*/
+ (caddr_t) 0x4087eb90, /* ROMRsrcMap List Head -- from PB160*/
(caddr_t) 0x4081c406, /* FixDiv, wild guess */
(caddr_t) 0x4081c312, /* FixMul, wild guess */
},
@@ -1898,10 +1898,10 @@ static romvec_t romvecs[] =
(caddr_t) 0x40a0b190, /* WriteXPRam */
(caddr_t) 0x40ab3bf4, /* jClkNoMem */
(caddr_t) 0x40a0a818, /* ADBAlternateInit */
- (caddr_t) 0x40ad1450, /* Egret */
+ (caddr_t) 0x40acfd40, /* Egret */
(caddr_t) 0x40a147c4, /* InitEgret */
- (caddr_t) 0x0, /* ADBReInit_JTBL */
- (caddr_t) 0x0, /* ROMResourceMap List Head */
+ (caddr_t) 0x40a038a0, /* ADBReInit_JTBL */
+ (caddr_t) 0x40a7eb90, /* ROMResourceMap List Head */
(caddr_t) 0x40a1c406, /* FixDiv */
(caddr_t) 0x40a1c312, /* FixMul */
},
@@ -2104,6 +2104,13 @@ getenvvars()
mac68k_machine.do_graybars = getenv("GRAYBARS");
mac68k_machine.serial_boot_echo = getenv("SERIALECHO");
mac68k_machine.serial_console = getenv("SERIALCONSOLE");
+
+ mac68k_machine.modem_flags = getenv("SERIAL_MODEM_FLAGS");
+ mac68k_machine.modem_cts_clk = getenv("SERIAL_MODEM_HSKICLK");
+ mac68k_machine.modem_dcd_clk = getenv("SERIAL_MODEM_GPICLK");
+ mac68k_machine.print_flags = getenv("SERIAL_PRINT_FLAGS");
+ mac68k_machine.print_cts_clk = getenv("SERIAL_PRINT_HSKICLK");
+ mac68k_machine.print_dcd_clk = getenv("SERIAL_PRINT_GPICLK");
/* Should probably check this and fail if old */
mac68k_machine.booter_version = getenv("BOOTERVER");
@@ -2176,7 +2183,7 @@ setmachdep()
* used later when we re-map the vectors from MacOS Address
* Space to NetBSD Address Space.
*/
- if ((mac68k_machine.serial_console & 0x01) == 0)
+ if ((mac68k_machine.serial_console & 0x03) == 0)
mrg_MacOSROMVectors = cpui->rom_vectors;
/*
diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c
index a816e2b2647..34e02c57c10 100644
--- a/sys/arch/mac68k/mac68k/mem.c
+++ b/sys/arch/mac68k/mac68k/mem.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: mem.c,v 1.2 1996/05/26 18:36:27 briggs Exp $ */
-/* $NetBSD: mem.c,v 1.10 1995/04/10 13:15:26 mycroft Exp $ */
+/* $OpenBSD: mem.c,v 1.3 1996/06/08 16:21:16 briggs Exp $ */
+/* $NetBSD: mem.c,v 1.11 1996/05/05 06:18:41 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -48,6 +48,7 @@
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/buf.h>
+#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/uio.h>
#include <sys/malloc.h>
@@ -58,11 +59,16 @@
caddr_t zeropage;
+#define mmread mmrw
+#define mmwrite mmrw
+cdev_decl(mm);
+
/*ARGSUSED*/
int
-mmopen(dev, flag, mode)
+mmopen(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
return (0);
@@ -70,9 +76,10 @@ mmopen(dev, flag, mode)
/*ARGSUSED*/
int
-mmclose(dev, flag, mode)
+mmclose(dev, flag, mode, p)
dev_t dev;
int flag, mode;
+ struct proc *p;
{
return (0);
@@ -116,13 +123,6 @@ mmrw(dev, uio, flags)
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
-#if !defined(DEBUG) && 0 /* BG -- serial test needs this. */
- /* allow reads only in RAM (except for DEBUG) */
- if (v >= 0x008FFFFC || v < 0) {
- error = EFAULT;
- goto unlock;
- }
-#endif
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap,
trunc_page(v), uio->uio_rw == UIO_READ ?
VM_PROT_READ : VM_PROT_WRITE, TRUE);
@@ -175,7 +175,6 @@ mmrw(dev, uio, flags)
uio->uio_resid -= c;
}
if (minor(dev) == 0) {
-unlock:
if (physlock > 1)
wakeup((caddr_t)&physlock);
physlock = 0;
diff --git a/sys/arch/mac68k/mac68k/via.c b/sys/arch/mac68k/mac68k/via.c
index cc409b7b37c..bc0d911b5d1 100644
--- a/sys/arch/mac68k/mac68k/via.c
+++ b/sys/arch/mac68k/mac68k/via.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: via.c,v 1.6 1996/05/26 18:36:37 briggs Exp $ */
-/* $NetBSD: via.c,v 1.44 1996/05/25 16:31:04 briggs Exp $ */
+/* $OpenBSD: via.c,v 1.7 1996/06/08 16:21:17 briggs Exp $ */
+/* $NetBSD: via.c,v 1.47 1996/06/07 13:04:46 briggs Exp $ */
/*-
* Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo,
@@ -172,6 +172,20 @@ VIA_initialize()
}
}
+/*
+ * Set the state of the modem serial port's clock source.
+ */
+void
+via_set_modem(onoff)
+ int onoff;
+{
+ via_reg(VIA1, vDirA) |= DA1O_vSync;
+ if (onoff)
+ via_reg(VIA1, vBufA) |= DA1O_vSync;
+ else
+ via_reg(VIA1, vBufA) &= ~DA1O_vSync;
+}
+
void
via1_intr(fp)
struct frame *fp;
@@ -222,9 +236,8 @@ via2_intr(fp)
bitnum = 0;
do {
- if (intbits & mask) {
+ if (intbits & mask)
via2itab[bitnum](via2iarg[bitnum]);
- }
mask <<= 1;
} while (intbits >= mask && ++bitnum < 7);
}
@@ -248,9 +261,8 @@ rbv_intr(fp)
bitnum = 0;
do {
- if (intbits & mask) {
+ if (intbits & mask)
via2itab[bitnum](via2iarg[bitnum]);
- }
mask <<= 1;
} while (intbits >= mask && ++bitnum < 7);
}