Merge tag 'chrome-platform-for-linus-4.13' of git://git.kernel.org/pub/scm/linux...
[linux/fpc-iii.git] / arch / x86 / include / asm / page_64.h
blobb4a0d43248cf3d6f2c7ef042200c31a25f29f122
1 #ifndef _ASM_X86_PAGE_64_H
2 #define _ASM_X86_PAGE_64_H
4 #include <asm/page_64_types.h>
6 #ifndef __ASSEMBLY__
7 #include <asm/alternative.h>
9 /* duplicated to the one in bootmem.h */
10 extern unsigned long max_pfn;
11 extern unsigned long phys_base;
13 static inline unsigned long __phys_addr_nodebug(unsigned long x)
15 unsigned long y = x - __START_KERNEL_map;
17 /* use the carry flag to determine if x was < __START_KERNEL_map */
18 x = y + ((x > y) ? phys_base : (__START_KERNEL_map - PAGE_OFFSET));
20 return x;
23 #ifdef CONFIG_DEBUG_VIRTUAL
24 extern unsigned long __phys_addr(unsigned long);
25 extern unsigned long __phys_addr_symbol(unsigned long);
26 #else
27 #define __phys_addr(x) __phys_addr_nodebug(x)
28 #define __phys_addr_symbol(x) \
29 ((unsigned long)(x) - __START_KERNEL_map + phys_base)
30 #endif
32 #define __phys_reloc_hide(x) (x)
34 #ifdef CONFIG_FLATMEM
35 #define pfn_valid(pfn) ((pfn) < max_pfn)
36 #endif
38 void clear_page_orig(void *page);
39 void clear_page_rep(void *page);
40 void clear_page_erms(void *page);
42 static inline void clear_page(void *page)
44 alternative_call_2(clear_page_orig,
45 clear_page_rep, X86_FEATURE_REP_GOOD,
46 clear_page_erms, X86_FEATURE_ERMS,
47 "=D" (page),
48 "0" (page)
49 : "memory", "rax", "rcx");
52 void copy_page(void *to, void *from);
54 #endif /* !__ASSEMBLY__ */
56 #ifdef CONFIG_X86_VSYSCALL_EMULATION
57 # define __HAVE_ARCH_GATE_AREA 1
58 #endif
60 #endif /* _ASM_X86_PAGE_64_H */