From 3cee687e6dfd59999e92fd831f89807a14c7fc9a Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Wed, 30 Jun 2010 14:44:46 +0000 Subject: 2010-06-30 Till Straumann * libbsdport/bus.h: PPC's inlines from libcpu/io.h still have un-intuitive argument types (e.g., unsigned instead of uint32_t). Added additional 'iotype' arg to BUS_SPACE_DECL macro (ppc only) so that we can cast to the correct type as expected by libcpu/io.h. Hopefully that doesn't bring us into C99 alias hell. --- bsd_eth_drivers/libbsdport/bus.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bsd_eth_drivers/libbsdport/bus.h b/bsd_eth_drivers/libbsdport/bus.h index e4a9d29..e81bb99 100644 --- a/bsd_eth_drivers/libbsdport/bus.h +++ b/bsd_eth_drivers/libbsdport/bus.h @@ -86,16 +86,16 @@ bus_space_barrier(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, int wid } -#define BUS_SPACE_DECL(type, width, nwidth, op) \ +#define BUS_SPACE_DECL(type, iotype, width, nwidth, op) \ static inline type \ bus_space_read_##nwidth(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) \ { \ type v; \ if ( !BUS_SPACE_ALWAYS_MEM && bus_space_io == t ) { \ /* this is a macro setting the second argument */ \ - v = in_##op((volatile type *)(_IO_BASE+h+o)); \ + v = in_##op((volatile iotype *)(_IO_BASE+h+o)); \ } else { \ - v = in_##op((volatile type *)(h+o)); \ + v = in_##op((volatile iotype *)(h+o)); \ } \ return v; \ } \ @@ -104,15 +104,15 @@ static inline void \ bus_space_write_##nwidth(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, type v) \ { \ if ( !BUS_SPACE_ALWAYS_MEM && bus_space_io == t ) { \ - out_##op((volatile type *)(_IO_BASE+h+o), v); \ + out_##op((volatile iotype *)(_IO_BASE+h+o), v); \ } else { \ - out_##op((volatile type *)(h+o), v); \ + out_##op((volatile iotype *)(h+o), v); \ }\ } -BUS_SPACE_DECL(u_int32_t, long, 4, le32) -BUS_SPACE_DECL(u_int16_t, word, 2, le16) -BUS_SPACE_DECL(u_int8_t, byte, 1, 8) +BUS_SPACE_DECL(u_int32_t, unsigned, long, 4, le32) +BUS_SPACE_DECL(u_int16_t, unsigned short, word, 2, le16) +BUS_SPACE_DECL(u_int8_t, unsigned char, byte, 1, 8) #undef BUS_SPACE_ALWAYS_MEM -- cgit v1.2.3