OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-m68k/] [io.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#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
                              : /* no outputs */
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
 * Change virtual addresses to physical addresses and vv.
26
 * These are trivial on the 1:1 Linux/i386 mapping (but if we ever
27
 * make the kernel segment mapped at 0, we need to do translation
28
 * on the i386 as well)
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
 * IO bus memory addresses are also 1:1 with the physical address
45
 */
46
#define virt_to_bus virt_to_phys
47
#define bus_to_virt phys_to_virt
48
 
49
 
50
#endif /* _M68K_IO_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.