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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-i960/] [io.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#ifndef _I960_IO_H
2
#define _I960_IO_H
3
 
4
/*
5
 * readX/writeX() are used to access I/O space-- the address space the PCI
6
 * speaks in. On the i960 architecture, some PCI addresses can be translated
7
 * by the atu directly, and some cannot. These functions are non-trivial.
8
 */
9
extern unsigned char readb(char* addr);
10
extern unsigned short readw(char* addr);
11
extern unsigned int readl(char* addr);
12
 
13
extern unsigned char writeb(unsigned char val, char* addr);
14
extern unsigned short writew(unsigned short val, char* addr);
15
extern unsigned int writel(unsigned int val, char* addr);
16
 
17
#define outb_p  writeb
18
#define outb    writeb
19
#define outw    writew
20
#define outl    writel
21
#define inb_p   readb
22
#define inb     readb
23
#define inw     readw
24
#define inl     readl
25
 
26
 
27
/*
28
 * Change virtual addresses to physical addresses and vv.
29
 * These are trivial on the 1:1 Linux/i386 mapping (but if we ever
30
 * make the kernel segment mapped at 0, we need to do translation
31
 * on the i386 as well)
32
 */
33
extern unsigned long mm_vtop(unsigned long addr);
34
extern unsigned long mm_ptov(unsigned long addr);
35
 
36
extern inline unsigned long virt_to_phys(volatile void * address)
37
{
38
        return (unsigned long) mm_vtop((unsigned long)address);
39
}
40
 
41
extern inline void * phys_to_virt(unsigned long address)
42
{
43
        return (void *) mm_ptov(address);
44
}
45
 
46
/*
47
 * IO bus memory addresses are also 1:1 with the physical address
48
 * XXX: umm, not really
49
 */
50
#define virt_to_bus virt_to_phys
51
#define bus_to_virt phys_to_virt
52
 
53
 
54
#endif /* _I960_IO_H */

powered by: WebSVN 2.1.0

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