From 1935043e89b498cfc8824f2abbb9d495684609db Mon Sep 17 00:00:00 2001 From: grehan Date: Thu, 19 Sep 2002 04:44:04 +0000 Subject: [PATCH] Added sparse address support, required by the macio ATA device Approved by: benno --- sys/powerpc/include/bus.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/powerpc/include/bus.h b/sys/powerpc/include/bus.h index 8eaa8134a9f4..561ee281c463 100644 --- a/sys/powerpc/include/bus.h +++ b/sys/powerpc/include/bus.h @@ -91,11 +91,16 @@ /* * Values for the ppc bus space tag, not to be used directly by MI code. + * Low byte contains the shift value */ -#define PPC_BUS_SPACE_MEM 1 /* space is mem space */ +#define PPC_BUS_SPACE_MEM 0x100 /* space is mem space */ +#define PPC_BUS_MEM_MASK 0x0ff - -#define __BA(t, h, o) ((void *)((h) + (o))) +/* + * Flags for bus_resource_alloc(MEM|IOPORT). XXX this is very bad: it's + * assumed that this won't conflict with resource flags :-( + */ +#define PPC_BUS_SPARSE4 0x800000 /* shift offset left 4 bits */ /* * Bus address and size types @@ -112,7 +117,7 @@ typedef u_int32_t bus_space_handle_t; static __inline void * __ppc_ba(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t offset) { - return ((void *)(handle + offset)); + return ((void *)(handle + (offset << (tag & PPC_BUS_MEM_MASK)))); }