summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-20 21:17:08 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-04-20 21:17:08 +0000
commitc333d0381cfb3739b7ebbefbff7da93bd8a14977 (patch)
treed14ae25de8db1179e6b40bfcf6526030ad3c6968
parente2f571f3eadd769571b024a9bd403310e34fd3c9 (diff)
establish irq handler
-rw-r--r--sys/arch/hppa/gsc/lpt_gsc.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/hppa/gsc/lpt_gsc.c b/sys/arch/hppa/gsc/lpt_gsc.c
index 6fd242cba7b..a6f631f6ef4 100644
--- a/sys/arch/hppa/gsc/lpt_gsc.c
+++ b/sys/arch/hppa/gsc/lpt_gsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpt_gsc.c,v 1.2 1998/11/30 21:16:32 mickey Exp $ */
+/* $OpenBSD: lpt_gsc.c,v 1.3 1999/04/20 21:17:07 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -64,6 +64,10 @@
#include <hppa/dev/cpudevs.h>
+#include <hppa/gsc/gscbusvar.h>
+
+#define LPTGSC_OFFSET 0x800
+
int lpt_gsc_probe __P((struct device *, void *, void *));
void lpt_gsc_attach __P((struct device *, struct device *, void *));
@@ -121,7 +125,8 @@ lpt_gsc_probe(parent, match, aux)
base = ca->ca_hpa;
if (bus_space_map(ca->ca_iot, base, IOMOD_HPASIZE, 0, &ioh))
return 0;
- ioh |= IOMOD_DEVOFFSET;
+ ioh += LPTGSC_OFFSET;
+ base += LPTGSC_OFFSET;
rv = 0;
mask = 0xff;
@@ -152,7 +157,7 @@ lpt_gsc_probe(parent, match, aux)
rv = 1;
out:
- ioh &= ~IOMOD_DEVOFFSET;
+ ioh -= LPTGSC_OFFSET;
bus_space_unmap(ca->ca_iot, ioh, IOMOD_HPASIZE);
return rv;
}
@@ -163,18 +168,23 @@ lpt_gsc_attach(parent, self, aux)
void *aux;
{
register struct lpt_softc *sc = (void *)self;
- register struct confargs *ca = aux;
+ register struct gsc_attach_args *ga = aux;
- sc->sc_flags |= LPT_POLLED;
- printf(": polled\n");
+ /* sc->sc_flags |= LPT_POLLED; */
sc->sc_state = 0;
- sc->sc_iot = ca->ca_iot;
- if (bus_space_map(sc->sc_iot, ca->ca_hpa, IOMOD_HPASIZE,
+ sc->sc_iot = ga->ga_iot;
+ if (bus_space_map(sc->sc_iot, ga->ga_hpa, IOMOD_HPASIZE,
0, &sc->sc_ioh))
panic("lpt_gsc_attach: couldn't map I/O ports");
- sc->sc_ioh |= IOMOD_DEVOFFSET;
+ sc->sc_ioh += LPTGSC_OFFSET;
+
+ printf("\n");
bus_space_write_1(sc->sc_iot, sc->sc_ioh, lpt_control, LPC_NINIT);
+
+ sc->sc_ih = gsc_intr_establish((struct gsc_softc *)parent, IPL_TTY,
+ ga->ga_irq, lptintr, sc,
+ sc->sc_dev.dv_xname);
}