summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-03-22 06:54:02 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-03-22 06:54:02 +0000
commit4d5a7a16347f08116b507840ae1397ed831ca51a (patch)
tree509dda40dea24c0fd8fab17cde8f69feee1b7550
parent26578811cef157620f67fafd800a874b084f8d01 (diff)
read and write funcs for the global register space
-rw-r--r--sys/dev/ic/sili.c24
-rw-r--r--sys/dev/ic/silireg.h4
2 files changed, 24 insertions, 4 deletions
diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c
index 966dbbcbcac..2de7cc23b71 100644
--- a/sys/dev/ic/sili.c
+++ b/sys/dev/ic/sili.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sili.c,v 1.1 2007/03/22 02:48:42 dlg Exp $ */
+/* $OpenBSD: sili.c,v 1.2 2007/03/22 06:54:01 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -35,6 +35,9 @@ struct cfdriver sili_cd = {
NULL, "sili", DV_DULL
};
+u_int32_t sili_read(struct sili_softc *, bus_size_t);
+void sili_write(struct sili_softc *, bus_size_t, u_int32_t);
+
int
sili_attach(struct sili_softc *sc)
{
@@ -59,3 +62,22 @@ sili_intr(void *arg)
return (0);
}
+u_int32_t
+sili_read(struct sili_softc *sc, bus_size_t r)
+{
+ u_int32_t rv;
+
+ bus_space_barrier(sc->sc_iot_global, sc->sc_ioh_global, r, 4,
+ BUS_SPACE_BARRIER_READ);
+ rv = bus_space_read_4(sc->sc_iot_global, sc->sc_ioh_global, r);
+
+ return (rv);
+}
+
+void
+sili_write(struct sili_softc *sc, bus_size_t r, u_int32_t v)
+{
+ bus_space_write_4(sc->sc_iot_global, sc->sc_ioh_global, r, v);
+ bus_space_barrier(sc->sc_iot_global, sc->sc_ioh_global, r, 4,
+ BUS_SPACE_BARRIER_WRITE);
+}
diff --git a/sys/dev/ic/silireg.h b/sys/dev/ic/silireg.h
index e66103c47ed..db6c830f28f 100644
--- a/sys/dev/ic/silireg.h
+++ b/sys/dev/ic/silireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: silireg.h,v 1.2 2007/03/22 06:32:14 dlg Exp $ */
+/* $OpenBSD: silireg.h,v 1.3 2007/03/22 06:54:01 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -19,5 +19,3 @@
#define SILI_PCI_BAR_GLOBAL 0x10
#define SILI_PCI_BAR_PORT 0x14
#define SILI_PCI_BAR_INDIRECT 0x18
-
-