summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/asp.c58
-rw-r--r--sys/arch/hppa/dev/lasi.c74
2 files changed, 11 insertions, 121 deletions
diff --git a/sys/arch/hppa/dev/asp.c b/sys/arch/hppa/dev/asp.c
index 973fd94ef7c..66ee0028a67 100644
--- a/sys/arch/hppa/dev/asp.c
+++ b/sys/arch/hppa/dev/asp.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: asp.c,v 1.7 2002/04/22 01:48:37 mickey Exp $ */
+/* $OpenBSD: asp.c,v 1.8 2002/12/17 21:54:20 mickey Exp $ */
/*
- * Copyright (c) 1998,1999 Michael Shalayeff
+ * Copyright (c) 1998-2002 Michael Shalayeff
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -138,11 +138,6 @@ struct cfdriver asp_cd = {
NULL, "asp", DV_DULL
};
-void asp_intr_establish(void *v, u_int32_t mask);
-void asp_intr_disestablish(void *v, u_int32_t mask);
-u_int32_t asp_intr_check(void *v);
-void asp_intr_ack(void *v, u_int32_t mask);
-
int
aspmatch(parent, cfdata, aux)
struct device *parent;
@@ -203,10 +198,7 @@ aspattach(parent, self, aux)
sc->sc_ic.gsc_type = gsc_asp;
sc->sc_ic.gsc_dv = sc;
- sc->sc_ic.gsc_intr_establish = asp_intr_establish;
- sc->sc_ic.gsc_intr_disestablish = asp_intr_disestablish;
- sc->sc_ic.gsc_intr_check = asp_intr_check;
- sc->sc_ic.gsc_intr_ack = asp_intr_ack;
+ sc->sc_ic.gsc_base = sc->sc_trs;
ga.ga_ca = *ca; /* clone from us */
ga.ga_hpamask = ASP_IOMASK;
@@ -214,47 +206,3 @@ aspattach(parent, self, aux)
ga.ga_ic = &sc->sc_ic;
config_found(self, &ga, gscprint);
}
-
-void
-asp_intr_establish(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct asp_softc *sc = v;
-
- sc->sc_trs->asp_imr |= mask;
-}
-
-void
-asp_intr_disestablish(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct asp_softc *sc = v;
-
- sc->sc_trs->asp_imr &= ~mask;
-}
-
-u_int32_t
-asp_intr_check(v)
- void *v;
-{
- register struct asp_softc *sc = v;
- register u_int32_t irr, imr;
-
- imr = sc->sc_trs->asp_imr;
- irr = sc->sc_trs->asp_irr;
- sc->sc_trs->asp_imr = imr & ~irr;
-
- return irr;
-}
-
-void
-asp_intr_ack(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct asp_softc *sc = v;
-
- sc->sc_trs->asp_imr |= mask;
-}
diff --git a/sys/arch/hppa/dev/lasi.c b/sys/arch/hppa/dev/lasi.c
index 0b634fc94f0..f0614519c95 100644
--- a/sys/arch/hppa/dev/lasi.c
+++ b/sys/arch/hppa/dev/lasi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lasi.c,v 1.9 2002/04/22 01:48:37 mickey Exp $ */
+/* $OpenBSD: lasi.c,v 1.10 2002/12/17 21:54:20 mickey Exp $ */
/*
* Copyright (c) 1998-2002 Michael Shalayeff
@@ -39,6 +39,7 @@
#include <machine/bus.h>
#include <machine/iomod.h>
+#include <machine/reg.h>
#include <machine/autoconf.h>
#include <hppa/dev/cpudevs.h>
@@ -50,7 +51,7 @@
struct lasi_hwr {
u_int32_t lasi_power;
#define LASI_BLINK 0x01
-#define LASI_ON 0x02
+#define LASI_OFF 0x02
u_int32_t lasi_error;
u_int32_t lasi_version;
u_int32_t lasi_reset;
@@ -86,13 +87,8 @@ struct cfdriver lasi_cd = {
NULL, "lasi", DV_DULL
};
-void lasi_intr_establish(void *v, u_int32_t mask);
-void lasi_intr_disestablish(void *v, u_int32_t mask);
-u_int32_t lasi_intr_check(void *v);
-void lasi_intr_ack(void *v, u_int32_t mask);
void lasi_cold_hook(int on);
-
int
lasimatch(parent, cfdata, aux)
struct device *parent;
@@ -133,8 +129,8 @@ lasiattach(parent, self, aux)
/* XXX should we reset the chip here? */
- printf (": rev %d.%d\n", (sc->sc_hw->lasi_version & 0xf0) >> 4,
- sc->sc_hw->lasi_version & 0xf);
+ printf(": rev %d.%d\n", (sc->sc_hw->lasi_version & 0xf0) >> 4,
+ sc->sc_hw->lasi_version & 0xf);
/* interrupts guts */
s = splhigh();
@@ -147,13 +143,9 @@ lasiattach(parent, self, aux)
sc->sc_ic.gsc_type = gsc_lasi;
sc->sc_ic.gsc_dv = sc;
- sc->sc_ic.gsc_intr_establish = lasi_intr_establish;
- sc->sc_ic.gsc_intr_disestablish = lasi_intr_disestablish;
- sc->sc_ic.gsc_intr_check = lasi_intr_check;
- sc->sc_ic.gsc_intr_ack = lasi_intr_ack;
+ sc->sc_ic.gsc_base = sc->sc_trs;
sc->ga.ga_ca = *ca; /* clone from us */
- sc->ga.ga_hpamask = LASI_IOMASK;
if (sc->sc_dev.dv_unit)
config_defer(self, lasi_gsc_attach);
else {
@@ -171,6 +163,7 @@ lasi_gsc_attach(self)
struct lasi_softc *sc = (struct lasi_softc *)self;
sc->ga.ga_name = "gsc";
+ sc->ga.ga_hpamask = LASI_IOMASK;
sc->ga.ga_ic = &sc->sc_ic;
config_found(self, &sc->ga, gscprint);
}
@@ -192,58 +185,7 @@ lasi_cold_hook(on)
sc->sc_hw->lasi_power = 0;
break;
case HPPA_COLD_OFF:
- sc->sc_hw->lasi_power = LASI_BLINK;
+ sc->sc_hw->lasi_power = LASI_OFF;
break;
}
}
-
-void
-lasi_intr_establish(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct lasi_softc *sc = v;
-
- sc->sc_trs->lasi_imr |= mask;
-}
-
-void
-lasi_intr_disestablish(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct lasi_softc *sc = v;
-
- sc->sc_trs->lasi_imr &= ~mask;
-}
-
-u_int32_t
-lasi_intr_check(v)
- void *v;
-{
- register struct lasi_softc *sc = v;
- register u_int32_t irr, imr, ipr;
-
- imr = sc->sc_trs->lasi_imr;
- ipr = sc->sc_trs->lasi_ipr;
- irr = sc->sc_trs->lasi_irr;
- sc->sc_trs->lasi_irr = irr;
-
-#ifdef LASIDEBUG
- printf ("%s: imr=0x%x, irr=0x%x, ipr=0x%x, iar=0x%x, icr=0x%x\n",
- sc->sc_dev.dv_xname, imr, irr, ipr,
- sc->sc_trs->lasi_iar, sc->sc_trs->lasi_icr);
-#endif
-
- return irr;
-}
-
-void
-lasi_intr_ack(v, mask)
- void *v;
- u_int32_t mask;
-{
- register struct lasi_softc *sc = v;
-
- sc->sc_trs->lasi_imr |= mask;
-}