summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-09-18 04:33:00 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-09-18 04:33:00 +0000
commit831281d8c9aea21cb7c3c0080abcda69b7e2537c (patch)
tree6ca5ef007581812ae423691237ee0e17bf514078
parent60cb7c1e21dc64fc968e90cbcff8597b5b006777 (diff)
Write the operand registers with the correct endian (fortunately it just means
writing to a different window to swizzle the bytes)
-rw-r--r--sys/dev/pci/lofn.c12
-rw-r--r--sys/dev/pci/nofn.c12
2 files changed, 22 insertions, 2 deletions
diff --git a/sys/dev/pci/lofn.c b/sys/dev/pci/lofn.c
index 8edf5c1f7d6..bdcdf765409 100644
--- a/sys/dev/pci/lofn.c
+++ b/sys/dev/pci/lofn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lofn.c,v 1.19 2002/05/10 15:45:18 jason Exp $ */
+/* $OpenBSD: lofn.c,v 1.20 2002/09/18 04:32:59 jason Exp $ */
/*
* Copyright (c) 2001-2002 Jason L. Wright (jason@thought.net)
@@ -229,8 +229,13 @@ lofn_read_reg(sc, ridx, rp)
int ridx;
union lofn_reg *rp;
{
+#if BYTE_ORDER == BIG_ENDIAN
+ bus_space_read_region_4(sc->sc_st, sc->sc_sh,
+ LOFN_REGADDR(LOFN_WIN_0, ridx, 0), rp->w, 1024/32);
+#else
bus_space_read_region_4(sc->sc_st, sc->sc_sh,
LOFN_REGADDR(LOFN_WIN_2, ridx, 0), rp->w, 1024/32);
+#endif
}
void
@@ -239,8 +244,13 @@ lofn_write_reg(sc, ridx, rp)
int ridx;
union lofn_reg *rp;
{
+#if BYTE_ORDER == BIG_ENDIAN
+ bus_space_write_region_4(sc->sc_st, sc->sc_sh,
+ LOFN_REGADDR(LOFN_WIN_0, ridx, 0), rp->w, 1024/32);
+#else
bus_space_write_region_4(sc->sc_st, sc->sc_sh,
LOFN_REGADDR(LOFN_WIN_2, ridx, 0), rp->w, 1024/32);
+#endif
}
void
diff --git a/sys/dev/pci/nofn.c b/sys/dev/pci/nofn.c
index 2f356ebae10..4a5a12e5b5a 100644
--- a/sys/dev/pci/nofn.c
+++ b/sys/dev/pci/nofn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nofn.c,v 1.4 2002/05/16 22:52:17 jason Exp $ */
+/* $OpenBSD: nofn.c,v 1.5 2002/09/18 04:32:59 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -498,8 +498,13 @@ nofn_pk_read_reg(sc, ridx, rp)
int ridx;
union nofn_pk_reg *rp;
{
+#if BYTE_ORDER == BIG_ENDIAN
+ bus_space_read_region_4(sc->sc_pk_t, sc->sc_pk_h,
+ NOFN_PK_REGADDR(NOFN_PK_WIN_0, ridx, 0), rp->w, 1024/32);
+#else
bus_space_read_region_4(sc->sc_pk_t, sc->sc_pk_h,
NOFN_PK_REGADDR(NOFN_PK_WIN_2, ridx, 0), rp->w, 1024/32);
+#endif
}
void
@@ -508,8 +513,13 @@ nofn_pk_write_reg(sc, ridx, rp)
int ridx;
union nofn_pk_reg *rp;
{
+#if BYTE_ORDER == BIG_ENDIAN
+ bus_space_write_region_4(sc->sc_pk_t, sc->sc_pk_h,
+ NOFN_PK_REGADDR(NOFN_PK_WIN_0, ridx, 0), rp->w, 1024/32);
+#else
bus_space_write_region_4(sc->sc_pk_t, sc->sc_pk_h,
NOFN_PK_REGADDR(NOFN_PK_WIN_2, ridx, 0), rp->w, 1024/32);
+#endif
}
void