Skip to content

Commit

Permalink
Blackfin: merge kernel init memory back into main memory region
Browse files Browse the repository at this point in the history
If the kernel's init section is merged back into the main memory region
during boot (which it should since that is how we've laid out the kernel
linker map), we want to make sure that these aren't counted as independent
regions.  Otherwise, if a large mapping is attempted which starts in the
init region and extends into the main memory region, the access_ok func
will deny it.  This leads to weird messages during runtime like "unable
to map xxx library" from the ldso but upon running the application again,
everything works fine.

So if the address of the end of the init region is the same as the start
of the main memory region, simply enlarge the memory region to include
the init region.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Sonic Zhang authored and Mike Frysinger committed Oct 22, 2010
1 parent 05bbec3 commit 46284cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/blackfin/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,8 @@ void __init_refok free_initmem(void)
free_init_pages("unused kernel memory",
(unsigned long)(&__init_begin),
(unsigned long)(&__init_end));

if (memory_start == (unsigned long)(&__init_end))
memory_start = (unsigned long)(&__init_begin);
#endif
}

0 comments on commit 46284cd

Please sign in to comment.