Merge branch 'for_linus' of git://git.linux-nfs.org/pub/linux/nfs-2.6
[linux-2.6/kmemtrace.git] / include / asm-alpha / page.h
blobbae7f05716d4b9ac9bd5f99f1da92b9eed0589dd
1 #ifndef _ALPHA_PAGE_H
2 #define _ALPHA_PAGE_H
4 #ifdef __KERNEL__
6 #include <asm/pal.h>
8 /* PAGE_SHIFT determines the page size */
9 #define PAGE_SHIFT 13
10 #define PAGE_SIZE (1UL << PAGE_SHIFT)
11 #define PAGE_MASK (~(PAGE_SIZE-1))
13 #ifndef __ASSEMBLY__
15 #define STRICT_MM_TYPECHECKS
17 extern void clear_page(void *page);
18 #define clear_user_page(page, vaddr, pg) clear_page(page)
20 #define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
21 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr)
22 #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
24 extern void copy_page(void * _to, void * _from);
25 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
27 #ifdef STRICT_MM_TYPECHECKS
29 * These are used to make use of C type-checking..
31 typedef struct { unsigned long pte; } pte_t;
32 typedef struct { unsigned long pmd; } pmd_t;
33 typedef struct { unsigned long pgd; } pgd_t;
34 typedef struct { unsigned long pgprot; } pgprot_t;
36 #define pte_val(x) ((x).pte)
37 #define pmd_val(x) ((x).pmd)
38 #define pgd_val(x) ((x).pgd)
39 #define pgprot_val(x) ((x).pgprot)
41 #define __pte(x) ((pte_t) { (x) } )
42 #define __pmd(x) ((pmd_t) { (x) } )
43 #define __pgd(x) ((pgd_t) { (x) } )
44 #define __pgprot(x) ((pgprot_t) { (x) } )
46 #else
48 * .. while these make it easier on the compiler
50 typedef unsigned long pte_t;
51 typedef unsigned long pmd_t;
52 typedef unsigned long pgd_t;
53 typedef unsigned long pgprot_t;
55 #define pte_val(x) (x)
56 #define pmd_val(x) (x)
57 #define pgd_val(x) (x)
58 #define pgprot_val(x) (x)
60 #define __pte(x) (x)
61 #define __pgd(x) (x)
62 #define __pgprot(x) (x)
64 #endif /* STRICT_MM_TYPECHECKS */
66 #ifdef USE_48_BIT_KSEG
67 #define PAGE_OFFSET 0xffff800000000000UL
68 #else
69 #define PAGE_OFFSET 0xfffffc0000000000UL
70 #endif
72 #else
74 #ifdef USE_48_BIT_KSEG
75 #define PAGE_OFFSET 0xffff800000000000
76 #else
77 #define PAGE_OFFSET 0xfffffc0000000000
78 #endif
80 #endif /* !__ASSEMBLY__ */
82 /* to align the pointer to the (next) page boundary */
83 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
85 #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
86 #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
87 #ifndef CONFIG_DISCONTIGMEM
88 #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
90 #define pfn_valid(pfn) ((pfn) < max_mapnr)
91 #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
92 #endif /* CONFIG_DISCONTIGMEM */
94 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
95 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
97 #include <asm-generic/memory_model.h>
98 #include <asm-generic/page.h>
100 #endif /* __KERNEL__ */
101 #endif /* _ALPHA_PAGE_H */