2010-02-01 Till Straumann <strauman@slac.stanford.edu>

PR 1492/bsps
	* shared/startup/sbrk.c: When BSP_sbrk_policy had the value (-1)
	(-> give all memory to the heap initially) then the computation
	of the remaining heap size was wrong.
This commit is contained in:
Till Straumann
2010-02-01 18:49:13 +00:00
parent 8e297158c2
commit d7b700d808
2 changed files with 11 additions and 2 deletions

View File

@@ -1,3 +1,10 @@
2010-02-01 Till Straumann <strauman@slac.stanford.edu>
PR 1492/bsps
* shared/startup/sbrk.c: When BSP_sbrk_policy had the value (-1)
(-> give all memory to the heap initially) then the computation
of the remaining heap size was wrong.
2009-03-12 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1385/cpukit

View File

@@ -89,9 +89,10 @@ uint32_t
_bsp_sbrk_init(uint32_t heap_start, uint32_t *heap_size_p)
{
uint32_t rval=0;
uint32_t orig_size;
remaining_start = heap_start;
remaining_size = *heap_size_p;
orig_size = remaining_size = *heap_size_p;
if (remaining_start < LIMIT_32M &&
remaining_start + remaining_size > LIMIT_32M) {
@@ -105,7 +106,8 @@ _bsp_sbrk_init(uint32_t heap_start, uint32_t *heap_size_p)
if ( 0 != &BSP_sbrk_policy ) {
switch ( BSP_sbrk_policy ) {
case (uint32_t)(-1):
remaining_start = heap_start + *heap_size_p;
remaining_start = heap_start + orig_size;
*heap_size_p = orig_size;
remaining_size = 0;
/* return a nonzero sbrk_amount because the libsupport code
* at some point divides by this number prior to trying an