diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-04-30 21:32:55 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-04-30 21:32:55 +0000 |
commit | 34e83f1524c0995fa35e74ff0fee2625a6e23dfb (patch) | |
tree | 6274a3290460c1cc80b5f1c557082a8db602241d /sys/arch/mvme88k/include | |
parent | ed986407136d3fcb0fd4451a87a71976656a7a1f (diff) |
Correctly cope with unaligned memory pointers in d16_b*()
Diffstat (limited to 'sys/arch/mvme88k/include')
-rw-r--r-- | sys/arch/mvme88k/include/bus.h | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/sys/arch/mvme88k/include/bus.h b/sys/arch/mvme88k/include/bus.h index 909ed9402ea..c86dba34766 100644 --- a/sys/arch/mvme88k/include/bus.h +++ b/sys/arch/mvme88k/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.1 2004/04/24 19:51:48 miod Exp $ */ +/* $OpenBSD: bus.h,v 1.2 2004/04/30 21:32:54 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * @@ -711,38 +711,11 @@ bus_space_copy_4(bus_space_tag_t tag, bus_space_handle_t h1, bus_addr_t o1, } /* - * Extra D16 access functions - * - * D16 cards will trigger bus errors on attempting to read or write more - * than 16 bits on the bus. Given how the m88k processor works, this means - * basically that all long (D32) accesses must be carefully taken care of. - * - * Since the kernels bcopy() and bzero() routines will use 32 bit accesses - * for performance, here are specific D16-compatible routines. They expect - * pointers to be 16-bit aligned. + * Extra D16 access functions (see vme.c) */ -static void d16_bcopy(const void *, void *, size_t); -static void d16_bzero(void *, size_t); - -static __inline__ void -d16_bcopy(const void *src, void *dst, size_t len) -{ - extern const struct mvme88k_bus_space_tag vme_bustag; - bus_space_write_region_2(&vme_bustag, 0, (vaddr_t)dst/*XXX*/, (void *)src, len / 2); - if (len & 1) - bus_space_write_1(&vme_bustag, 0, dst + len - 1, - *(u_int8_t *)((vaddr_t)src + len - 1)); -} - -static __inline__ void -d16_bzero(void *dst, size_t len) -{ - extern const struct mvme88k_bus_space_tag vme_bustag; - bus_space_set_region_2(&vme_bustag, 0, (vaddr_t)dst/*XXX*/, 0, len / 2); - if (len & 1) - bus_space_write_1(&vme_bustag, 0, dst + len - 1, 0); -} +void d16_bcopy(const void *, void *, size_t); +void d16_bzero(void *, size_t); #endif /* __BUS_SPACE_RESTRICT_D16__ */ |