summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-01 18:23:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-07-01 18:23:09 +0000
commit7d647c09e9ee06016bcc126f85772191e0728612 (patch)
tree9aa548a42c83d3b0918e9f3440477b1c11aed147 /cpukit
parent2011-07-01 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff)
downloadrtems-7d647c09e9ee06016bcc126f85772191e0728612.tar.bz2
2011-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc_initialize.c: After discussion with Till Straumann, revert the change from r1.12 to r1.13. This broke BSPs with sbrk() support once the libbsp sbrk() framework was enhanced. psim runs now.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog7
-rw-r--r--cpukit/libcsupport/src/malloc_initialize.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 82eb911235..f57d4d97fb 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-01 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * libcsupport/src/malloc_initialize.c: After discussion with Till
+ Straumann, revert the change from r1.12 to r1.13. This broke BSPs
+ with sbrk() support once the libbsp sbrk() framework was enhanced.
+ psim runs now.
+
2011-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1826/cpukit
diff --git a/cpukit/libcsupport/src/malloc_initialize.c b/cpukit/libcsupport/src/malloc_initialize.c
index e00a868e5a..3c8c14c188 100644
--- a/cpukit/libcsupport/src/malloc_initialize.c
+++ b/cpukit/libcsupport/src/malloc_initialize.c
@@ -45,7 +45,7 @@ void RTEMS_Malloc_Initialize(
{
/*
* If configured, initialize the statistics support
- */
+ */
if ( rtems_malloc_statistics_helpers != NULL ) {
(*rtems_malloc_statistics_helpers->initialize)();
}
@@ -59,11 +59,13 @@ void RTEMS_Malloc_Initialize(
* Initialize the optional sbrk support for extending the heap
*/
if ( rtems_malloc_sbrk_helpers != NULL ) {
- heap_begin = (*rtems_malloc_sbrk_helpers->initialize)(
+ void *new_heap_begin = (*rtems_malloc_sbrk_helpers->initialize)(
heap_begin,
sbrk_amount
);
- heap_size = (uintptr_t) sbrk_amount;
+
+ heap_size -= (uintptr_t) new_heap_begin - (uintptr_t) heap_begin;
+ heap_begin = new_heap_begin;
}
/*