1 // SPDX-License-Identifier: GPL-2.0-only
3 #include <linux/export.h>
7 * __ioread64_copy - copy data from MMIO space, in 64-bit units
8 * @to: destination (must be 64-bit aligned)
9 * @from: source, in MMIO space (must be 64-bit aligned)
10 * @count: number of 64-bit quantities to copy
12 * Copy data from MMIO space to kernel space, in units of 32 or 64 bits at a
13 * time. Order of access is not guaranteed, nor is a memory barrier
14 * performed afterwards.
16 void __ioread64_copy(void *to
, const void __iomem
*from
, size_t count
)
20 const u64 __iomem
*src
= from
;
21 const u64 __iomem
*end
= src
+ count
;
24 *dst
++ = __raw_readq(src
++);
26 __ioread32_copy(to
, from
, count
* 2);
29 EXPORT_SYMBOL_GPL(__ioread64_copy
);