From: "Bryan O'Sullivan" <bos@pathscale.com>
To: linux-kernel@vger.kernel.org
Cc: mpm@selenic.com, akpm@osdl.org, hch@infradead.org
Subject: [PATCH 3 of 3] Add memcpy_toio32 to each arch
Date: Tue, 27 Dec 2005 15:41:57 -0800 [thread overview]
Message-ID: <0441e7525e4ef2e752a3.1135726917@eng-12.pathscale.com> (raw)
In-Reply-To: <patchbomb.1135726914@eng-12.pathscale.com>
Most arches use the generic __memcpy_toio32 routine, while x86_64
uses memcpy32, which is substantially faster.
Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-alpha/io.h
--- a/include/asm-alpha/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-alpha/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -504,6 +504,8 @@
extern void memcpy_toio(volatile void __iomem *, const void *, long);
extern void _memset_c_io(volatile void __iomem *, unsigned long, long);
+#define memcpy_toio32 __memcpy_toio32
+
static inline void memset_io(volatile void __iomem *addr, u8 c, long len)
{
_memset_c_io(addr, 0x0101010101010101UL * c, len);
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-arm/io.h
--- a/include/asm-arm/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-arm/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -184,6 +184,8 @@
#define memset_io(c,v,l) _memset_io(__mem_pci(c),(v),(l))
#define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l))
#define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l))
+
+#define memcpy_toio32 __memcpy_toio32
#define eth_io_copy_and_sum(s,c,l,b) \
eth_copy_and_sum((s),__mem_pci(c),(l),(b))
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-cris/io.h
--- a/include/asm-cris/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-cris/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -121,6 +121,8 @@
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
+#define memcpy_toio32 __memcpy_toio32
+
/*
* Again, CRIS does not require mem IO specific function.
*/
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-frv/io.h
--- a/include/asm-frv/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-frv/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -124,6 +124,8 @@
memcpy((void __force *) dst, src, count);
}
+#define memcpy_toio32 __memcpy_toio32
+
static inline uint8_t inb(unsigned long addr)
{
return __builtin_read8((void *)addr);
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-h8300/io.h
--- a/include/asm-h8300/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-h8300/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -209,6 +209,8 @@
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
+#define memcpy_toio32 __memcpy_toio32
+
#define mmiowb()
#define inb(addr) ((h8300_buswidth(addr))?readw((addr) & ~1) & 0xff:readb(addr))
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-i386/io.h
--- a/include/asm-i386/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-i386/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -203,6 +203,9 @@
{
__memcpy((void __force *) dst, src, count);
}
+
+#define memcpy_toio32 __memcpy_toio32
+
/*
* ISA space is 'always mapped' on a typical x86 system, no need to
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-ia64/io.h
--- a/include/asm-ia64/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-ia64/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -443,6 +443,8 @@
extern void memcpy_toio(volatile void __iomem *dst, const void *src, long n);
extern void memset_io(volatile void __iomem *s, int c, long n);
+#define memcpy_toio32 __memcpy_toio32
+
#define dma_cache_inv(_start,_size) do { } while (0)
#define dma_cache_wback(_start,_size) do { } while (0)
#define dma_cache_wback_inv(_start,_size) do { } while (0)
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-m32r/io.h
--- a/include/asm-m32r/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-m32r/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -216,6 +216,8 @@
memcpy((void __force *) dst, src, count);
}
+#define memcpy_toio32 __memcpy_toio32
+
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
* access
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-m68knommu/io.h
--- a/include/asm-m68knommu/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-m68knommu/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -113,6 +113,8 @@
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
+#define memcpy_toio32 __memcpy_toio32
+
#define inb(addr) readb(addr)
#define inw(addr) readw(addr)
#define inl(addr) readl(addr)
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-mips/io.h
--- a/include/asm-mips/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-mips/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -534,6 +534,8 @@
memcpy((void __force *) dst, src, count);
}
+#define memcpy_toio32 __memcpy_toio32
+
/*
* Memory Mapped I/O
*/
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-parisc/io.h
--- a/include/asm-parisc/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-parisc/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -294,6 +294,8 @@
void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
void memcpy_toio(volatile void __iomem *dst, const void *src, int count);
+#define memcpy_toio32 __memcpy_toio32
+
/* Support old drivers which don't ioremap.
* NB this interface is scheduled to disappear in 2.5
*/
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-powerpc/io.h
--- a/include/asm-powerpc/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-powerpc/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -63,6 +63,8 @@
#define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c))
#define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c))
+#define memcpy_toio32 __memcpy_toio32
+
#define inb(addr) readb(((void __iomem *)(long)(addr)))
#define inw(addr) readw(((void __iomem *)(long)(addr)))
#define inl(addr) readl(((void __iomem *)(long)(addr)))
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-ppc/io.h
--- a/include/asm-ppc/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-ppc/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -367,6 +367,8 @@
}
#endif
+#define memcpy_toio32 __memcpy_toio32
+
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(void __iomem *)(b),(c),(d))
/*
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-s390/io.h
--- a/include/asm-s390/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-s390/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -99,6 +99,8 @@
#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
#define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c))
+#define memcpy_toio32 __memcpy_toio32
+
#define inb_p(addr) readb(addr)
#define inb(addr) readb(addr)
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-sh/io.h
--- a/include/asm-sh/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-sh/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -177,6 +177,8 @@
extern void memcpy_toio(unsigned long, const void *, unsigned long);
extern void memset_io(unsigned long, int, unsigned long);
+#define memcpy_toio32 __memcpy_toio32
+
/* SuperH on-chip I/O functions */
static __inline__ unsigned char ctrl_inb(unsigned long addr)
{
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-sh64/io.h
--- a/include/asm-sh64/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-sh64/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -125,6 +125,8 @@
void memcpy_toio(void __iomem *to, const void *from, long count);
void memcpy_fromio(void *to, void __iomem *from, long count);
+
+#define memcpy_toio32 __memcpy_toio32
#define mmiowb()
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-sparc/io.h
--- a/include/asm-sparc/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-sparc/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -239,6 +239,8 @@
#define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz)
+#define memcpy_toio32 __memcpy_toio32
+
#ifdef __KERNEL__
/*
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-sparc64/io.h
--- a/include/asm-sparc64/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-sparc64/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -440,6 +440,8 @@
#define memcpy_toio(d,s,sz) _memcpy_toio(d,s,sz)
+#define memcpy_toio32 __memcpy_toio32
+
static inline int check_signature(void __iomem *io_addr,
const unsigned char *signature,
int length)
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-v850/io.h
--- a/include/asm-v850/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-v850/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -130,6 +130,8 @@
#define memcpy_fromio(dst, src, len) memcpy (dst, (void *)src, len)
#define memcpy_toio(dst, src, len) memcpy ((void *)dst, src, len)
+#define memcpy_toio32 __memcpy_toio32
+
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
* access
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-x86_64/io.h
--- a/include/asm-x86_64/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-x86_64/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -252,6 +252,13 @@
__memcpy_toio((unsigned long)to,from,len);
}
+#include <asm/string.h>
+
+static inline void memcpy_toio32(volatile void __iomem *dst, const void *src, size_t count)
+{
+ memcpy32((void *) dst, src, count);
+}
+
void memset_io(volatile void __iomem *a, int b, size_t c);
/*
diff -r 042b7d9004ac -r 0441e7525e4e include/asm-xtensa/io.h
--- a/include/asm-xtensa/io.h Tue Dec 27 15:41:48 2005 -0800
+++ b/include/asm-xtensa/io.h Tue Dec 27 15:41:48 2005 -0800
@@ -159,6 +159,8 @@
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
+#define memcpy_toio32 __memcpy_toio32
+
/* At this point the Xtensa doesn't provide byte swap instructions */
#ifdef __XTENSA_EB__
prev parent reply other threads:[~2005-12-27 23:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-27 23:41 [PATCH 0 of 3] Add memcpy_toio32, a 32-bit MMIO copy routine Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 1 of 3] Introduce __memcpy_toio32 Bryan O'Sullivan
2005-12-28 1:10 ` Roland Dreier
2005-12-28 14:40 ` Bryan O'Sullivan
2005-12-28 14:51 ` Matt Mackall
2005-12-30 23:46 ` Adrian Bunk
2005-12-30 23:44 ` Matt Mackall
2005-12-31 0:23 ` Linus Torvalds
2005-12-31 0:31 ` (OT) " Jan Engelhardt
2005-12-31 0:44 ` Linus Torvalds
2005-12-31 21:24 ` Adrian Bunk
2005-12-28 19:23 ` Roland Dreier
2005-12-28 1:11 ` Roland Dreier
2005-12-28 4:07 ` Matt Mackall
2005-12-28 3:52 ` Matt Mackall
2005-12-28 14:47 ` Bryan O'Sullivan
2005-12-28 14:55 ` Matt Mackall
2005-12-28 15:18 ` Geert Uytterhoeven
2005-12-28 15:52 ` Bryan O'Sullivan
2005-12-27 23:41 ` [PATCH 2 of 3] memcpy32 for x86_64 Bryan O'Sullivan
2005-12-28 4:22 ` Matt Mackall
2005-12-28 7:54 ` Denis Vlasenko
2005-12-28 14:52 ` Bryan O'Sullivan
2006-01-06 9:12 ` Pavel Machek
2006-01-06 16:02 ` Bryan O'Sullivan
2005-12-27 23:41 ` Bryan O'Sullivan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0441e7525e4ef2e752a3.1135726917@eng-12.pathscale.com \
--to=bos@pathscale.com \
--cc=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome