summaryrefslogtreecommitdiffstats
path: root/bsd_eth_drivers/libbsdport/bus.h
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2010-06-30 14:44:46 +0000
committerTill Straumann <strauman@slac.stanford.edu>2010-06-30 14:44:46 +0000
commit3cee687e6dfd59999e92fd831f89807a14c7fc9a (patch)
treeffc65198f0c444709ae35086e2b9b1289e6ffcc4 /bsd_eth_drivers/libbsdport/bus.h
parent2010-06-30 Till Straumann <Till.Straumann@TU-Berlin.de> (diff)
downloadlibbsdport-3cee687e6dfd59999e92fd831f89807a14c7fc9a.tar.bz2
2010-06-30 Till Straumann <Till.Straumann@TU-Berlin.de>
* 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.
Diffstat (limited to 'bsd_eth_drivers/libbsdport/bus.h')
-rw-r--r--bsd_eth_drivers/libbsdport/bus.h16
1 files 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