diff options
author | Christoph Hellwig <hch@lst.de> | 2020-04-16 17:00:10 +0200 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2020-04-19 16:12:31 +0200 |
commit | d257b8fe173a4b22ca32780a6e65b075a3b88301 (patch) | |
tree | afbb3b61af8b621ff2799ce176549073bce9a277 /arch/mips/mm/ioremap64.c | |
parent | MIPS: split out the 64-bit ioremap implementation (diff) | |
download | linux-d257b8fe173a4b22ca32780a6e65b075a3b88301.tar.xz linux-d257b8fe173a4b22ca32780a6e65b075a3b88301.zip |
MIPS: move ioremap_prot und iounmap out of line
Neither of these interfaces is anywhere near the fast path. Move them
out of line and avoid exposing implementation details to the drivers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/mm/ioremap64.c')
-rw-r--r-- | arch/mips/mm/ioremap64.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/mips/mm/ioremap64.c b/arch/mips/mm/ioremap64.c new file mode 100644 index 000000000000..15e7820d6a5f --- /dev/null +++ b/arch/mips/mm/ioremap64.c @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-only +#include <linux/io.h> +#include <ioremap.h> + +void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size, + unsigned long prot_val) +{ + unsigned long flags = prot_val & _CACHE_MASK; + u64 base = (flags == _CACHE_UNCACHED ? IO_BASE : UNCAC_BASE); + void __iomem *addr; + + addr = plat_ioremap(offset, size, flags); + if (!addr) + addr = (void __iomem *)(unsigned long)(base + offset); + return addr; +} +EXPORT_SYMBOL(ioremap_prot); + +void iounmap(const volatile void __iomem *addr) +{ + plat_iounmap(addr); +} +EXPORT_SYMBOL(iounmap); |