From a6dfd800c952d6b6bac04ca6b3aa9cc00e00b8c5 Mon Sep 17 00:00:00 2001 From: oki Date: Sun, 19 Oct 1997 20:45:11 +0000 Subject: [PATCH] Test device is configured in interrput handler. --- sys/arch/x68k/dev/mha.c | 15 +++++++++------ sys/arch/x68k/dev/spc.c | 20 +++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/sys/arch/x68k/dev/mha.c b/sys/arch/x68k/dev/mha.c index f1d19a130e46..1424bb1fb0cf 100644 --- a/sys/arch/x68k/dev/mha.c +++ b/sys/arch/x68k/dev/mha.c @@ -1,4 +1,4 @@ -/* $NetBSD: mha.c,v 1.1 1997/10/19 09:29:31 oki Exp $ */ +/* $NetBSD: mha.c,v 1.2 1997/10/19 20:45:17 oki Exp $ */ /* * Copyright (c) 1996 Masaru Oki, Takumi Nakamura and Masanobu Saitoh. All rights reserved. @@ -1681,18 +1681,21 @@ int mhaintr(unit) int unit; { - register struct mha_softc *sc = mha_cd.cd_devs[unit]; /* XXX */ + struct mha_softc *sc = mha_cd.cd_devs[unit]; /* XXX */ u_char ints; - register struct acb *acb; - register struct scsipi_link *sc_link; + struct acb *acb; + struct scsipi_link *sc_link; struct spc_tinfo *ti; u_char ph; u_short r; int n; + /* return if not configured */ + if (sc == NULL) + return; + #if 1 /* XXX */ - if (tmpsc != NULL && tmpsc != sc) - { + if (tmpsc != NULL && tmpsc != sc) { SPC_MISC(("[%x %x]\n", mha_cd.cd_devs, sc)); sc = tmpsc; } diff --git a/sys/arch/x68k/dev/spc.c b/sys/arch/x68k/dev/spc.c index 25eabc61e766..1a5c72d56fba 100644 --- a/sys/arch/x68k/dev/spc.c +++ b/sys/arch/x68k/dev/spc.c @@ -1,6 +1,6 @@ -/* $NetBSD: spc.c,v 1.11 1997/10/09 13:00:49 oki Exp $ */ +/* $NetBSD: spc.c,v 1.12 1997/10/19 20:45:11 oki Exp $ */ -#define integrate static inline +#define integrate __inline static /* * Copyright (c) 1996 Masaru Oki. All rights reserved. @@ -90,8 +90,8 @@ * may spin in the interrupt routine waiting for this byte to come. How long? * This is really (SCSI) device and processor dependent. Tuneable, I guess. */ -#define SPC_MSGIN_SPIN 1 /* Will spinwait upto ?ms for a new msg byte */ -#define SPC_MSGOUT_SPIN 1 +#define SPC_MSGIN_SPIN 1 /* Will spinwait upto ?ms for a new msg byte */ +#define SPC_MSGOUT_SPIN 1 /* Include debug functions? At the end of this file there are a bunch of * functions that will print out various information regarding queued SCSI @@ -812,6 +812,9 @@ spc_select(sc, acb) #if 0 SCMD = SCMD_SET_ATN; #endif + /* XXX? */ + do asm ("nop"); while (SSTS & (SSTS_ACTIVE|SSTS_TARGET|SSTS_BUSY)); + PCTL = 0; TEMP = (1 << sc->sc_initiator) | (1 << target); /* @@ -1758,13 +1761,16 @@ int spcintr(unit) int unit; { - register struct spc_softc *sc = spc_cd.cd_devs[unit]; /* XXX */ + struct spc_softc *sc = spc_cd.cd_devs[unit]; /* XXX */ u_char ints; - register struct spc_acb *acb; - register struct scsipi_link *sc_link; + struct spc_acb *acb; + struct scsipi_link *sc_link; struct spc_tinfo *ti; int n; + /* return if not configured */ + if (sc == NULL) + return; /* * 割り込み禁止にする */