4 /* PAGE_SHIFT determines the page size */
6 #define PAGE_SIZE (1UL << PAGE_SHIFT)
7 #define PAGE_MASK (~(PAGE_SIZE-1))
13 #define STRICT_MM_TYPECHECKS
16 * A _lot_ of the kernel time is spent clearing pages, so
17 * do this as fast as we possibly can. Also, doing this
18 * as a separate inline function (rather than memset())
19 * results in clearer kernel profiles as we see _who_ is
20 * doing page clearing or copying.
22 static inline void clear_page(unsigned long page
)
24 unsigned long count
= PAGE_SIZE
/64;
25 unsigned long *ptr
= (unsigned long *)page
;
41 static inline void copy_page(unsigned long _to
, unsigned long _from
)
43 unsigned long count
= PAGE_SIZE
/64;
44 unsigned long *to
= (unsigned long *)_to
;
45 unsigned long *from
= (unsigned long *)_from
;
48 unsigned long a
,b
,c
,d
,e
,f
,g
,h
;
71 #ifdef STRICT_MM_TYPECHECKS
73 * These are used to make use of C type-checking..
75 typedef struct { unsigned long pte
; } pte_t
;
76 typedef struct { unsigned long pmd
; } pmd_t
;
77 typedef struct { unsigned long pgd
; } pgd_t
;
78 typedef struct { unsigned long pgprot
; } pgprot_t
;
80 #define pte_val(x) ((x).pte)
81 #define pmd_val(x) ((x).pmd)
82 #define pgd_val(x) ((x).pgd)
83 #define pgprot_val(x) ((x).pgprot)
85 #define __pte(x) ((pte_t) { (x) } )
86 #define __pgd(x) ((pgd_t) { (x) } )
87 #define __pgprot(x) ((pgprot_t) { (x) } )
91 * .. while these make it easier on the compiler
93 typedef unsigned long pte_t
;
94 typedef unsigned long pmd_t
;
95 typedef unsigned long pgd_t
;
96 typedef unsigned long pgprot_t
;
98 #define pte_val(x) (x)
99 #define pmd_val(x) (x)
100 #define pgd_val(x) (x)
101 #define pgprot_val(x) (x)
105 #define __pgprot(x) (x)
107 #endif /* STRICT_MM_TYPECHECKS */
108 #endif /* !ASSEMBLY */
110 /* to align the pointer to the (next) page boundary */
111 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
113 #ifdef USE_48_BIT_KSEG
114 #define PAGE_OFFSET 0xffff800000000000
116 #define PAGE_OFFSET 0xfffffc0000000000
119 #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
120 #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
121 #define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
123 #endif /* __KERNEL__ */
125 #endif /* _ALPHA_PAGE_H */