4 /* PAGE_SHIFT determines the page size */
6 #define PAGE_SIZE (1UL << PAGE_SHIFT)
7 #define PAGE_MASK (~(PAGE_SIZE-1))
12 #include <linux/config.h>
14 #ifdef CONFIG_X86_USE_3DNOW
18 #define clear_page(page) mmx_clear_page(page)
19 #define copy_page(to,from) mmx_copy_page(to,from)
24 * On older X86 processors its not a win to use MMX here it seems.
28 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
29 #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE)
33 #define clear_user_page(page, vaddr) clear_page(page)
34 #define copy_user_page(to, from, vaddr) copy_page(to, from)
37 * These are used to make use of C type-checking..
40 typedef struct { unsigned long long pte
; } pte_t
;
41 typedef struct { unsigned long long pmd
; } pmd_t
;
42 typedef struct { unsigned long long pgd
; } pgd_t
;
43 #define PTE_MASK (~(unsigned long long) (PAGE_SIZE-1))
45 typedef struct { unsigned long pte
; } pte_t
;
46 typedef struct { unsigned long pmd
; } pmd_t
;
47 typedef struct { unsigned long pgd
; } pgd_t
;
48 #define PTE_MASK PAGE_MASK
51 typedef struct { unsigned long pgprot
; } pgprot_t
;
53 #define pte_val(x) ((x).pte)
54 #define pmd_val(x) ((x).pmd)
55 #define pgd_val(x) ((x).pgd)
56 #define pgprot_val(x) ((x).pgprot)
58 #define __pte(x) ((pte_t) { (x) } )
59 #define __pmd(x) ((pmd_t) { (x) } )
60 #define __pgd(x) ((pgd_t) { (x) } )
61 #define __pgprot(x) ((pgprot_t) { (x) } )
63 #endif /* !__ASSEMBLY__ */
65 /* to align the pointer to the (next) page boundary */
66 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
69 * This handles the memory map.. We could make this a config
70 * option, but too many people screw it up, and too few need
73 * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
74 * a virtual address space of one gigabyte, which limits the
75 * amount of physical memory you can use to about 950MB.
77 * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
78 * amd CONFIG_HIGHMEM64G options in the kernel configuration.
81 #define __PAGE_OFFSET (0xC0000000)
85 extern int console_loglevel
;
88 * Tell the user there is some problem. Beep too, so we can
89 * see^H^H^Hhear bugs in early bootup as well!
92 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
93 __asm__ __volatile__(".byte 0x0f,0x0b"); \
96 #define PAGE_BUG(page) do { \
100 /* Pure 2^n version of get_order */
101 extern __inline__
int get_order(unsigned long size
)
105 size
= (size
-1) >> (PAGE_SHIFT
-1);
114 #endif /* __ASSEMBLY__ */
116 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
117 #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
118 #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
119 #define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
120 #define PHYSMAP_NR(addr) ((unsigned long)(addr) >> PAGE_SHIFT)
122 #endif /* __KERNEL__ */
124 #endif /* _I386_PAGE_H */