1 #ifndef _ASM_X86_PAGE_64_H
2 #define _ASM_X86_PAGE_64_H
4 #include <asm/page_64_types.h>
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
));
23 #ifdef CONFIG_DEBUG_VIRTUAL
24 extern unsigned long __phys_addr(unsigned long);
25 extern unsigned long __phys_addr_symbol(unsigned long);
27 #define __phys_addr(x) __phys_addr_nodebug(x)
28 #define __phys_addr_symbol(x) \
29 ((unsigned long)(x) - __START_KERNEL_map + phys_base)
32 #define __phys_reloc_hide(x) (x)
35 #define pfn_valid(pfn) ((pfn) < max_pfn)
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
,
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
60 #endif /* _ASM_X86_PAGE_64_H */