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 1 of 3] Introduce __memcpy_toio32
Date: Tue, 27 Dec 2005 15:41:55 -0800 [thread overview]
Message-ID: <7b7b442a4d6338ae8ca7.1135726915@eng-12.pathscale.com> (raw)
In-Reply-To: <patchbomb.1135726914@eng-12.pathscale.com>
This routine is an arch-independent building block for memcpy_toio32.
It copies data to a memory-mapped I/O region, using 32-bit accesses.
This style of access is required by some devices.
Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
diff -r 789a24638663 -r 7b7b442a4d63 include/asm-generic/iomap.h
--- a/include/asm-generic/iomap.h Tue Dec 27 09:27:10 2005 +0800
+++ b/include/asm-generic/iomap.h Tue Dec 27 15:41:48 2005 -0800
@@ -56,6 +56,12 @@
extern void fastcall iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
extern void fastcall iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
+/*
+ * MMIO copy routines. These are guaranteed to operate in units denoted
+ * by their names. This style of operation is required by some devices.
+ */
+extern void fastcall __memcpy_toio32(volatile void __iomem *to, const void *from, size_t count);
+
/* Create a virtual mapping cookie for an IO port range */
extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
extern void ioport_unmap(void __iomem *);
diff -r 789a24638663 -r 7b7b442a4d63 lib/iomap.c
--- a/lib/iomap.c Tue Dec 27 09:27:10 2005 +0800
+++ b/lib/iomap.c Tue Dec 27 15:41:48 2005 -0800
@@ -187,6 +187,22 @@
EXPORT_SYMBOL(iowrite16_rep);
EXPORT_SYMBOL(iowrite32_rep);
+/*
+ * Copy data to an MMIO region. MMIO space accesses are performed
+ * in the sizes indicated in each function's name.
+ */
+void fastcall __memcpy_toio32(volatile void __iomem *d, const void *s, size_t count)
+{
+ volatile u32 __iomem *dst = d;
+ const u32 *src = s;
+
+ while (--count >= 0) {
+ __raw_writel(*src++, dst++);
+ }
+}
+
+EXPORT_SYMBOL_GPL(__memcpy_toio32);
+
/* Create a virtual mapping cookie for an IO port range */
void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
next prev parent reply other threads:[~2005-12-27 23:45 UTC|newest]
Thread overview: 27+ 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 ` Bryan O'Sullivan [this message]
2005-12-28 1:10 ` [PATCH 1 of 3] Introduce __memcpy_toio32 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 ` [PATCH 3 of 3] Add memcpy_toio32 to each arch Bryan O'Sullivan
[not found] <200512280603.jBS63WGB031117@taverner.CS.Berkeley.EDU>
2005-12-28 6:20 ` [PATCH 1 of 3] Introduce __memcpy_toio32 Matt Mackall
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=7b7b442a4d6338ae8ca7.1135726915@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