From ee0f2f9e74762ddf653aac69c19f5b42a65e4a28 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 19 Oct 2004 00:48:44 +0100 Subject: [PATCH] [ARM PATCH] 2131/1: Add _iomem to the IO string functions Patch from Ben Dooks This patch stops mtd from generating problems of casting pointers to ints, due to the memcpy_fromio and related functions all taking `unsigned long` for their IO addresses. Replace `unsigned long` with `void __iomem *` Compiled clean on arch-s3c2410 Signed-off-by: Ben Dooks --- arch/arm/kernel/io.c | 6 +++--- include/asm-arm/io.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c index 9e8868bc55d45..6c20c1188b605 100644 --- a/arch/arm/kernel/io.c +++ b/arch/arm/kernel/io.c @@ -7,7 +7,7 @@ * Copy data from IO memory space to "real" memory space. * This needs to be optimized. */ -void _memcpy_fromio(void *to, unsigned long from, size_t count) +void _memcpy_fromio(void *to, void __iomem *from, size_t count) { unsigned char *t = to; while (count) { @@ -22,7 +22,7 @@ void _memcpy_fromio(void *to, unsigned long from, size_t count) * Copy data from "real" memory space to IO memory space. * This needs to be optimized. */ -void _memcpy_toio(unsigned long to, const void *from, size_t count) +void _memcpy_toio(void __iomem *to, const void *from, size_t count) { const unsigned char *f = from; while (count) { @@ -37,7 +37,7 @@ void _memcpy_toio(unsigned long to, const void *from, size_t count) * "memset" on IO memory space. * This needs to be optimized. */ -void _memset_io(unsigned long dst, int c, size_t count) +void _memset_io(void __iomem *dst, int c, size_t count) { while (count) { count--; diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 1855fb73c4d57..adf602e66db63 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -16,6 +16,7 @@ * 04-Apr-1999 PJB Added check_signature. * 12-Dec-1999 RMK More cleanups * 18-Jun-2000 RMK Removed virt_to_* and friends definitions + * 05-Oct-2004 BJD Moved memory string functions to use void __iomem */ #ifndef __ASM_ARM_IO_H #define __ASM_ARM_IO_H @@ -131,9 +132,9 @@ extern void __readwrite_bug(const char *fn); /* * String version of IO memory access ops: */ -extern void _memcpy_fromio(void *, unsigned long, size_t); -extern void _memcpy_toio(unsigned long, const void *, size_t); -extern void _memset_io(unsigned long, int, size_t); +extern void _memcpy_fromio(void *, void __iomem *, size_t); +extern void _memcpy_toio(void __iomem *, const void *, size_t); +extern void _memset_io(void __iomem *, int, size_t); /* * Memory access primitives -- 2.53.0