summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared/bootcard.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-03-10 17:40:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-03-10 17:40:06 +0000
commit96f2d87a59ce0ccddf5770805471b02907933bb9 (patch)
tree59a5a141f8a04723717574e5011cb58c586f2e6e /c/src/lib/libbsp/shared/bootcard.c
parentDisable sim on mingw32. (diff)
downloadrtems-96f2d87a59ce0ccddf5770805471b02907933bb9.tar.bz2
2009-03-10 Eric Norum <norume@aps.anl.gov>
* bootcard.c: Swap order of RTEMS Workspace and Malloc Heap. This allows the potential for sbrk() to extend the heap area. This actually is done on PowerPC BSPs with more than 32MB which use dynamic loading.
Diffstat (limited to 'c/src/lib/libbsp/shared/bootcard.c')
-rw-r--r--c/src/lib/libbsp/shared/bootcard.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/shared/bootcard.c b/c/src/lib/libbsp/shared/bootcard.c
index f83c109b4f..10a3b0d7a8 100644
--- a/c/src/lib/libbsp/shared/bootcard.c
+++ b/c/src/lib/libbsp/shared/bootcard.c
@@ -73,8 +73,8 @@ static rtems_status_code bootcard_bsp_libc_helper(
if ( !rtems_unified_work_area &&
heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA) {
- /* Use the work area start as heap start */
- heap_start = work_area_start;
+ /* Place the heap immediately following the work area */
+ heap_start = work_area_start + rtems_configuration_get_work_space_size();
/* Ensure proper alignement */
if ((uintptr_t) heap_start & (CPU_ALIGNMENT - 1)) {
@@ -83,11 +83,10 @@ static rtems_status_code bootcard_bsp_libc_helper(
}
/*
- * For the default heap size use the free space from the start of the
- * work area up to the work space start as heap area.
+ * For the default heap size use the free space from the end of the
+ * work space up to the end of the work area as heap.
*/
- heap_size_default = (intptr_t) ((char *) Configuration.work_space_start
- - (char *) heap_start);
+ heap_size_default = work_area_size - rtems_configuration_get_work_space_size();
/* Keep it as a multiple of 16 bytes */
heap_size_default &= ~((intptr_t) 0xf);
@@ -182,8 +181,7 @@ int boot_card(
Configuration.work_space_start = work_area_start;
Configuration.work_space_size = work_area_size;
} else {
- Configuration.work_space_start = (char *) work_area_start +
- work_area_size - rtems_configuration_get_work_space_size();
+ Configuration.work_space_start = (char *) work_area_start;
}
#if (BSP_DIRTY_MEMORY == 1)