]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/x86/include/asm/page_types.h
1 #ifndef _ASM_X86_PAGE_DEFS_H
2 #define _ASM_X86_PAGE_DEFS_H
4 #include <linux/const.h>
5 #include <linux/types.h>
6 #include <asm/bootparam.h>
8 /* PAGE_SHIFT determines the page size */
10 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
11 #define PAGE_MASK (~(PAGE_SIZE-1))
13 #define __PHYSICAL_MASK ((phys_addr_t)((1ULL << __PHYSICAL_MASK_SHIFT) - 1))
14 #define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
16 /* Cast PAGE_MASK to a signed type so that it is sign-extended if
17 virtual addresses are 32-bits but physical addresses are larger
19 #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK)
21 #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT)
22 #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1))
24 #define HPAGE_SHIFT PMD_SHIFT
25 #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
26 #define HPAGE_MASK (~(HPAGE_SIZE - 1))
27 #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
29 #define HUGE_MAX_HSTATE 2
31 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
33 #define VM_DATA_DEFAULT_FLAGS \
34 (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
35 VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
37 #define __PHYSICAL_START ALIGN(CONFIG_PHYSICAL_START, \
38 CONFIG_PHYSICAL_ALIGN)
40 #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
43 #include <asm/page_64_types.h>
45 #include <asm/page_32_types.h>
46 #endif /* CONFIG_X86_64 */
50 extern int devmem_is_allowed(unsigned long pagenr
);
52 extern unsigned long max_low_pfn_mapped
;
53 extern unsigned long max_pfn_mapped
;
55 extern bool kaslr_enabled
;
57 static inline phys_addr_t
get_max_mapped(void)
59 return (phys_addr_t
)max_pfn_mapped
<< PAGE_SHIFT
;
62 bool pfn_range_is_mapped(unsigned long start_pfn
, unsigned long end_pfn
);
64 extern unsigned long init_memory_mapping(unsigned long start
,
67 extern void initmem_init(void);
69 #endif /* !__ASSEMBLY__ */
71 #endif /* _ASM_X86_PAGE_DEFS_H */