2008-10-23 05:26:29 +00:00
|
|
|
#ifndef _ASM_X86_PAGE_64_H
|
|
|
|
#define _ASM_X86_PAGE_64_H
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-02-09 06:52:14 +00:00
|
|
|
#include <asm/page_64_types.h>
|
2008-01-30 12:32:41 +00:00
|
|
|
|
2012-11-16 21:53:09 +00:00
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
|
|
|
|
/* duplicated to the one in bootmem.h */
|
|
|
|
extern unsigned long max_pfn;
|
|
|
|
extern unsigned long phys_base;
|
|
|
|
|
2012-11-16 21:53:51 +00:00
|
|
|
static inline unsigned long __phys_addr_nodebug(unsigned long x)
|
|
|
|
{
|
|
|
|
unsigned long y = x - __START_KERNEL_map;
|
|
|
|
|
|
|
|
/* use the carry flag to determine if x was < __START_KERNEL_map */
|
|
|
|
x = y + ((x > y) ? phys_base : (__START_KERNEL_map - PAGE_OFFSET));
|
|
|
|
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_VIRTUAL
|
2012-11-16 21:53:09 +00:00
|
|
|
extern unsigned long __phys_addr(unsigned long);
|
2012-11-16 21:55:46 +00:00
|
|
|
extern unsigned long __phys_addr_symbol(unsigned long);
|
2012-11-16 21:53:51 +00:00
|
|
|
#else
|
|
|
|
#define __phys_addr(x) __phys_addr_nodebug(x)
|
2012-11-16 21:55:46 +00:00
|
|
|
#define __phys_addr_symbol(x) \
|
|
|
|
((unsigned long)(x) - __START_KERNEL_map + phys_base)
|
2012-11-16 21:53:51 +00:00
|
|
|
#endif
|
2012-11-16 21:53:09 +00:00
|
|
|
|
|
|
|
#define __phys_reloc_hide(x) (x)
|
|
|
|
|
|
|
|
#ifdef CONFIG_FLATMEM
|
|
|
|
#define pfn_valid(pfn) ((pfn) < max_pfn)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void clear_page(void *page);
|
|
|
|
void copy_page(void *to, void *from);
|
|
|
|
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
|
2008-10-23 05:26:29 +00:00
|
|
|
#endif /* _ASM_X86_PAGE_64_H */
|