diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-05-03 12:23:26 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-05-03 12:23:26 +0000 |
commit | 155a5a030fff26aa4b8bc0cfde3bd7516637262d (patch) | |
tree | aeed81a4c6f3393e7182602c5ad01b45c76c36eb /sys | |
parent | ff96b2ee8eb575a75fa96817d1a60615703489df (diff) |
implement bus_space_read_raw_X and bus_space_write_raw_X
with feedback from kettenis@
fixes building a kernel with xge, which might actually work on these
machines now.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/include/bus.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/sys/arch/macppc/include/bus.h b/sys/arch/macppc/include/bus.h index bfd11f58a36..704901adba7 100644 --- a/sys/arch/macppc/include/bus.h +++ b/sys/arch/macppc/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.24 2015/01/24 20:59:42 kettenis Exp $ */ +/* $OpenBSD: bus.h,v 1.25 2016/05/03 12:23:25 dlg Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom. All rights reserved. @@ -118,6 +118,34 @@ bus_space_write(4,32) #define bus_space_write_8 !!! bus_space_write_8 unimplemented !!! +#define bus_space_read_raw(n,m) \ +static __inline CAT3(u_int,m,_t) \ +CAT(bus_space_read_raw_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ + bus_addr_t ba) \ +{ \ + return CAT(in,m)((volatile CAT3(u_int,m,_t) *)(bsh + (ba))); \ +} + +bus_space_read_raw(1,8) +bus_space_read_raw(2,16) +bus_space_read_raw(4,32) + +#define bus_space_read_raw_8 !!! bus_space_read_raw_8 unimplemented !!! + +#define bus_space_write_raw(n,m) \ +static __inline void \ +CAT(bus_space_write_raw_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ + bus_addr_t ba, CAT3(u_int,m,_t) x) \ +{ \ + CAT(out,m)((volatile CAT3(u_int,m,_t) *)(bsh + (ba)), x); \ +} + +bus_space_write_raw(1,8) +bus_space_write_raw(2,16) +bus_space_write_raw(4,32) + +#define bus_space_write_raw_8 !!! bus_space_write_raw_8 unimplemented !!! + #define bus_space_read_multi(n, m) \ static __inline void \ CAT(bus_space_read_multi_,n)(bus_space_tag_t bst, bus_space_handle_t bsh, \ |