summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-11-29 14:41:10 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-11-29 14:41:10 +0000
commitc20a87db124419c3717a5b0fe5cb4031cf733afe (patch)
tree6d3529268807cd05937c095a794ff53c5e5e69d8
parent160c39c2867315a536b6441ade3adf8282ff8cf0 (diff)
ips firmware runs on a little-endian cpu so do endian conversion
in i/o access macros.
-rw-r--r--sys/dev/pci/ips.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c
index 73555ad1b70..fd913feb939 100644
--- a/sys/dev/pci/ips.c
+++ b/sys/dev/pci/ips.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ips.c,v 1.13 2006/11/29 14:38:17 grange Exp $ */
+/* $OpenBSD: ips.c,v 1.14 2006/11/29 14:41:09 grange Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -24,6 +24,7 @@
#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/device.h>
+#include <sys/endian.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/timeout.h>
@@ -178,9 +179,9 @@ struct ips_driveinfo {
/* I/O access helper macros */
#define IPS_READ_4(s, r) \
- bus_space_read_4((s)->sc_iot, (s)->sc_ioh, (r))
+ letoh32(bus_space_read_4((s)->sc_iot, (s)->sc_ioh, (r)))
#define IPS_WRITE_4(s, r, v) \
- bus_space_write_4((s)->sc_iot, (s)->sc_ioh, (r), (v))
+ bus_space_write_4((s)->sc_iot, (s)->sc_ioh, (r), htole32((v)))
struct ccb {
int c_id;