4 #include <asm/proc/page.h>
6 #define PAGE_SIZE (1UL << PAGE_SHIFT)
7 #define PAGE_MASK (~(PAGE_SIZE-1))
12 #define STRICT_MM_TYPECHECKS
14 #define clear_page(page) memzero((void *)(page), PAGE_SIZE)
15 extern void copy_page(void *to, void *from);
17 #define clear_user_page(page, vaddr) clear_page(page)
18 #define copy_user_page(to, from, vaddr) copy_page(to, from)
20 #ifdef STRICT_MM_TYPECHECKS
22 * These are used to make use of C type-checking..
24 typedef struct { unsigned long pte; } pte_t;
25 typedef struct { unsigned long pmd; } pmd_t;
26 typedef struct { unsigned long pgd; } pgd_t;
27 typedef struct { unsigned long pgprot; } pgprot_t;
29 #define pte_val(x) ((x).pte)
30 #define pmd_val(x) ((x).pmd)
31 #define pgd_val(x) ((x).pgd)
32 #define pgprot_val(x) ((x).pgprot)
34 #define __pte(x) ((pte_t) { (x) } )
35 #define __pmd(x) ((pmd_t) { (x) } )
36 #define __pgd(x) ((pgd_t) { (x) } )
37 #define __pgprot(x) ((pgprot_t) { (x) } )
41 * .. while these make it easier on the compiler
43 typedef unsigned long pte_t;
44 typedef unsigned long pmd_t;
45 typedef unsigned long pgd_t;
46 typedef unsigned long pgprot_t;
48 #define pte_val(x) (x)
49 #define pmd_val(x) (x)
50 #define pgd_val(x) (x)
51 #define pgprot_val(x) (x)
56 #define __pgprot(x) (x)
59 #endif /* !__ASSEMBLY__ */
61 /* to align the pointer to the (next) page boundary */
62 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
66 #ifdef CONFIG_DEBUG_BUGVERBOSE
67 extern void __bug(const char *file, int line, void *data);
69 /* give file/line information */
70 #define BUG() __bug(__FILE__, __LINE__, NULL)
71 #define PAGE_BUG(page) __bug(__FILE__, __LINE__, page)
75 /* these just cause an oops */
76 #define BUG() (*(int *)0 = 0)
77 #define PAGE_BUG(page) (*(int *)0 = 0)
81 /* Pure 2^n version of get_order */
82 static inline int get_order(unsigned long size)
86 size = (size-1) >> (PAGE_SHIFT-1);
95 #endif /* !__ASSEMBLY__ */
97 #include <linux/config.h>
98 #include <asm/memory.h>
100 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
101 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
103 #endif /* __KERNEL__ */