PM: fix compiler error of PPC dart_iommu
[linux/fpc-iii.git] / include / asm-arm26 / page.h
blobfa19de28fda04bdaa04adc7f330940dfc1efa2c6
1 #ifndef _ASMARM_PAGE_H
2 #define _ASMARM_PAGE_H
5 #ifdef __KERNEL__
6 #ifndef __ASSEMBLY__
8 extern void __clear_user_page(void *p, unsigned long user);
9 extern void __copy_user_page(void *to, const void *from, unsigned long user);
10 extern void copy_page(void *to, const void *from);
12 //FIXME these may be wrong on ARM26
13 #define clear_user_page(addr,vaddr,pg) \
14 do { \
15 preempt_disable(); \
16 __clear_user_page(addr, vaddr); \
17 preempt_enable(); \
18 } while (0)
20 #define copy_user_page(to,from,vaddr,pg) \
21 do { \
22 preempt_disable(); \
23 __copy_user_page(to, from, vaddr); \
24 preempt_enable(); \
25 } while (0)
27 #define clear_page(page) memzero((void *)(page), PAGE_SIZE)
28 #define copy_page(to, from) __copy_user_page(to, from, 0);
30 #undef STRICT_MM_TYPECHECKS
32 #ifdef STRICT_MM_TYPECHECKS
34 * These are used to make use of C type-checking..
36 typedef struct { unsigned long pgd; } pgd_t;
37 typedef struct { unsigned long pte; } pte_t;
38 typedef struct { unsigned long pmd; } pmd_t;
39 typedef struct { unsigned long pgprot; } pgprot_t;
41 #define pgd_val(x) ((x).pgd)
42 #define pte_val(x) ((x).pte)
43 #define pmd_val(x) ((x).pmd)
44 #define pgprot_val(x) ((x).pgprot)
46 #define __pte(x) ((pte_t) { (x) } )
47 #define __pmd(x) ((pmd_t) { (x) } )
48 #define __pgprot(x) ((pgprot_t) { (x) } )
50 #else
52 * .. while these make it easier on the compiler
54 typedef unsigned long pgd_t;
55 typedef unsigned long pte_t;
56 typedef unsigned long pmd_t;
57 typedef unsigned long pgprot_t;
59 //FIXME - should these cast to unsigned long?
60 #define pgd_val(x) (x)
61 #define pte_val(x) (x)
62 #define pmd_val(x) (x)
63 #define pgprot_val(x) (x)
65 #define __pte(x) (x)
66 #define __pmd(x) (x)
67 #define __pgprot(x) (x)
69 #endif /* STRICT_MM_TYPECHECKS */
70 #endif /* !__ASSEMBLY__ */
71 #endif /* __KERNEL__ */
73 /* PAGE_SHIFT determines the page size. This is configurable. */
74 #if defined(CONFIG_PAGESIZE_16)
75 #define PAGE_SHIFT 14 /* 16K */
76 #else /* default */
77 #define PAGE_SHIFT 15 /* 32K */
78 #endif
80 #define EXEC_PAGESIZE 32768
82 #define PAGE_SIZE (1UL << PAGE_SHIFT)
83 #define PAGE_MASK (~(PAGE_SIZE-1))
85 /* to align the pointer to the (next) page boundary */
86 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
88 #ifdef __KERNEL__
89 #ifndef __ASSEMBLY__
91 #include <asm/memory.h>
93 #endif /* !__ASSEMBLY__ */
95 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
96 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
98 #endif /* __KERNEL__ */
100 #include <asm-generic/page.h>
102 #endif