summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-02-07 03:20:38 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-02-07 03:20:38 +0000
commitf7b690bf2e83b1a18c85d14de7d2a441d99fd86c (patch)
treee97a67d29028043b852d2e036912d25e1dccb582
parent396055a91ca64fa179bcdd3ac12af4b842ea5aae (diff)
bus_space_{read,write}_raw_region_[24] take the length of the buffer theyre
operating on as bytes, not as the number of words or dwords. ok drahn@ kettenis@
-rw-r--r--sys/arch/macppc/include/bus.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/macppc/include/bus.h b/sys/arch/macppc/include/bus.h
index 0e3c3b0637a..b56a5f57750 100644
--- a/sys/arch/macppc/include/bus.h
+++ b/sys/arch/macppc/include/bus.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus.h,v 1.12 2005/06/08 19:08:23 drahn Exp $ */
+/* $OpenBSD: bus.h,v 1.13 2007/02/07 03:20:37 dlg Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom. All rights reserved.
@@ -253,6 +253,8 @@ bus_space_read_raw_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
volatile u_int16_t *s = __BA(tag, bsh, offset);
u_int16_t *laddr = (void *)addr;
+ count = count >> 1;
+
while (count--)
*laddr++ = *s++;
__asm __volatile("eieio; sync");
@@ -265,6 +267,8 @@ bus_space_read_raw_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
volatile u_int32_t *s = __BA(tag, bsh, offset);
u_int32_t *laddr = (void *)addr;
+ count = count >> 2;
+
while (count--)
*laddr++ = *s++;
__asm __volatile("eieio; sync");
@@ -292,6 +296,8 @@ bus_space_write_raw_region_2(bus_space_tag_t tag, bus_space_handle_t bsh,
volatile u_int16_t *d = __BA(tag, bsh, offset);
const u_int16_t *laddr = (void *)addr;
+ count = count >> 1;
+
while (count--)
*d++ = *laddr++;
__asm __volatile("eieio; sync");
@@ -304,6 +310,8 @@ bus_space_write_raw_region_4(bus_space_tag_t tag, bus_space_handle_t bsh,
volatile u_int32_t *d = __BA(tag, bsh, offset);
const u_int32_t *laddr = (void *)addr;
+ count = count >> 2;
+
while (count--)
*d++ = *laddr++;
__asm __volatile("eieio; sync");