[PATCH] fix semaphore handling in __unregister_chrdev_region
[linux/fpc-iii.git] / include / asm-cris / io.h
blob1d2b51701e8d7019acbf80b3dbc4c5e8d618e975
1 #ifndef _ASM_CRIS_IO_H
2 #define _ASM_CRIS_IO_H
4 #include <asm/page.h> /* for __va, __pa */
5 #include <asm/arch/io.h>
7 /*
8 * Change virtual addresses to physical addresses and vv.
9 */
11 extern inline unsigned long virt_to_phys(volatile void * address)
13 return __pa(address);
16 extern inline void * phys_to_virt(unsigned long address)
18 return __va(address);
21 extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
23 extern inline void * ioremap (unsigned long offset, unsigned long size)
25 return __ioremap(offset, size, 0);
28 extern void iounmap(void *addr);
31 * IO bus memory addresses are also 1:1 with the physical address
33 #define virt_to_bus virt_to_phys
34 #define bus_to_virt phys_to_virt
37 * readX/writeX() are used to access memory mapped devices. On some
38 * architectures the memory mapped IO stuff needs to be accessed
39 * differently. On the CRIS architecture, we just read/write the
40 * memory location directly.
42 #define readb(addr) (*(volatile unsigned char *) (addr))
43 #define readw(addr) (*(volatile unsigned short *) (addr))
44 #define readl(addr) (*(volatile unsigned int *) (addr))
45 #define readb_relaxed(addr) readb(addr)
46 #define readw_relaxed(addr) readw(addr)
47 #define readl_relaxed(addr) readl(addr)
48 #define __raw_readb readb
49 #define __raw_readw readw
50 #define __raw_readl readl
52 #define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
53 #define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
54 #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
55 #define __raw_writeb writeb
56 #define __raw_writew writew
57 #define __raw_writel writel
59 #define mmiowb()
61 #define memset_io(a,b,c) memset((void *)(a),(b),(c))
62 #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
63 #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
66 * Again, CRIS does not require mem IO specific function.
69 #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))
71 /* The following is junk needed for the arch-independent code but which
72 * we never use in the CRIS port
75 #define IO_SPACE_LIMIT 0xffff
76 #define inb(x) (0)
77 #define inw(x) (0)
78 #define inl(x) (0)
79 #define outb(x,y)
80 #define outw(x,y)
81 #define outl(x,y)
82 #define insb(x,y,z)
83 #define insw(x,y,z)
84 #define insl(x,y,z)
85 #define outsb(x,y,z)
86 #define outsw(x,y,z)
87 #define outsl(x,y,z)
90 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
91 * access
93 #define xlate_dev_mem_ptr(p) __va(p)
96 * Convert a virtual cached pointer to an uncached pointer
98 #define xlate_dev_kmem_ptr(p) p
100 #endif