summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2010-02-01 18:49:13 +0000
committerTill Straumann <strauman@slac.stanford.edu>2010-02-01 18:49:13 +0000
commitd7b700d8080c502daddd2218ff786209eea31b2b (patch)
tree0fb2439f154ffdb00584fbd92c048a0ef900fa63
parent2010-01-11 Marc Pignat <marc.pignat@hevs.ch> (diff)
downloadrtems-d7b700d8080c502daddd2218ff786209eea31b2b.tar.bz2
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.
-rw-r--r--c/src/lib/libbsp/powerpc/ChangeLog7
-rw-r--r--c/src/lib/libbsp/powerpc/shared/startup/sbrk.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/ChangeLog
index 32e51e97a4..8d847545ae 100644
--- a/c/src/lib/libbsp/powerpc/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/ChangeLog
@@ -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
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c b/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c
index d2afc8e616..c74704a8ad 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/sbrk.c
@@ -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