+/* $OpenBSD: bus.h,v 1.2 2021/04/24 21:37:41 kettenis Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved.
*
#define bus_space_subregion(t, h, o, s, p) \
(*(t)->_space_subregion)((t), (h), (o), (s), (p))
-#define BUS_SPACE_MAP_CACHEABLE 0x01
-#define BUS_SPACE_MAP_KSEG0 0x02
-#define BUS_SPACE_MAP_LINEAR 0x04
-#define BUS_SPACE_MAP_PREFETCHABLE 0x08
+#define BUS_SPACE_MAP_CACHEABLE 0x01
+#define BUS_SPACE_MAP_LINEAR 0x02
+#define BUS_SPACE_MAP_PREFETCHABLE 0x04
#define bus_space_vaddr(t, h) (*(t)->_space_vaddr)((t), (h))
#define bus_space_mmap(t, a, o, p, f) \
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)
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)
{ \
while (cnt--) { \
CAT(bus_space_write_,n)(bst, bsh, ba, *x++); \
- ba += sizeof(x); \
+ ba += (n); \
} \
}
{ \
while (cnt--) { \
CAT(bus_space_write_,n)(bst, bsh, ba, x); \
- ba += sizeof(x); \
+ ba += (n); \
} \
}