diff options
| author | Steve French <sfrench@us.ibm.com> | 2006-01-17 22:49:59 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2006-01-17 22:49:59 -0500 |
| commit | d65177c1ae7f085723154105c5dc8d9e16ae8265 (patch) | |
| tree | 14408129d880d89cc5e937f2810f243ed1e6fcde /arch/sh/kernel/io.c | |
| parent | d41f084a74de860fe879403fbbad13abdf7aea8e (diff) | |
| parent | 15578eeb6cd4b74492f26e60624aa1a9a52ddd7b (diff) | |
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'arch/sh/kernel/io.c')
| -rw-r--r-- | arch/sh/kernel/io.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/arch/sh/kernel/io.c b/arch/sh/kernel/io.c index d9932f25993b..71c9fde2fd90 100644 --- a/arch/sh/kernel/io.c +++ b/arch/sh/kernel/io.c | |||
| @@ -2,58 +2,73 @@ | |||
| 2 | * linux/arch/sh/kernel/io.c | 2 | * linux/arch/sh/kernel/io.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2000 Stuart Menefy | 4 | * Copyright (C) 2000 Stuart Menefy |
| 5 | * Copyright (C) 2005 Paul Mundt | ||
| 5 | * | 6 | * |
| 6 | * Provide real functions which expand to whatever the header file defined. | 7 | * Provide real functions which expand to whatever the header file defined. |
| 7 | * Also definitions of machine independent IO functions. | 8 | * Also definitions of machine independent IO functions. |
| 9 | * | ||
| 10 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 11 | * License. See the file "COPYING" in the main directory of this archive | ||
| 12 | * for more details. | ||
| 8 | */ | 13 | */ |
| 9 | |||
| 10 | #include <asm/io.h> | ||
| 11 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 15 | #include <asm/machvec.h> | ||
| 16 | #include <asm/io.h> | ||
| 12 | 17 | ||
| 13 | /* | 18 | /* |
| 14 | * Copy data from IO memory space to "real" memory space. | 19 | * Copy data from IO memory space to "real" memory space. |
| 15 | * This needs to be optimized. | 20 | * This needs to be optimized. |
| 16 | */ | 21 | */ |
| 17 | void memcpy_fromio(void * to, unsigned long from, unsigned long count) | 22 | void memcpy_fromio(void *to, volatile void __iomem *from, unsigned long count) |
| 18 | { | 23 | { |
| 19 | char *p = to; | 24 | char *p = to; |
| 20 | while (count) { | 25 | while (count) { |
| 21 | count--; | 26 | count--; |
| 22 | *p = readb(from); | 27 | *p = readb((void __iomem *)from); |
| 23 | p++; | 28 | p++; |
| 24 | from++; | 29 | from++; |
| 25 | } | 30 | } |
| 26 | } | 31 | } |
| 27 | 32 | EXPORT_SYMBOL(memcpy_fromio); | |
| 33 | |||
| 28 | /* | 34 | /* |
| 29 | * Copy data from "real" memory space to IO memory space. | 35 | * Copy data from "real" memory space to IO memory space. |
| 30 | * This needs to be optimized. | 36 | * This needs to be optimized. |
| 31 | */ | 37 | */ |
| 32 | void memcpy_toio(unsigned long to, const void * from, unsigned long count) | 38 | void memcpy_toio(volatile void __iomem *to, const void *from, unsigned long count) |
| 33 | { | 39 | { |
| 34 | const char *p = from; | 40 | const char *p = from; |
| 35 | while (count) { | 41 | while (count) { |
| 36 | count--; | 42 | count--; |
| 37 | writeb(*p, to); | 43 | writeb(*p, (void __iomem *)to); |
| 38 | p++; | 44 | p++; |
| 39 | to++; | 45 | to++; |
| 40 | } | 46 | } |
| 41 | } | 47 | } |
| 42 | 48 | EXPORT_SYMBOL(memcpy_toio); | |
| 49 | |||
| 43 | /* | 50 | /* |
| 44 | * "memset" on IO memory space. | 51 | * "memset" on IO memory space. |
| 45 | * This needs to be optimized. | 52 | * This needs to be optimized. |
| 46 | */ | 53 | */ |
| 47 | void memset_io(unsigned long dst, int c, unsigned long count) | 54 | void memset_io(volatile void __iomem *dst, int c, unsigned long count) |
| 48 | { | 55 | { |
| 49 | while (count) { | 56 | while (count) { |
| 50 | count--; | 57 | count--; |
| 51 | writeb(c, dst); | 58 | writeb(c, (void __iomem *)dst); |
| 52 | dst++; | 59 | dst++; |
| 53 | } | 60 | } |
| 54 | } | 61 | } |
| 55 | |||
| 56 | EXPORT_SYMBOL(memcpy_fromio); | ||
| 57 | EXPORT_SYMBOL(memcpy_toio); | ||
| 58 | EXPORT_SYMBOL(memset_io); | 62 | EXPORT_SYMBOL(memset_io); |
| 59 | 63 | ||
| 64 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
| 65 | { | ||
| 66 | return sh_mv.mv_ioport_map(port, nr); | ||
| 67 | } | ||
| 68 | EXPORT_SYMBOL(ioport_map); | ||
| 69 | |||
| 70 | void ioport_unmap(void __iomem *addr) | ||
| 71 | { | ||
| 72 | sh_mv.mv_ioport_unmap(addr); | ||
| 73 | } | ||
| 74 | EXPORT_SYMBOL(ioport_unmap); | ||
