- no need to scan zsc units in zshard(), just use passed one

- call zsc_intr_soft() directly on softintr and remove zssoft()
  (no need spltty() since it should be done in each MD handler)
This commit is contained in:
tsutsui 2006-11-03 03:04:53 +00:00
parent 2d61afc3e7
commit 57a0051fe5
3 changed files with 13 additions and 44 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs.c,v 1.1 2005/12/29 15:20:08 tsutsui Exp $ */
/* $NetBSD: zs.c,v 1.2 2006/11/03 03:04:53 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 2005 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.1 2005/12/29 15:20:08 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.2 2006/11/03 03:04:53 tsutsui Exp $");
#include "opt_ddb.h"
@ -84,51 +84,20 @@ zs_print(void *aux, const char *name)
return UNCONF;
}
/*
* Our ZS chips all share a common, autovectored interrupt,
* so we have to look at all of them on each interrupt.
*/
int
zshard(void *arg)
{
struct zsc_softc *zsc;
int unit, rval, softreq;
int rval;
rval = 0;
for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
zsc = zsc_cd.cd_devs[unit];
if (zsc == NULL)
continue;
rval |= zsc_intr_hard(zsc);
softreq = zsc->zsc_cs[0]->cs_softreq;
softreq |= zsc->zsc_cs[1]->cs_softreq;
if (softreq)
softintr_schedule(zsc->zsc_si);
}
zsc = arg;
rval = zsc_intr_hard(zsc);
if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq)
softintr_schedule(zsc->zsc_si);
return rval;
}
/*
* Similar scheme as for zshard (look at all of them)
*/
void
zssoft(void *arg)
{
struct zsc_softc *zsc;
int s, unit;
/* Make sure we call the tty layer at spltty. */
s = spltty();
for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
zsc = zsc_cd.cd_devs[unit];
if (zsc == NULL)
continue;
(void)zsc_intr_soft(zsc);
}
splx(s);
}
/*
* Compute the current baud rate given a ZS channel.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530var.h,v 1.1 2005/12/29 15:20:09 tsutsui Exp $ */
/* $NetBSD: z8530var.h,v 1.2 2006/11/03 03:04:53 tsutsui Exp $ */
/*
* Copyright (c) 1992, 1993
@ -104,7 +104,6 @@ void zs_write_data(struct zs_chanstate *cs, uint8_t val);
int zs_print(void *, const char *);
int zshard(void *);
void zssoft(void*);
int zs_get_speed(struct zs_chanstate *);
int zs_getc(void *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: zs_sbdio.c,v 1.2 2006/03/28 17:38:24 thorpej Exp $ */
/* $NetBSD: zs_sbdio.c,v 1.3 2006/11/03 03:04:53 tsutsui Exp $ */
/*-
* Copyright (c) 1996, 2005 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zs_sbdio.c,v 1.2 2006/03/28 17:38:24 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: zs_sbdio.c,v 1.3 2006/11/03 03:04:53 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -189,8 +189,9 @@ zs_sbdio_attach(struct device *parent, struct device *self, void *aux)
}
}
zsc->zsc_si = softintr_establish(IPL_SOFTSERIAL, zssoft, zsc);
intr_establish(sa->sa_irq, zshard, self);
zsc->zsc_si = softintr_establish(IPL_SOFTSERIAL,
(void (*)(void *))zsc_intr_soft, zsc);
intr_establish(sa->sa_irq, zshard, zsc);
/*
* Set the master interrupt enable and interrupt vector.