diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-10-01 04:13:01 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-10-01 04:13:01 +0000 |
commit | f51b2f948733d263d3ccbcca203d7d0164dde970 (patch) | |
tree | d7e2575172746a50949a10d2a503389aa9808c7d /sys/arch/arm | |
parent | 20b4aa147dbdab24c3d58ed298d099b9d885f6e1 (diff) |
Missing pieces of the bus_space abi, found when attempting to compile a
new driver.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/include/bus.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/arch/arm/include/bus.h b/sys/arch/arm/include/bus.h index e33828a136c..b4d1713078d 100644 --- a/sys/arch/arm/include/bus.h +++ b/sys/arch/arm/include/bus.h @@ -1068,4 +1068,48 @@ bus_space_write_raw_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, #endif +/* + * void bus_space_read_raw_region_N(bus_space_tag_t tag, + * bus_space_handle_t bsh, bus_size_t offset, + * u_int8_t *addr, size_t count); + * + * Read `count' bytes in 2, 4 or 8 byte wide quantities from bus space + * described by tag/handle and starting at `offset' and copy into + * buffer provided. The buffer must have proper alignment for the N byte + * wide entities. Furthermore possible byte-swapping should be done by + * these functions. + */ + +#define bus_space_read_raw_region_2(t, h, o, a, c) \ + bus_space_read_region_2((t), (h), (o), (u_int16_t *)(a), (c) >> 1) +#define bus_space_read_raw_region_4(t, h, o, a, c) \ + bus_space_read_region_4((t), (h), (o), (u_int32_t *)(a), (c) >> 2) + +#if 0 /* Cause a link error for bus_space_read_raw_region_8 */ +#define bus_space_read_raw_region_8 \ + !!! bus_space_read_raw_region_8 unimplemented !!! +#endif + +/* + * void bus_space_write_raw_region_N(bus_space_tag_t tag, + * bus_space_handle_t bsh, bus_size_t offset, + * const u_int8_t *addr, size_t count); + * + * Write `count' bytes in 2, 4 or 8 byte wide quantities to bus space + * described by tag/handle and starting at `offset' from the + * buffer provided. The buffer must have proper alignment for the N byte + * wide entities. Furthermore possible byte-swapping should be done by + * these functions. + */ + +#define bus_space_write_raw_region_2(t, h, o, a, c) \ + bus_space_write_region_2((t), (h), (o), (const u_int16_t *)(a), (c) >> 1) +#define bus_space_write_raw_region_4(t, h, o, a, c) \ + bus_space_write_region_4((t), (h), (o), (const u_int32_t *)(a), (c) >> 2) + +#if 0 /* Cause a link error for bus_space_write_raw_region_8 */ +#define bus_space_write_raw_region_8 \ + !!! bus_space_write_raw_region_8 unimplemented !!! +#endif + #endif /* _ARM32_BUS_H_ */ |