Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112313
b: refs/heads/master
c: eca7321
h: refs/heads/master
i:
  112311: ba0ac10
v: v3
  • Loading branch information
Russell King authored and Russell King committed Sep 30, 2008
1 parent 798dc10 commit 804fe0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 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: da46c79a5418dd6ba006665c1535af0713bb77b9
refs/heads/master: eca73214c9c50e290b8dc823b41730b01788872d
9 changes: 1 addition & 8 deletions trunk/arch/arm/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,7 @@ bootmem_init_node(int node, int initrd_node, struct meminfo *mi)
void __init bootmem_init(struct meminfo *mi)
{
unsigned long memend_pfn = 0;
int node, initrd_node, i;

/*
* Invalidate the node number for empty or invalid memory banks
*/
for (i = 0; i < mi->nr_banks; i++)
if (mi->bank[i].size == 0 || mi->bank[i].node >= MAX_NUMNODES)
mi->bank[i].node = -1;
int node, initrd_node;

memcpy(&meminfo, mi, sizeof(meminfo));

Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,10 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
static int __init check_membank_valid(struct membank *mb)
{
/*
* Check whether this memory region has non-zero size.
* Check whether this memory region has non-zero size or
* invalid node number.
*/
if (mb->size == 0)
if (mb->size == 0 || mb->node >= MAX_NUMNODES)
return 0;

/*
Expand Down Expand Up @@ -605,8 +606,7 @@ static int __init check_membank_valid(struct membank *mb)

static void __init sanity_check_meminfo(struct meminfo *mi)
{
int i;
int j;
int i, j;

for (i = 0, j = 0; i < mi->nr_banks; i++) {
if (check_membank_valid(&mi->bank[i]))
Expand Down
14 changes: 14 additions & 0 deletions trunk/arch/arm/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,26 @@ void __init reserve_node_zero(pg_data_t *pgdat)
BOOTMEM_DEFAULT);
}

static void __init sanity_check_meminfo(struct meminfo *mi)
{
int i, j;

for (i = 0, j = 0; i < mi->nr_banks; i++) {
struct membank *mb = &mi->bank[i];

if (mb->size != 0 && mb->node < MAX_NUMNODES)
mi->bank[j++] = mi->bank[i];
}
mi->nr_banks = j;
}

/*
* paging_init() sets up the page tables, initialises the zone memory
* maps, and sets up the zero page, bad page and bad page tables.
*/
void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
{
sanity_check_meminfo(mi);
bootmem_init(mi);
}

Expand Down

0 comments on commit 804fe0e

Please sign in to comment.