Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356182
b: refs/heads/master
c: 4e33e06
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and H. Peter Anvin committed Nov 17, 2012
1 parent e5c8925 commit de860f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa62aafea9e415cd1efd8c4054106112fe809f19
refs/heads/master: 4e33e06555329e93523b3d2590b9210bf84120a3
41 changes: 25 additions & 16 deletions trunk/arch/x86/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,13 @@ static int __meminit save_mr(struct map_range *mr, int nr_range,
return nr_range;
}

/*
* Setup the direct mapping of the physical memory at PAGE_OFFSET.
* This runs before bootmem is initialized and gets pages directly from
* the physical memory. To access them they are temporarily mapped.
*/
unsigned long __init_refok init_memory_mapping(unsigned long start,
unsigned long end)
static int __meminit split_mem_range(struct map_range *mr, int nr_range,
unsigned long start,
unsigned long end)
{
unsigned long start_pfn, end_pfn;
unsigned long ret = 0;
unsigned long pos;
struct map_range mr[NR_RANGE_MR];
int nr_range, i;

printk(KERN_INFO "init_memory_mapping: [mem %#010lx-%#010lx]\n",
start, end - 1);

memset(mr, 0, sizeof(mr));
nr_range = 0;
int i;

/* head if not big page alignment ? */
start_pfn = start >> PAGE_SHIFT;
Expand Down Expand Up @@ -258,6 +246,27 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
(mr[i].page_size_mask & (1<<PG_LEVEL_1G))?"1G":(
(mr[i].page_size_mask & (1<<PG_LEVEL_2M))?"2M":"4k"));

return nr_range;
}

/*
* Setup the direct mapping of the physical memory at PAGE_OFFSET.
* This runs before bootmem is initialized and gets pages directly from
* the physical memory. To access them they are temporarily mapped.
*/
unsigned long __init_refok init_memory_mapping(unsigned long start,
unsigned long end)
{
struct map_range mr[NR_RANGE_MR];
unsigned long ret = 0;
int nr_range, i;

pr_info("init_memory_mapping: [mem %#010lx-%#010lx]\n",
start, end - 1);

memset(mr, 0, sizeof(mr));
nr_range = split_mem_range(mr, 0, start, end);

/*
* Find space for the kernel direct mapping tables.
*
Expand Down

0 comments on commit de860f6

Please sign in to comment.