Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212722
b: refs/heads/master
c: 27de794
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Aug 27, 2010
1 parent 87daed8 commit e18f37e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f88eff74aa848e58b1ea49768c0bbb874b31357f
refs/heads/master: 27de794365786b4cdc3461ed4e23af2a33f40612
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/memblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
#define ARCH_DISCARD_MEMBLOCK

u64 memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align);
void memblock_x86_to_bootmem(u64 start, u64 end);

#endif
29 changes: 29 additions & 0 deletions trunk/arch/x86/mm/memblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,32 @@ u64 __init memblock_x86_find_in_range_size(u64 start, u64 *sizep, u64 align)

return MEMBLOCK_ERROR;
}

#ifndef CONFIG_NO_BOOTMEM
void __init memblock_x86_to_bootmem(u64 start, u64 end)
{
int count;
u64 final_start, final_end;
struct memblock_region *r;

/* Take out region array itself */
memblock_free_reserved_regions();

count = memblock.reserved.cnt;
pr_info("(%d early reservations) ==> bootmem [%010llx-%010llx]\n", count, start, end - 1);
for_each_memblock(reserved, r) {
pr_info(" [%010llx-%010llx] ", (u64)r->base, (u64)r->base + r->size - 1);
final_start = max(start, r->base);
final_end = min(end, r->base + r->size);
if (final_start >= final_end) {
pr_cont("\n");
continue;
}
pr_cont(" ==> [%010llx-%010llx]\n", final_start, final_end - 1);
reserve_bootmem_generic(final_start, final_end - final_start, BOOTMEM_DEFAULT);
}

/* Put region array back ? */
memblock_reserve_reserved_regions();
}
#endif

0 comments on commit e18f37e

Please sign in to comment.