Pull down from release. Sorry, should have been the other way around....

This commit is contained in:
leo 1996-06-18 11:10:04 +00:00
parent 60f46fb10b
commit 1301d25702
2 changed files with 19 additions and 52 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atari5380.c,v 1.14 1996/05/15 07:29:03 leo Exp $ */
/* $NetBSD: atari5380.c,v 1.15 1996/06/18 11:10:04 leo Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@ -461,7 +461,6 @@ tt_get_dma_result(SC_REQ *reqp, u_long *bytes_left)
/*
* Prototype functions defined below
*/
static void fscsi_int __P((void));
static void scsi_falcon_init __P((struct ncr_softc *));
static u_char get_falcon_5380_reg __P((u_short));
static void set_falcon_5380_reg __P((u_short, u_short));
@ -523,6 +522,7 @@ scsi_falcon_clr_ipend()
int tmp;
tmp = get_falcon_5380_reg(NCR5380_IRCV);
rem_sicallback((si_farg)ncr_ctrl_intr);
}
extern __inline__ int
@ -574,8 +574,8 @@ falcon_claimed_dma()
*/
return(0);
}
if (!st_dmagrab((dma_farg)fscsi_int, (dma_farg)run_main,
&connected, &falcon_lock, 1))
if (!st_dmagrab((dma_farg)ncr_ctrl_intr, (dma_farg)run_main,
cur_softc, &falcon_lock, 1))
return(0);
}
return(1);
@ -589,7 +589,8 @@ falcon_reconsider_dma()
* No need to keep DMA locked by us as we are not currently
* connected and no disconnected jobs are pending.
*/
st_dmafree(&connected, &falcon_lock);
rem_sicallback((si_farg)ncr_ctrl_intr);
st_dmafree(cur_softc, &falcon_lock);
}
if (!falcon_lock && (issue_q != NULL)) {
@ -597,8 +598,8 @@ falcon_reconsider_dma()
* We must (re)claim DMA access as there are jobs
* waiting in the issue queue.
*/
st_dmagrab((dma_farg)fscsi_int, (dma_farg)run_main,
&connected, &falcon_lock, 0);
st_dmagrab((dma_farg)ncr_ctrl_intr, (dma_farg)run_main,
cur_softc, &falcon_lock, 0);
}
}
@ -643,18 +644,6 @@ u_char mode;
}
}
/*
* Falcon SCSI interrupt. _Always_ called at spl1!
*/
static void
fscsi_int()
{
if (scsi_falcon_ipending()) {
scsi_falcon_idisable();
ncr_ctrl_intr(cur_softc);
}
}
static int
falcon_poll_edma(reqp)
SC_REQ *reqp;
@ -714,7 +703,8 @@ u_long *bytes_left;
*/
bytes_done = st_dmaaddr_get() - reqp->dm_cur->dm_addr;
if (bytes_done & 511) {
ncr_tprint(reqp, "Some bytes stuck in fifo\n");
ncr_tprint(reqp, "%ld bytes of %ld stuck in fifo\n",
bytes_done & 15, bytes_done & ~511);
bytes_done &= ~511;
reqp->xs->error = XS_DRIVER_STUFFUP;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dma.c,v 1.7 1996/04/19 20:35:46 leo Exp $ */
/* $NetBSD: dma.c,v 1.8 1996/06/18 11:10:11 leo Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman.
@ -72,7 +72,6 @@ typedef struct dma_entry {
* Preallocated entries. An allocator seem an overkill here.
*/
static DMA_ENTRY dmatable[NDMA_DEV]; /* preallocated entries */
static int sched_soft = 0; /* callback scheduled */
/*
* Heads of free and active lists:
@ -85,7 +84,6 @@ static int must_init = 1; /* Must initialize */
void cdmaint __P((int));
long sr; /* sr at time of interrupt */
static void cdmasoft __P((void *, void *));
static void init_queues __P((void));
static void
@ -202,42 +200,21 @@ void
cdmaint(sr)
int sr; /* sr at time of interrupt */
{
if(dma_active.tqh_first != NULL) {
if(!BASEPRI(sr)) {
if(!sched_soft++)
add_sicallback(cdmasoft, 0, 0);
}
else {
spl1();
cdmasoft(NULL, NULL);
}
}
else printf("DMA interrupt discarded\n");
}
static void
cdmasoft(arg1, arg2)
void *arg1, *arg2;
{
int s;
dma_farg int_func;
void *softc;
/*
* Prevent a race condition here. DMA might be freed while
* the callback was pending!
*/
s = splhigh();
sched_soft = 0;
if(dma_active.tqh_first != NULL) {
int_func = dma_active.tqh_first->int_func;
softc = dma_active.tqh_first->softc;
}
else int_func = softc = NULL;
splx(s);
if(int_func != NULL)
(*int_func)(softc);
if(!BASEPRI(sr))
add_sicallback((si_farg)int_func, softc, 0);
else {
spl1();
(*int_func)(softc);
}
}
else printf("DMA interrupt discarded\n");
}
/*