/* * linux/arch/unicore32/include/asm/memory.h * * Code specific to PKUnity SoC and UniCore ISA * * Copyright (C) 2001-2010 GUAN Xue-tao * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Note: this file should not be included by non-asm/.h files */ #ifndef __UNICORE_MEMORY_H__ #define __UNICORE_MEMORY_H__ #include <linux/compiler.h> #include <linux/const.h> #include <asm/sizes.h> #include <mach/memory.h> /* * PAGE_OFFSET - the virtual address of the start of the kernel image * TASK_SIZE - the maximum size of a user space task. * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area */ #define PAGE_OFFSET UL(0xC0000000) #define TASK_SIZE (PAGE_OFFSET - UL(0x41000000)) #define TASK_UNMAPPED_BASE (PAGE_OFFSET / 3) /* * The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 32MB of the kernel text. */ #define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024) #if TASK_SIZE > MODULES_VADDR #error Top of user space clashes with start of module space #endif #define MODULES_END (PAGE_OFFSET) /* * Allow 16MB-aligned ioremap pages */ #define IOREMAP_MAX_ORDER 24 /* * Physical vs virtual RAM address space conversion. These are * private definitions which should NOT be used outside memory.h * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. */ #ifndef __virt_to_phys #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET) #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) #endif /* * Convert a page to/from a physical address */ #define page_to_phys(page) (__pfn_to_phys(page_to_pfn(page))) #define phys_to_page(phys) (pfn_to_page(__phys_to_pfn(phys))) #ifndef __ASSEMBLY__ #ifndef arch_adjust_zones #define arch_adjust_zones(size, holes) do { } while (0) #endif /* * PFNs are used to describe any physical page; this means * PFN 0 == physical address 0. * * This is the PFN of the first RAM page in the kernel * direct-mapped view. We assume this is the first page * of RAM in the mem_map as well. */ #define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT) /* * Drivers should NOT use these either. */ #define __pa(x) __virt_to_phys((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((unsigned long)(x))) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) /* * Conversion between a struct page and a physical address. * * page_to_pfn(page) convert a struct page * to a PFN number * pfn_to_page(pfn) convert a _valid_ PFN number to struct page * * * virt_to_page(k) convert a _valid_ virtual address to struct page * * virt_addr_valid(k) indicates whether a virtual address is valid */ #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && \ (unsigned long)(kaddr) < (unsigned long)high_memory) #endif #include <asm-generic/memory_model.h> #endif
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Kbuild | File | 877 B | 0644 |
|
assembler.h | File | 2.71 KB | 0644 |
|
barrier.h | File | 602 B | 0644 |
|
bitops.h | File | 1.19 KB | 0644 |
|
bug.h | File | 632 B | 0644 |
|
cache.h | File | 805 B | 0644 |
|
cacheflush.h | File | 6.46 KB | 0644 |
|
checksum.h | File | 978 B | 0644 |
|
cmpxchg.h | File | 1.43 KB | 0644 |
|
cpu-single.h | File | 1.18 KB | 0644 |
|
cputype.h | File | 787 B | 0644 |
|
delay.h | File | 1.53 KB | 0644 |
|
dma-mapping.h | File | 1.11 KB | 0644 |
|
dma.h | File | 531 B | 0644 |
|
elf.h | File | 2.58 KB | 0644 |
|
fpstate.h | File | 550 B | 0644 |
|
fpu-ucf64.h | File | 1.32 KB | 0644 |
|
gpio.h | File | 2.75 KB | 0644 |
|
hwcap.h | File | 773 B | 0644 |
|
hwdef-copro.h | File | 1.3 KB | 0644 |
|
io.h | File | 2 KB | 0644 |
|
irq.h | File | 2.56 KB | 0644 |
|
irqflags.h | File | 1.03 KB | 0644 |
|
linkage.h | File | 524 B | 0644 |
|
memblock.h | File | 1.1 KB | 0644 |
|
memory.h | File | 3 KB | 0644 |
|
mmu.h | File | 430 B | 0644 |
|
mmu_context.h | File | 2.76 KB | 0644 |
|
page.h | File | 1.89 KB | 0644 |
|
pci.h | File | 578 B | 0644 |
|
pgalloc.h | File | 2.47 KB | 0644 |
|
pgtable-hwdef.h | File | 1.3 KB | 0644 |
|
pgtable.h | File | 9.42 KB | 0644 |
|
processor.h | File | 1.98 KB | 0644 |
|
ptrace.h | File | 1.37 KB | 0644 |
|
stacktrace.h | File | 787 B | 0644 |
|
string.h | File | 994 B | 0644 |
|
suspend.h | File | 667 B | 0644 |
|
switch_to.h | File | 901 B | 0644 |
|
thread_info.h | File | 3.29 KB | 0644 |
|
timex.h | File | 767 B | 0644 |
|
tlb.h | File | 781 B | 0644 |
|
tlbflush.h | File | 5.53 KB | 0644 |
|
traps.h | File | 627 B | 0644 |
|
uaccess.h | File | 1.33 KB | 0644 |
|