import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / include / asm-arm / arch-ebsa110 / io.h
1 /*
2  *  linux/include/asm-arm/arch-ebsa110/io.h
3  *
4  *  Copyright (C) 1997,1998 Russell King
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * Modifications:
11  *  06-Dec-1997 RMK     Created.
12  */
13 #ifndef __ASM_ARM_ARCH_IO_H
14 #define __ASM_ARM_ARCH_IO_H
15
16 #define IO_SPACE_LIMIT 0xffff
17
18 /*
19  * Generic virtual read/write
20  */
21 #define __arch_getw(a)          (*(volatile unsigned short *)(a))
22 #define __arch_putw(v,a)        (*(volatile unsigned short *)(a) = (v))
23
24 u8 __inb8(unsigned int port);
25 void __outb8(u8  val, unsigned int port);
26
27 u8 __inb16(unsigned int port);
28 void __outb16(u8  val, unsigned int port);
29
30 u16 __inw(unsigned int port);
31 void __outw(u16 val, unsigned int port);
32
33 u32 __inl(unsigned int port);
34 void __outl(u32 val, unsigned int port);
35
36 u8  __readb(void *addr);
37 u16 __readw(void *addr);
38 u32 __readl(void *addr);
39
40 void __writeb(u8  val, void *addr);
41 void __writew(u16 val, void *addr);
42 void __writel(u32 val, void *addr);
43
44 /*
45  * Argh, someone forgot the IOCS16 line.  We therefore have to handle
46  * the byte stearing by selecting the correct byte IO functions here.
47  */
48 #ifdef ISA_SIXTEEN_BIT_PERIPHERAL
49 #define inb(p)                  __inb16(p)
50 #define outb(v,p)               __outb16(v,p)
51 #else
52 #define inb(p)                  __inb8(p)
53 #define outb(v,p)               __outb8(v,p)
54 #endif
55
56 #define inw(p)                  __inw(p)
57 #define outw(v,p)               __outw(v,p)
58
59 #define inl(p)                  __inl(p)
60 #define outl(v,p)               __outl(v,p)
61
62 #define readb(b)                __readb(b)
63 #define readw(b)                __readw(b)
64 #define readl(b)                __readl(b)
65
66 #define writeb(v,b)             __writeb(v,b)
67 #define writew(v,b)             __writew(v,b)
68 #define writel(v,b)             __writel(v,b)
69
70 #define __arch_ioremap(off,sz,c)        ((void *)(off))
71 #define __arch_iounmap(virt)            do { } while (0)
72
73 extern void insb(unsigned int port, void *buf, int sz);
74 extern void insw(unsigned int port, void *buf, int sz);
75 extern void insl(unsigned int port, void *buf, int sz);
76
77 extern void outsb(unsigned int port, const void *buf, int sz);
78 extern void outsw(unsigned int port, const void *buf, int sz);
79 extern void outsl(unsigned int port, const void *buf, int sz);
80
81 #endif