mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-31 08:28:13 +00:00
d257b8fe17
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>
23 lines
567 B
C
23 lines
567 B
C
// 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);
|