diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-11 23:15:22 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-08-11 23:15:22 +0000 |
commit | ce1d73cdded1b7c6cf8cf01a10068b4cbded384d (patch) | |
tree | 444236e0380b5b61006ee933d962a5f472302061 | |
parent | 3142c2ac925db5e97494d72d15e66511d1af598e (diff) |
Add a slew of new bus_*_region_* functions
-rw-r--r-- | sys/arch/arc/include/bus.h | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/sys/arch/arc/include/bus.h b/sys/arch/arc/include/bus.h index 5251a510c4c..deb60661090 100644 --- a/sys/arch/arc/include/bus.h +++ b/sys/arch/arc/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.14 1998/01/20 18:40:11 niklas Exp $ */ +/* $OpenBSD: bus.h,v 1.15 1999/08/11 23:15:21 niklas Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom. All rights reserved. @@ -70,6 +70,9 @@ extern struct arc_bus_space arc_bus_io, arc_bus_mem; #define bus_space_unmap(t, bsh, size) +#define bus_space_subregion(t, bsh, offset, size, nbshp) \ + ((*(nbshp) = (bsh) + (offset)), 0) + #define bus_space_read(n,m) \ static __inline CAT3(u_int,m,_t) \ CAT(bus_space_read_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ @@ -98,6 +101,21 @@ bus_space_read(4,32) #define bus_space_read_multi_8 !!! bus_space_read_multi_8 not implemented !!! +#define bus_space_read_region(n,m) \ +static __inline void \ +CAT(bus_space_read_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ + bus_addr_t ba, CAT3(u_int,m,_t) *x, size_t cnt) \ +{ \ + while (cnt--) \ + *x++ = CAT(bus_space_read_,n)(bst, bsh, ba++); \ +} + +bus_space_read_region(1,8) +bus_space_read_region(2,16) +bus_space_read_region(4,32) + +#define bus_space_read_region_8 !!! bus_space_read_region_8 not implemented !!! + #define bus_space_write(n,m) \ static __inline void \ CAT(bus_space_write_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ @@ -127,6 +145,38 @@ bus_space_write(4,32) #define bus_space_write_multi_8 !!! bus_space_write_multi_8 not implemented !!! +#define bus_space_write_region(n,m) \ +static __inline void \ +CAT(bus_space_write_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ + bus_addr_t ba, const CAT3(u_int,m,_t) *x, size_t cnt) \ +{ \ + while (cnt--) \ + CAT(bus_space_write_,n)(bst, bsh, ba++, *x++); \ +} + +bus_space_write_region(1,8) +bus_space_write_region(2,16) +bus_space_write_region(4,32) + +#define bus_space_write_region_8 \ + !!! bus_space_write_region_8 not implemented !!! + +#define bus_space_set_region(n,m) \ +static __inline void \ +CAT(bus_space_set_region_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ + bus_addr_t ba, CAT3(u_int,m,_t) x, size_t cnt) \ +{ \ + while (cnt--) \ + CAT(bus_space_write_,n)(bst, bsh, ba++, x); \ +} + +bus_space_set_region(1,8) +bus_space_set_region(2,16) +bus_space_set_region(4,32) + +#define bus_space_write_8 !!! bus_space_write_8 unimplemented !!! + + /* These are OpenBSD extensions to the general NetBSD bus interface. */ #define bus_space_read_raw_multi(n,m,l) \ static __inline void \ |