summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-04-13 21:34:55 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-04-13 21:34:55 +0000
commit8dbeb96d543931ce5b1dfbbcdc20f391d0256664 (patch)
tree688c1a3f667b2cddd5d29d6ab85cb9b866ffbf43 /sys/arch
parent3dc9231338b85ca8b7625c2b666c270b83f1c0b0 (diff)
Fix some of the more esoteric bus_space functions. The
bus_space_read_region_n, bus_space_write_region_n and bus_space_set_region_n functions were all broken. Fixes mvneta(4) on arm64. ok patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/include/bus.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/arm64/include/bus.h b/sys/arch/arm64/include/bus.h
index 7f7d8e79dd6..73678b5bf81 100644
--- a/sys/arch/arm64/include/bus.h
+++ b/sys/arch/arm64/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.6 2019/06/03 13:09:56 patrick Exp $ */
+/* $OpenBSD: bus.h,v 1.7 2020/04/13 21:34:54 kettenis Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
*
@@ -159,8 +159,10 @@ static __inline void \
CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_addr_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \
{ \
- while (cnt--) \
- *x++ = CAT(bus_space_read_,n)(bst, bsh, ba++); \
+ while (cnt--) { \
+ *x++ = CAT(bus_space_read_,n)(bst, bsh, ba); \
+ ba += (n); \
+ } \
}
bus_space_read_region(1,8)
@@ -193,9 +195,8 @@ static __inline void \
CAT(bus_space_write_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
bus_size_t o, const CAT3(u_int,m,_t) *x, size_t cnt) \
{ \
- while (cnt--) { \
+ while (cnt--) \
CAT(bus_space_write_,n)(bst, bsh, o, *x++); \
- } \
}
bus_space_write_multi(1,8)
@@ -211,7 +212,7 @@ CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
{ \
while (cnt--) { \
CAT(bus_space_write_,n)(bst, bsh, ba, *x++); \
- ba += sizeof(x); \
+ ba += (n); \
} \
}
@@ -247,7 +248,7 @@ CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \
{ \
while (cnt--) { \
CAT(bus_space_write_,n)(bst, bsh, ba, x); \
- ba += sizeof(x); \
+ ba += (n); \
} \
}