6 #include <asm-generic/io.h>
8 /* H8/300 internal I/O functions */
9 static inline unsigned char ctrl_inb(unsigned long addr
)
11 return *(volatile unsigned char *)addr
;
14 static inline unsigned short ctrl_inw(unsigned long addr
)
16 return *(volatile unsigned short *)addr
;
19 static inline unsigned long ctrl_inl(unsigned long addr
)
21 return *(volatile unsigned long *)addr
;
24 static inline void ctrl_outb(unsigned char b
, unsigned long addr
)
26 *(volatile unsigned char *)addr
= b
;
29 static inline void ctrl_outw(unsigned short b
, unsigned long addr
)
31 *(volatile unsigned short *)addr
= b
;
34 static inline void ctrl_outl(unsigned long b
, unsigned long addr
)
36 *(volatile unsigned long *)addr
= b
;
39 static inline void ctrl_bclr(int b
, unsigned char *addr
)
41 if (__builtin_constant_p(b
))
42 __asm__("bclr %1,%0" : "+WU"(*addr
): "i"(b
));
44 __asm__("bclr %w1,%0" : "+WU"(*addr
): "r"(b
));
47 static inline void ctrl_bset(int b
, unsigned char *addr
)
49 if (__builtin_constant_p(b
))
50 __asm__("bset %1,%0" : "+WU"(*addr
): "i"(b
));
52 __asm__("bset %w1,%0" : "+WU"(*addr
): "r"(b
));
55 #endif /* __KERNEL__ */
57 #endif /* _H8300_IO_H */