summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c')
-rw-r--r--c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c b/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c
index 29bee0077c..1543c81c3b 100644
--- a/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c
+++ b/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c
@@ -56,12 +56,16 @@ void bsp_libc_init( void *, unsigned32, int );
void bsp_pretasking_hook(void)
{
- extern int HeapBase;
- extern int HeapSize;
- void *heapStart = &HeapBase;
- unsigned long heapSize = (unsigned long)&HeapSize;
+ void *heapStart;
+ unsigned long heapSize;
unsigned long ramSpace;
+ extern int WorkspaceBase;
+ heapStart = (void *)
+ ((unsigned long)&WorkspaceBase + BSP_Configuration.work_space_size);
+ if ( (unsigned long) heapStart > (256 * 1024) )
+ rtems_fatal_error_occurred (('H'<<24) | ('E'<<16) | ('A'<<8) | 'P');
+ heapSize = (256 * 1024) - (unsigned long)(heapStart);
bsp_libc_init(heapStart, heapSize, 0);
#ifdef RTEMS_DEBUG
@@ -78,7 +82,6 @@ void bsp_pretasking_hook(void)
void bsp_start( void )
{
- extern int _end;
extern int WorkspaceBase;
/* Configure Number of Register Caches */