4 #include <linux/config.h>
9 extern void __clear_user_page(void *p
, unsigned long user
);
10 extern void __copy_user_page(void *to
, const void *from
, unsigned long user
);
11 extern void copy_page(void *to
, const void *from
);
13 //FIXME these may be wrong on ARM26
14 #define clear_user_page(addr,vaddr,pg) \
17 __clear_user_page(addr, vaddr); \
21 #define copy_user_page(to,from,vaddr,pg) \
24 __copy_user_page(to, from, vaddr); \
28 #define clear_page(page) memzero((void *)(page), PAGE_SIZE)
29 #define copy_page(to, from) __copy_user_page(to, from, 0);
31 #undef STRICT_MM_TYPECHECKS
33 #ifdef STRICT_MM_TYPECHECKS
35 * These are used to make use of C type-checking..
37 typedef struct { unsigned long pgd
; } pgd_t
;
38 typedef struct { unsigned long pte
; } pte_t
;
39 typedef struct { unsigned long pmd
; } pmd_t
;
40 typedef struct { unsigned long pgprot
; } pgprot_t
;
42 #define pgd_val(x) ((x).pgd)
43 #define pte_val(x) ((x).pte)
44 #define pmd_val(x) ((x).pmd)
45 #define pgprot_val(x) ((x).pgprot)
47 #define __pte(x) ((pte_t) { (x) } )
48 #define __pmd(x) ((pmd_t) { (x) } )
49 #define __pgprot(x) ((pgprot_t) { (x) } )
53 * .. while these make it easier on the compiler
55 typedef unsigned long pgd_t
;
56 typedef unsigned long pte_t
;
57 typedef unsigned long pmd_t
;
58 typedef unsigned long pgprot_t
;
60 //FIXME - should these cast to unsigned long?
61 #define pgd_val(x) (x)
62 #define pte_val(x) (x)
63 #define pmd_val(x) (x)
64 #define pgprot_val(x) (x)
68 #define __pgprot(x) (x)
70 #endif /* STRICT_MM_TYPECHECKS */
71 #endif /* !__ASSEMBLY__ */
72 #endif /* __KERNEL__ */
74 /* PAGE_SHIFT determines the page size. This is configurable. */
75 #if defined(CONFIG_PAGESIZE_16)
76 #define PAGE_SHIFT 14 /* 16K */
78 #define PAGE_SHIFT 15 /* 32K */
81 #define EXEC_PAGESIZE 32768
83 #define PAGE_SIZE (1UL << PAGE_SHIFT)
84 #define PAGE_MASK (~(PAGE_SIZE-1))
86 /* to align the pointer to the (next) page boundary */
87 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
92 /* Pure 2^n version of get_order */
93 static inline int get_order(unsigned long size
)
97 size
= (size
-1) >> (PAGE_SHIFT
-1);
106 #include <asm/memory.h>
108 #endif /* !__ASSEMBLY__ */
110 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
111 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
113 #endif /* __KERNEL__ */