Added definition of unican_readw and unican_writew for PowerPC
[lincan.git] / lincan / include / unican_types.h
1 #ifndef _UNICAN_TYPES_H
2 #define _UNICAN_TYPES_H
3
4 #include <linux/types.h>
5
6 #ifndef U8
7 #define U8  __u8
8 #endif
9 #ifndef U16
10 #define U16 __u16
11 #endif
12 #ifndef U32
13 #define U32 __u32
14 #endif
15
16 #define BOOLEAN1 __u8
17
18 #ifndef FALSE
19 #define FALSE 0
20 #endif
21 #ifndef TRUE
22 #define TRUE  1
23 #endif
24
25 #ifdef CONFIG_PPC
26 #define unican_readw(addr) in_be16((volatile u16 *)(addr))
27 #define unican_writew(b,addr) out_be16((volatile u16 *)(addr),(b))
28 /* #define unican_readw(addr) (*(volatile __u16 *)(addr)) */
29 /* #define unican_writew(v, addr) (*(volatile __u16 *)(addr) = (v)) */
30 #else  /* CONFIG_PPC */
31 #define unican_readw(addr) readw(addr)
32 #define unican_writew(v, addr) writew(v, addr)
33 #endif /* CONFIG_PPC */
34
35 #endif /*_UNICAN_TYPES_H*/