This source file includes following definitions.
- get_user_byte_io
- put_user_byte_io
- virt_to_phys
- phys_to_virt
1 #ifndef _M68K_IO_H
2 #define _M68K_IO_H
3
4 static inline unsigned char get_user_byte_io(const char * addr)
5 {
6 register unsigned char _v;
7
8 __asm__ __volatile__ ("moveb %1,%0":"=dm" (_v):"m" (*addr));
9 return _v;
10 }
11 #define inb_p(addr) get_user_byte_io((char *)(addr))
12 #define inb(addr) get_user_byte_io((char *)(addr))
13
14 static inline void put_user_byte_io(char val,char *addr)
15 {
16 __asm__ __volatile__ ("moveb %0,%1"
17 :
18 :"idm" (val),"m" (*addr)
19 : "memory");
20 }
21 #define outb_p(x,addr) put_user_byte_io((x),(char *)(addr))
22 #define outb(x,addr) put_user_byte_io((x),(char *)(addr))
23
24
25
26
27
28
29
30 extern unsigned long mm_vtop(unsigned long addr);
31 extern unsigned long mm_ptov(unsigned long addr);
32
33 extern inline unsigned long virt_to_phys(volatile void * address)
34 {
35 return (unsigned long) mm_vtop((unsigned long)address);
36 }
37
38 extern inline void * phys_to_virt(unsigned long address)
39 {
40 return (void *) mm_ptov(address);
41 }
42
43
44
45
46 #define virt_to_bus virt_to_phys
47 #define bus_to_virt phys_to_virt
48
49
50 #endif