summaryrefslogtreecommitdiffstats
path: root/lib/iomap_copy.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-02-01 12:16:53 -0800
committerSteve French <sfrench@us.ibm.com>2006-02-01 12:16:53 -0800
commite6da74e1f20ea7822e52a9e4fbd3d25bd907e471 (patch)
treed9b3bc7e654fb788d1cf3a1759b1b3c74cc56a04 /lib/iomap_copy.c
parent1877c9ea66a29563987f22d0a86c66f438a87ce2 (diff)
parent3c3b809e256c417847f1a96b2f9d9f66c7fcb02c (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 'lib/iomap_copy.c')
-rw-r--r--lib/iomap_copy.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/iomap_copy.c b/lib/iomap_copy.c
new file mode 100644
index 00000000000..a6b1e271d53
--- /dev/null
+++ b/lib/iomap_copy.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2006 PathScale, Inc. All Rights Reserved.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <linux/io.h>
+#include <linux/module.h>
+
+/**
+ * __iowrite32_copy - copy data to MMIO space, in 32-bit units
+ * @to: destination, in MMIO space (must be 32-bit aligned)
+ * @from: source (must be 32-bit aligned)
+ * @count: number of 32-bit quantities to copy
+ *
+ * Copy data from kernel space to MMIO space, in units of 32 bits at a
+ * time. Order of access is not guaranteed, nor is a memory barrier
+ * performed afterwards.
+ */
+void __attribute__((weak)) __iowrite32_copy(void __iomem *to,
+ const void *from,
+ size_t count)
+{
+ u32 __iomem *dst = to;
+ const u32 *src = from;
+ const u32 *end = src + count;
+
+ while (src < end)
+ __raw_writel(*src++, dst++);
+}
+EXPORT_SYMBOL_GPL(__iowrite32_copy);