ARM: dma-api: fix max_pfn off-by-one error in __dma_supported()
[linux/fpc-iii.git] / arch / ia64 / lib / io.c
blobc3e02462ed1694b809a0d59650396ae72f58adb7
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/module.h>
3 #include <linux/types.h>
5 #include <asm/io.h>
7 /*
8 * Copy data from IO memory space to "real" memory space.
9 * This needs to be optimized.
11 void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
13 char *dst = to;
15 while (count) {
16 count--;
17 *dst++ = readb(from++);
20 EXPORT_SYMBOL(memcpy_fromio);
23 * Copy data from "real" memory space to IO memory space.
24 * This needs to be optimized.
26 void memcpy_toio(volatile void __iomem *to, const void *from, long count)
28 const char *src = from;
30 while (count) {
31 count--;
32 writeb(*src++, to++);
35 EXPORT_SYMBOL(memcpy_toio);
38 * "memset" on IO memory space.
39 * This needs to be optimized.
41 void memset_io(volatile void __iomem *dst, int c, long count)
43 unsigned char ch = (char)(c & 0xff);
45 while (count) {
46 count--;
47 writeb(ch, dst);
48 dst++;
51 EXPORT_SYMBOL(memset_io);