Merge branch 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (74 commits) x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S xen: Cope with unmapped pages when initializing kernel pagetable memblock, bootmem: Round pfn properly for memory and reserved regions memblock: Annotate memblock functions with __init_memblock memblock: Allow memblock_init to be called early memblock/arm: Fix memblock_region_is_memory() typo x86, memblock: Remove __memblock_x86_find_in_range_size() memblock: Fix wraparound in find_region() x86-32, memblock: Make add_highpages honor early reserved ranges x86, memblock: Fix crashkernel allocation arm, memblock: Fix the sparsemem build memblock: Fix section mismatch warnings powerpc, memblock: Fix memblock API change fallout memblock, microblaze: Fix memblock API change fallout x86: Remove old bootmem code x86, memblock: Use memblock_memory_size()/memblock_free_memory_size() to get correct dma_reserve x86: Remove not used early_res code x86, memblock: Replace e820_/_early string with memblock_ x86: Use memblock to replace early_res x86, memblock: Use memblock_debug to control debug message print out ... Fix up trivial conflicts in arch/x86/kernel/setup.c and kernel/Makefile
This commit is contained in:
@ -150,6 +150,7 @@ static void __init find_limits(struct meminfo *mi,
|
||||
static void __init arm_bootmem_init(struct meminfo *mi,
|
||||
unsigned long start_pfn, unsigned long end_pfn)
|
||||
{
|
||||
struct memblock_region *reg;
|
||||
unsigned int boot_pages;
|
||||
phys_addr_t bitmap;
|
||||
pg_data_t *pgdat;
|
||||
@ -180,13 +181,13 @@ static void __init arm_bootmem_init(struct meminfo *mi,
|
||||
/*
|
||||
* Reserve the memblock reserved regions in bootmem.
|
||||
*/
|
||||
for (i = 0; i < memblock.reserved.cnt; i++) {
|
||||
phys_addr_t start = memblock_start_pfn(&memblock.reserved, i);
|
||||
if (start >= start_pfn &&
|
||||
memblock_end_pfn(&memblock.reserved, i) <= end_pfn)
|
||||
for_each_memblock(reserved, reg) {
|
||||
phys_addr_t start = memblock_region_reserved_base_pfn(reg);
|
||||
phys_addr_t end = memblock_region_reserved_end_pfn(reg);
|
||||
if (start >= start_pfn && end <= end_pfn)
|
||||
reserve_bootmem_node(pgdat, __pfn_to_phys(start),
|
||||
memblock_size_bytes(&memblock.reserved, i),
|
||||
BOOTMEM_DEFAULT);
|
||||
(end - start) << PAGE_SHIFT,
|
||||
BOOTMEM_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,20 +238,7 @@ static void __init arm_bootmem_free(struct meminfo *mi, unsigned long min,
|
||||
#ifndef CONFIG_SPARSEMEM
|
||||
int pfn_valid(unsigned long pfn)
|
||||
{
|
||||
struct memblock_region *mem = &memblock.memory;
|
||||
unsigned int left = 0, right = mem->cnt;
|
||||
|
||||
do {
|
||||
unsigned int mid = (right + left) / 2;
|
||||
|
||||
if (pfn < memblock_start_pfn(mem, mid))
|
||||
right = mid;
|
||||
else if (pfn >= memblock_end_pfn(mem, mid))
|
||||
left = mid + 1;
|
||||
else
|
||||
return 1;
|
||||
} while (left < right);
|
||||
return 0;
|
||||
return memblock_is_memory(pfn << PAGE_SHIFT);
|
||||
}
|
||||
EXPORT_SYMBOL(pfn_valid);
|
||||
|
||||
@ -260,10 +248,11 @@ static void arm_memory_present(void)
|
||||
#else
|
||||
static void arm_memory_present(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < memblock.memory.cnt; i++)
|
||||
memory_present(0, memblock_start_pfn(&memblock.memory, i),
|
||||
memblock_end_pfn(&memblock.memory, i));
|
||||
struct memblock_region *reg;
|
||||
|
||||
for_each_memblock(memory, reg)
|
||||
memory_present(0, memblock_region_memory_base_pfn(reg),
|
||||
memblock_region_memory_end_pfn(reg));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user