special usb hub handling, IDE disks, and retries all over the place
[linux-2.4.git] / include / asm-arm / page.h
1 #ifndef _ASMARM_PAGE_H
2 #define _ASMARM_PAGE_H
3
4 #include <asm/proc/page.h>
5
6 #define PAGE_SIZE       (1UL << PAGE_SHIFT)
7 #define PAGE_MASK       (~(PAGE_SIZE-1))
8
9 #ifdef __KERNEL__
10 #ifndef __ASSEMBLY__
11
12 #define STRICT_MM_TYPECHECKS
13
14 #define clear_page(page)        memzero((void *)(page), PAGE_SIZE)
15 extern void copy_page(void *to, void *from);
16
17 #define clear_user_page(page, vaddr)    clear_page(page)
18 #define copy_user_page(to, from, vaddr) copy_page(to, from)
19
20 #ifdef STRICT_MM_TYPECHECKS
21 /*
22  * These are used to make use of C type-checking..
23  */
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;
28
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)
33
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) } )
38
39 #else
40 /*
41  * .. while these make it easier on the compiler
42  */
43 typedef unsigned long pte_t;
44 typedef unsigned long pmd_t;
45 typedef unsigned long pgd_t;
46 typedef unsigned long pgprot_t;
47
48 #define pte_val(x)      (x)
49 #define pmd_val(x)      (x)
50 #define pgd_val(x)      (x)
51 #define pgprot_val(x)   (x)
52
53 #define __pte(x)        (x)
54 #define __pmd(x)        (x)
55 #define __pgd(x)        (x)
56 #define __pgprot(x)     (x)
57
58 #endif
59 #endif /* !__ASSEMBLY__ */
60
61 /* to align the pointer to the (next) page boundary */
62 #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
63
64 #ifndef __ASSEMBLY__
65
66 #ifdef CONFIG_DEBUG_BUGVERBOSE
67 extern void __bug(const char *file, int line, void *data);
68
69 /* give file/line information */
70 #define BUG()           __bug(__FILE__, __LINE__, NULL)
71 #define PAGE_BUG(page)  __bug(__FILE__, __LINE__, page)
72
73 #else
74
75 /* these just cause an oops */
76 #define BUG()           (*(int *)0 = 0)
77 #define PAGE_BUG(page)  (*(int *)0 = 0)
78
79 #endif
80
81 /* Pure 2^n version of get_order */
82 static inline int get_order(unsigned long size)
83 {
84         int order;
85
86         size = (size-1) >> (PAGE_SHIFT-1);
87         order = -1;
88         do {
89                 size >>= 1;
90                 order++;
91         } while (size);
92         return order;
93 }
94
95 #endif /* !__ASSEMBLY__ */
96
97 #include <linux/config.h>
98 #include <asm/memory.h>
99
100 #define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_EXEC | \
101                                  VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
102
103 #endif /* __KERNEL__ */
104
105 #endif