0001
0002
0003 #include <linux/mm.h>
0004 #include <linux/io.h>
0005
0006 bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot)
0007 {
0008 unsigned long last_addr = phys_addr + size - 1;
0009
0010
0011 if (last_addr & ~PHYS_MASK)
0012 return false;
0013
0014
0015 if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr))))
0016 return false;
0017
0018 return true;
0019 }
0020
0021
0022
0023
0024 void __init early_ioremap_init(void)
0025 {
0026 early_ioremap_setup();
0027 }
0028
0029 bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
0030 unsigned long flags)
0031 {
0032 unsigned long pfn = PHYS_PFN(offset);
0033
0034 return pfn_is_map_memory(pfn);
0035 }