Go to the documentation of this file.
18 #define PAGE_SIZE (1UL << PAGE_SHIFT)
19 #define PAGE_MASK (~(PAGE_SIZE - 1))
21 #define PAGE_SIZE +(1 << PAGE_SHIFT)
23 #define PAGE_MASK +(~(PAGE_SIZE - 1))
29 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
30 #define copy_page(to, from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
32 #define clear_user_page(addr, vaddr, page) clear_page(addr)
33 #define copy_user_page(vto, vfrom, vaddr, to) copy_page(vto, vfrom)
38 typedef struct {
unsigned long pte; }
pte_t;
39 typedef struct {
unsigned long pgd; }
pgd_t;
43 #define PTE_MASK PAGE_MASK
44 #define HPAGE_SHIFT 22
46 #ifdef CONFIG_HUGETLB_PAGE
47 #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
48 #define HPAGE_MASK (~(HPAGE_SIZE - 1))
49 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
52 #define pte_val(x) ((x).pte)
53 #define pgd_val(x) ((x).pgd)
54 #define pgprot_val(x) ((x).pgprot)
56 #define __pte(x) ((pte_t) { (x) })
57 #define __pgd(x) ((pgd_t) { (x) })
58 #define __pgprot(x) ((pgprot_t) { (x) })
93 #include <asm/page_offset.h>
95 #define __PAGE_OFFSET (PAGE_OFFSET_RAW)
96 #define PAGE_OFFSET ((unsigned long) __PAGE_OFFSET)
103 #define __pfn_disp (CONFIG_KERNEL_RAM_BASE_ADDRESS >> PAGE_SHIFT)
105 #define __pa(x) ((unsigned long)(x))
106 #define __va(x) ((void *)(unsigned long)(x))
107 #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
108 #define pfn_to_page(pfn) (mem_map + ((pfn) - __pfn_disp))
109 #define page_to_pfn(page) ((unsigned long)((page) - mem_map) + __pfn_disp)
111 #define pfn_valid(pfn) \
113 unsigned long __pfn = (pfn) - __pfn_disp; \
117 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
118 #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
119 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
121 #define VM_DATA_DEFAULT_FLAGS \
122 (VM_READ | VM_WRITE | \
123 ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \
124 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)