diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-01-17 01:14:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 02:15:28 -0500 |
commit | b66c1a3919abb40f9bd8fb92a0d9fd77eb899c54 (patch) | |
tree | e83c11e63f760e8a3c09ab44e8c951a6df0400b7 /include/asm-sh/io_generic.h | |
parent | bf3a00f88c926635932c91afd90b4a0907dfbe78 (diff) |
[PATCH] sh: I/O routine cleanups and ioremap() overhaul
This introduces a few changes in the way that the I/O routines are defined on
SH, specifically so that things like the iomap API properly wrap through the
machvec for board-specific quirks.
In addition to this, the old p3_ioremap() work is converted to a more generic
__ioremap() that will map through the PMB if it's available, or fall back on
page tables for everything else.
An alpha-like IO_CONCAT is also added so we can start to clean up the
board-specific io.h mess, which will be handled in board update patches..
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh/io_generic.h')
-rw-r--r-- | include/asm-sh/io_generic.h | 96 |
1 files changed, 47 insertions, 49 deletions
diff --git a/include/asm-sh/io_generic.h b/include/asm-sh/io_generic.h index be14587342f7..92fc6070d7b3 100644 --- a/include/asm-sh/io_generic.h +++ b/include/asm-sh/io_generic.h | |||
@@ -1,51 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-sh/io_generic.h | 2 | * Trivial I/O routine definitions, intentionally meant to be included |
3 | * | 3 | * multiple times. Ugly I/O routine concatenation helpers taken from |
4 | * Copyright 2000 Stuart Menefy (stuart.menefy@st.com) | 4 | * alpha. Must be included _before_ io.h to avoid preprocessor-induced |
5 | * | 5 | * routine mismatch. |
6 | * May be copied or modified under the terms of the GNU General Public | ||
7 | * License. See linux/COPYING for more information. | ||
8 | * | ||
9 | * Generic IO functions | ||
10 | */ | 6 | */ |
11 | 7 | #define IO_CONCAT(a,b) _IO_CONCAT(a,b) | |
12 | #ifndef _ASM_SH_IO_GENERIC_H | 8 | #define _IO_CONCAT(a,b) a ## _ ## b |
13 | #define _ASM_SH_IO_GENERIC_H | 9 | |
14 | 10 | #ifndef __IO_PREFIX | |
15 | extern unsigned long generic_io_base; | 11 | #error "Don't include this header without a valid system prefix" |
16 | 12 | #endif | |
17 | extern unsigned char generic_inb(unsigned long port); | 13 | |
18 | extern unsigned short generic_inw(unsigned long port); | 14 | u8 IO_CONCAT(__IO_PREFIX,inb)(unsigned long); |
19 | extern unsigned int generic_inl(unsigned long port); | 15 | u16 IO_CONCAT(__IO_PREFIX,inw)(unsigned long); |
20 | 16 | u32 IO_CONCAT(__IO_PREFIX,inl)(unsigned long); | |
21 | extern void generic_outb(unsigned char value, unsigned long port); | 17 | |
22 | extern void generic_outw(unsigned short value, unsigned long port); | 18 | void IO_CONCAT(__IO_PREFIX,outb)(u8, unsigned long); |
23 | extern void generic_outl(unsigned int value, unsigned long port); | 19 | void IO_CONCAT(__IO_PREFIX,outw)(u16, unsigned long); |
24 | 20 | void IO_CONCAT(__IO_PREFIX,outl)(u32, unsigned long); | |
25 | extern unsigned char generic_inb_p(unsigned long port); | 21 | |
26 | extern unsigned short generic_inw_p(unsigned long port); | 22 | u8 IO_CONCAT(__IO_PREFIX,inb_p)(unsigned long); |
27 | extern unsigned int generic_inl_p(unsigned long port); | 23 | u16 IO_CONCAT(__IO_PREFIX,inw_p)(unsigned long); |
28 | extern void generic_outb_p(unsigned char value, unsigned long port); | 24 | u32 IO_CONCAT(__IO_PREFIX,inl_p)(unsigned long); |
29 | extern void generic_outw_p(unsigned short value, unsigned long port); | 25 | void IO_CONCAT(__IO_PREFIX,outb_p)(u8, unsigned long); |
30 | extern void generic_outl_p(unsigned int value, unsigned long port); | 26 | void IO_CONCAT(__IO_PREFIX,outw_p)(u16, unsigned long); |
31 | 27 | void IO_CONCAT(__IO_PREFIX,outl_p)(u32, unsigned long); | |
32 | extern void generic_insb(unsigned long port, void *addr, unsigned long count); | 28 | |
33 | extern void generic_insw(unsigned long port, void *addr, unsigned long count); | 29 | void IO_CONCAT(__IO_PREFIX,insb)(unsigned long, void *dst, unsigned long count); |
34 | extern void generic_insl(unsigned long port, void *addr, unsigned long count); | 30 | void IO_CONCAT(__IO_PREFIX,insw)(unsigned long, void *dst, unsigned long count); |
35 | extern void generic_outsb(unsigned long port, const void *addr, unsigned long count); | 31 | void IO_CONCAT(__IO_PREFIX,insl)(unsigned long, void *dst, unsigned long count); |
36 | extern void generic_outsw(unsigned long port, const void *addr, unsigned long count); | 32 | void IO_CONCAT(__IO_PREFIX,outsb)(unsigned long, const void *src, unsigned long count); |
37 | extern void generic_outsl(unsigned long port, const void *addr, unsigned long count); | 33 | void IO_CONCAT(__IO_PREFIX,outsw)(unsigned long, const void *src, unsigned long count); |
38 | 34 | void IO_CONCAT(__IO_PREFIX,outsl)(unsigned long, const void *src, unsigned long count); | |
39 | extern unsigned char generic_readb(unsigned long addr); | 35 | |
40 | extern unsigned short generic_readw(unsigned long addr); | 36 | u8 IO_CONCAT(__IO_PREFIX,readb)(void __iomem *); |
41 | extern unsigned int generic_readl(unsigned long addr); | 37 | u16 IO_CONCAT(__IO_PREFIX,readw)(void __iomem *); |
42 | extern void generic_writeb(unsigned char b, unsigned long addr); | 38 | u32 IO_CONCAT(__IO_PREFIX,readl)(void __iomem *); |
43 | extern void generic_writew(unsigned short b, unsigned long addr); | 39 | void IO_CONCAT(__IO_PREFIX,writeb)(u8, void __iomem *); |
44 | extern void generic_writel(unsigned int b, unsigned long addr); | 40 | void IO_CONCAT(__IO_PREFIX,writew)(u16, void __iomem *); |
45 | 41 | void IO_CONCAT(__IO_PREFIX,writel)(u32, void __iomem *); | |
46 | extern void *generic_ioremap(unsigned long offset, unsigned long size); | 42 | |
47 | extern void generic_iounmap(void *addr); | 43 | void *IO_CONCAT(__IO_PREFIX,ioremap)(unsigned long offset, unsigned long size); |
48 | 44 | void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr); | |
49 | extern unsigned long generic_isa_port2addr(unsigned long offset); | 45 | |
50 | 46 | void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); | |
51 | #endif /* _ASM_SH_IO_GENERIC_H */ | 47 | void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); |
48 | |||
49 | #undef __IO_PREFIX | ||