Jeremy Fitzhardinge | 51c78eb | 2009-02-08 22:52:14 -0800 | [diff] [blame] | 1 | #ifndef _ASM_X86_PAGE_DEFS_H |
| 2 | #define _ASM_X86_PAGE_DEFS_H |
| 3 | |
| 4 | #include <linux/const.h> |
| 5 | |
| 6 | /* PAGE_SHIFT determines the page size */ |
| 7 | #define PAGE_SHIFT 12 |
| 8 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) |
| 9 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
| 10 | |
| 11 | #define __PHYSICAL_MASK ((phys_addr_t)(1ULL << __PHYSICAL_MASK_SHIFT) - 1) |
| 12 | #define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1) |
| 13 | |
| 14 | /* Cast PAGE_MASK to a signed type so that it is sign-extended if |
| 15 | virtual addresses are 32-bits but physical addresses are larger |
| 16 | (ie, 32-bit PAE). */ |
| 17 | #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) |
| 18 | |
Jeremy Fitzhardinge | 51c78eb | 2009-02-08 22:52:14 -0800 | [diff] [blame] | 19 | #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) |
| 20 | #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) |
| 21 | |
| 22 | #define HPAGE_SHIFT PMD_SHIFT |
| 23 | #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) |
| 24 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) |
| 25 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) |
| 26 | |
| 27 | #define HUGE_MAX_HSTATE 2 |
| 28 | |
| 29 | #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) |
| 30 | |
| 31 | #define VM_DATA_DEFAULT_FLAGS \ |
| 32 | (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ |
| 33 | VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
| 34 | |
| 35 | #ifdef CONFIG_X86_64 |
| 36 | #include <asm/page_64_types.h> |
| 37 | #else |
| 38 | #include <asm/page_32_types.h> |
| 39 | #endif /* CONFIG_X86_64 */ |
| 40 | |
| 41 | #ifndef __ASSEMBLY__ |
| 42 | |
Jeremy Fitzhardinge | 51c78eb | 2009-02-08 22:52:14 -0800 | [diff] [blame] | 43 | extern int devmem_is_allowed(unsigned long pagenr); |
Jeremy Fitzhardinge | 51c78eb | 2009-02-08 22:52:14 -0800 | [diff] [blame] | 44 | |
| 45 | extern unsigned long max_low_pfn_mapped; |
| 46 | extern unsigned long max_pfn_mapped; |
| 47 | |
Jaswinder Singh Rajput | 66aa230 | 2009-04-14 12:54:29 +0530 | [diff] [blame] | 48 | extern unsigned long init_memory_mapping(unsigned long start, |
| 49 | unsigned long end); |
| 50 | |
David Rientjes | 8ee2deb | 2009-09-25 15:20:00 -0700 | [diff] [blame] | 51 | extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn, |
| 52 | int acpi, int k8); |
Jaswinder Singh Rajput | 66aa230 | 2009-04-14 12:54:29 +0530 | [diff] [blame] | 53 | extern void free_initmem(void); |
| 54 | |
Jeremy Fitzhardinge | 51c78eb | 2009-02-08 22:52:14 -0800 | [diff] [blame] | 55 | #endif /* !__ASSEMBLY__ */ |
| 56 | |
| 57 | #endif /* _ASM_X86_PAGE_DEFS_H */ |