Merge branches 'x86/xen', 'x86/build', 'x86/microcode', 'x86/mm-debug-v2', 'x86/memory-corruption-check', 'x86/early-printk', 'x86/xsave', 'x86/ptrace-v2', 'x86/quirks', 'x86/setup', 'x86/spinlocks' and 'x86/signal' into x86/core-v2
This commit is contained in:
@@ -24,19 +24,27 @@
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
|
||||
unsigned long __phys_addr(unsigned long x)
|
||||
{
|
||||
if (x >= __START_KERNEL_map)
|
||||
return x - __START_KERNEL_map + phys_base;
|
||||
return x - PAGE_OFFSET;
|
||||
}
|
||||
EXPORT_SYMBOL(__phys_addr);
|
||||
|
||||
static inline int phys_addr_valid(unsigned long addr)
|
||||
{
|
||||
return addr < (1UL << boot_cpu_data.x86_phys_bits);
|
||||
}
|
||||
|
||||
unsigned long __phys_addr(unsigned long x)
|
||||
{
|
||||
if (x >= __START_KERNEL_map) {
|
||||
x -= __START_KERNEL_map;
|
||||
VIRTUAL_BUG_ON(x >= KERNEL_IMAGE_SIZE);
|
||||
x += phys_base;
|
||||
} else {
|
||||
VIRTUAL_BUG_ON(x < PAGE_OFFSET);
|
||||
x -= PAGE_OFFSET;
|
||||
VIRTUAL_BUG_ON(system_state == SYSTEM_BOOTING ? x > MAXMEM :
|
||||
!phys_addr_valid(x));
|
||||
}
|
||||
return x;
|
||||
}
|
||||
EXPORT_SYMBOL(__phys_addr);
|
||||
|
||||
#else
|
||||
|
||||
static inline int phys_addr_valid(unsigned long addr)
|
||||
@@ -44,6 +52,17 @@ static inline int phys_addr_valid(unsigned long addr)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_VIRTUAL
|
||||
unsigned long __phys_addr(unsigned long x)
|
||||
{
|
||||
/* VMALLOC_* aren't constants; not available at the boot time */
|
||||
VIRTUAL_BUG_ON(x < PAGE_OFFSET || (system_state != SYSTEM_BOOTING &&
|
||||
is_vmalloc_addr((void *)x)));
|
||||
return x - PAGE_OFFSET;
|
||||
}
|
||||
EXPORT_SYMBOL(__phys_addr);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
int page_is_ram(unsigned long pagenr)
|
||||
|
Reference in New Issue
Block a user