diff options
author | grehan <grehan@FreeBSD.org> | 2002-09-19 04:44:04 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2002-09-19 04:44:04 +0000 |
commit | 12ec2e7c5de76c727568fc479746b6e445d67f5a (patch) | |
tree | de8f9a65e925bec200890aa6ff4a2c1170c9be53 | |
parent | 4e75b6dbdf8a6d30bbdd011481eb551ca8db71f8 (diff) | |
download | FreeBSD-src-12ec2e7c5de76c727568fc479746b6e445d67f5a.zip FreeBSD-src-12ec2e7c5de76c727568fc479746b6e445d67f5a.tar.gz |
Added sparse address support, required by the macio ATA device
Approved by: benno
-rw-r--r-- | sys/powerpc/include/bus.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/powerpc/include/bus.h b/sys/powerpc/include/bus.h index 8eaa813..561ee28 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)))); } |