• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef __ASM_ARM_MEMORY_H
13 #define __ASM_ARM_MEMORY_H
14 
15 #ifndef __ASSEMBLY__
16 #define UL(x) (x##UL)
17 #else
18 #define UL(x) (x)
19 #endif
20 
21 #include <linux/compiler.h>
22 #include <asm/arch/memory.h>
23 #include <asm/sizes.h>
24 
25 #ifndef TASK_SIZE
26 #define TASK_SIZE (CONFIG_DRAM_SIZE)
27 #endif
28 
29 #ifndef TASK_UNMAPPED_BASE
30 #define TASK_UNMAPPED_BASE UL(0x00000000)
31 #endif
32 
33 #ifndef PHYS_OFFSET
34 #define PHYS_OFFSET (CONFIG_DRAM_BASE)
35 #endif
36 
37 #ifndef END_MEM
38 #define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
39 #endif
40 
41 #ifndef PAGE_OFFSET
42 #define PAGE_OFFSET (PHYS_OFFSET)
43 #endif
44 
45 #define MODULE_END (END_MEM)
46 #define MODULE_START (PHYS_OFFSET)
47 
48 #ifndef CONSISTENT_DMA_SIZE
49 #define CONSISTENT_DMA_SIZE SZ_2M
50 #endif
51 
52 #ifndef __virt_to_phys
53 #define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
54 #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
55 #endif
56 
57 #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
58 #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
59 
60 #ifndef __ASSEMBLY__
61 
62 #ifndef ISA_DMA_THRESHOLD
63 #define ISA_DMA_THRESHOLD (0xffffffffULL)
64 #endif
65 
66 #ifndef arch_adjust_zones
67 #define arch_adjust_zones(node,size,holes) do { } while (0)
68 #endif
69 
70 #define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
71 
72 #define __pa(x) __virt_to_phys((unsigned long)(x))
73 #define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
74 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
75 #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
76 #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
77 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
78 #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
79 #define PHYS_TO_NID(addr) (0)
80 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
81 #ifndef __arch_page_to_dma
82 #define page_to_dma(dev, page) ((dma_addr_t)__virt_to_bus((unsigned long)page_address(page)))
83 #define dma_to_virt(dev, addr) ((void *)__bus_to_virt(addr))
84 #define virt_to_dma(dev, addr) ((dma_addr_t)__virt_to_bus((unsigned long)(addr)))
85 #else
86 #define page_to_dma(dev, page) (__arch_page_to_dma(dev, page))
87 #define dma_to_virt(dev, addr) (__arch_dma_to_virt(dev, addr))
88 #define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr))
89 #endif
90 #ifndef arch_is_coherent
91 #define arch_is_coherent() 0
92 #endif
93 #endif
94 #include <asm-generic/memory_model.h>
95 #endif
96