Release 4.15 arch/arm/mm/nommu.c
/*
* linux/arch/arm/mm/nommu.c
*
* ARM uCLinux supporting functions.
*/
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/io.h>
#include <linux/memblock.h>
#include <linux/kernel.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
#include <asm/sections.h>
#include <asm/page.h>
#include <asm/setup.h>
#include <asm/traps.h>
#include <asm/mach/arch.h>
#include <asm/cputype.h>
#include <asm/mpu.h>
#include <asm/procinfo.h>
#include "mm.h"
unsigned long vectors_base;
#ifdef CONFIG_ARM_MPU
struct mpu_rgn_info mpu_rgn_info;
#endif
#ifdef CONFIG_CPU_CP15
#ifdef CONFIG_CPU_HIGH_VECTOR
static unsigned long __init setup_vectors_base(void)
{
unsigned long reg = get_cr();
set_cr(reg | CR_V);
return 0xffff0000;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Afzal Mohammed | 27 | 100.00% | 1 | 100.00% |
Total | 27 | 100.00% | 1 | 100.00% |
#else /* CONFIG_CPU_HIGH_VECTOR */
/* Write exception base address to VBAR */
static inline void set_vbar(unsigned long val)
{
asm("mcr p15, 0, %0, c12, c0, 0" : : "r" (val) : "cc");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Afzal Mohammed | 12 | 100.00% | 1 | 100.00% |
Total | 12 | 100.00% | 1 | 100.00% |
/*
* Security extensions, bits[7:4], permitted values,
* 0b0000 - not implemented, 0b0001/0b0010 - implemented
*/
static inline bool security_extensions_enabled(void)
{
/* Check CPUID Identification Scheme before ID_PFR1 read */
if ((read_cpuid_id() & 0x000f0000) == 0x000f0000)
return !!cpuid_feature_extract(CPUID_EXT_PFR1, 4);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Afzal Mohammed | 34 | 100.00% | 2 | 100.00% |
Total | 34 | 100.00% | 2 | 100.00% |
static unsigned long __init setup_vectors_base(void)
{
unsigned long base = 0, reg = get_cr();
set_cr(reg & ~CR_V);
if (security_extensions_enabled()) {
if (IS_ENABLED(CONFIG_REMAP_VECTORS_TO_RAM))
base = CONFIG_DRAM_BASE;
set_vbar(base);
} else if (IS_ENABLED(CONFIG_REMAP_VECTORS_TO_RAM)) {
if (CONFIG_DRAM_BASE != 0)
pr_err("Security extensions not enabled, vectors cannot be remapped to RAM, vectors base will be 0x00000000\n");
}
return base;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Afzal Mohammed | 76 | 100.00% | 1 | 100.00% |
Total | 76 | 100.00% | 1 | 100.00% |
#endif /* CONFIG_CPU_HIGH_VECTOR */
#endif /* CONFIG_CPU_CP15 */
void __init arm_mm_memblock_reserve(void)
{
#ifndef CONFIG_CPU_V7M
vectors_base = IS_ENABLED(CONFIG_CPU_CP15) ? setup_vectors_base() : 0;
/*
* Register the exception vector page.
* some architectures which the DRAM is the exception vector to trap,
* alloc_page breaks with error, although it is not NULL, but "0."
*/
memblock_reserve(vectors_base, 2 * PAGE_SIZE);
#else /* ifndef CONFIG_CPU_V7M */
/*
* There is no dedicated vector page on V7-M. So nothing needs to be
* reserved here.
*/
#endif
/*
* In any case, always ensure address 0 is never used as many things
* get very confused if 0 is returned as a legitimate address.
*/
memblock_reserve(0, 1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 15 | 31.91% | 3 | 42.86% |
Afzal Mohammed | 13 | 27.66% | 1 | 14.29% |
Catalin Marinas | 9 | 19.15% | 1 | 14.29% |
Nico Pitre | 8 | 17.02% | 1 | 14.29% |
Jean-Philippe Brucker | 2 | 4.26% | 1 | 14.29% |
Total | 47 | 100.00% | 7 | 100.00% |
void __init adjust_lowmem_bounds(void)
{
phys_addr_t end;
adjust_lowmem_bounds_mpu();
end = memblock_end_of_DRAM();
high_memory = __va(end - 1) + 1;
memblock_set_current_limit(end);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nico Pitre | 15 | 42.86% | 1 | 16.67% |
Laura Abbott | 9 | 25.71% | 3 | 50.00% |
Jonathan Austin | 6 | 17.14% | 1 | 16.67% |
Russell King | 5 | 14.29% | 1 | 16.67% |
Total | 35 | 100.00% | 6 | 100.00% |
/*
* paging_init() sets up the page tables, initialises the zone memory
* maps, and sets up the zero page, bad page and bad page tables.
*/
void __init paging_init(const struct machine_desc *mdesc)
{
early_trap_init((void *)vectors_base);
mpu_setup();
bootmem_init();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 15 | 55.56% | 3 | 50.00% |
Will Deacon | 8 | 29.63% | 1 | 16.67% |
Jonathan Austin | 3 | 11.11% | 1 | 16.67% |
Afzal Mohammed | 1 | 3.70% | 1 | 16.67% |
Total | 27 | 100.00% | 6 | 100.00% |
/*
* We don't need to do anything here for nommu machines.
*/
void setup_mm_for_reboot(void)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 6 | 100.00% | 2 | 100.00% |
Total | 6 | 100.00% | 2 | 100.00% |
void flush_dcache_page(struct page *page)
{
__cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 20 | 100.00% | 2 | 100.00% |
Total | 20 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(flush_dcache_page);
void flush_kernel_dcache_page(struct page *page)
{
__cpuc_flush_dcache_area(page_address(page), PAGE_SIZE);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Simon Baatz | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(flush_kernel_dcache_page);
void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
unsigned long uaddr, void *dst, const void *src,
unsigned long len)
{
memcpy(dst, src, len);
if (vma->vm_flags & VM_EXEC)
__cpuc_coherent_user_range(uaddr, uaddr + len);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Catalin Marinas | 58 | 100.00% | 1 | 100.00% |
Total | 58 | 100.00% | 1 | 100.00% |
void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
size_t size, unsigned int mtype)
{
if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
return NULL;
return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 51 | 100.00% | 2 | 100.00% |
Total | 51 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(__arm_ioremap_pfn);
void __iomem *__arm_ioremap_caller(phys_addr_t phys_addr, size_t size,
unsigned int mtype, void *caller)
{
return (void __iomem *)phys_addr;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 29 | 100.00% | 3 | 100.00% |
Total | 29 | 100.00% | 3 | 100.00% |
void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, unsigned int, void *);
void __iomem *ioremap(resource_size_t res_cookie, size_t size)
{
return __arm_ioremap_caller(res_cookie, size, MT_DEVICE,
__builtin_return_address(0));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 28 | 100.00% | 2 | 100.00% |
Total | 28 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(ioremap);
void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size)
__alias(ioremap_cached);
void __iomem *ioremap_cached(resource_size_t res_cookie, size_t size)
{
return __arm_ioremap_caller(res_cookie, size, MT_DEVICE_CACHED,
__builtin_return_address(0));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 17 | 60.71% | 1 | 50.00% |
Ard Biesheuvel | 11 | 39.29% | 1 | 50.00% |
Total | 28 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(ioremap_cache);
EXPORT_SYMBOL(ioremap_cached);
void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size)
{
return __arm_ioremap_caller(res_cookie, size, MT_DEVICE_WC,
__builtin_return_address(0));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 28 | 100.00% | 2 | 100.00% |
Total | 28 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL(ioremap_wc);
#ifdef CONFIG_PCI
#include <asm/mach/map.h>
void __iomem *pci_remap_cfgspace(resource_size_t res_cookie, size_t size)
{
return arch_ioremap_caller(res_cookie, size, MT_UNCACHED,
__builtin_return_address(0));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Lorenzo Pieralisi | 28 | 100.00% | 1 | 100.00% |
Total | 28 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL_GPL(pci_remap_cfgspace);
#endif
void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
{
return (void *)phys_addr;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ard Biesheuvel | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
void __iounmap(volatile void __iomem *addr)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 10 | 100.00% | 1 | 100.00% |
Total | 10 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(__iounmap);
void (*arch_iounmap)(volatile void __iomem *);
void iounmap(volatile void __iomem *addr)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 10 | 100.00% | 3 | 100.00% |
Total | 10 | 100.00% | 3 | 100.00% |
EXPORT_SYMBOL(iounmap);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Russell King | 311 | 39.77% | 18 | 46.15% |
Afzal Mohammed | 187 | 23.91% | 2 | 5.13% |
Catalin Marinas | 70 | 8.95% | 3 | 7.69% |
Lorenzo Pieralisi | 41 | 5.24% | 1 | 2.56% |
Ard Biesheuvel | 40 | 5.12% | 2 | 5.13% |
Rob Herring | 30 | 3.84% | 1 | 2.56% |
Jonathan Austin | 27 | 3.45% | 2 | 5.13% |
Simon Baatz | 25 | 3.20% | 1 | 2.56% |
Nico Pitre | 23 | 2.94% | 2 | 5.13% |
Will Deacon | 11 | 1.41% | 1 | 2.56% |
Laura Abbott | 10 | 1.28% | 4 | 10.26% |
Hyok S. Choi | 5 | 0.64% | 1 | 2.56% |
Jean-Philippe Brucker | 2 | 0.26% | 1 | 2.56% |
Total | 782 | 100.00% | 39 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.