diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-19 20:41:36 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-19 20:41:36 +0000 |
commit | 7a2125ca39854c6bab1180dda7202a5af908357a (patch) | |
tree | 8db1f39bde8e4aa557f5aac63fa3d30203abca40 /c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c | |
parent | 2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-7a2125ca39854c6bab1180dda7202a5af908357a.tar.bz2 |
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/start/start.S, shared/startup/bspgetworkarea.c,
shared/startup/bspstart.c, shared/startup/linkcmds: Modifications
which reflect those tested on psim. Hopefully they work on all
boards. The initialization stack is explicitly declared in the
linkcmds memory layout rather than magic math.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c b/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c index fc49315f7c..0b015c694f 100644 --- a/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c +++ b/c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c @@ -29,14 +29,24 @@ void bsp_get_work_area( uintptr_t reserve; uintptr_t spared; - reserve = (uintptr_t)BSP_INIT_STACK_SIZE; - reserve += rtems_configuration_get_interrupt_stack_size(); - size = (uintptr_t)BSP_mem_size - (uintptr_t)&__rtems_end + reserve; + reserve = rtems_configuration_get_interrupt_stack_size(); + size = (uintptr_t)BSP_mem_size - (uintptr_t)&__rtems_end - reserve; - *work_area_start = (void *)(&__rtems_end + reserve); + *work_area_start = (void *)((uintptr_t) &__rtems_end + reserve); *work_area_size = size; spared = _bsp_sbrk_init( *work_area_start, work_area_size ); *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; + + /* + * The following may be helpful in debugging what goes wrong when + * you are allocating the Work Area in a new BSP. + */ + #if 0 + printk( "Work Area Base %d %x\n", *work_area_start, *work_area_start ); + printk( "Work Area Size %d %x\n", *work_area_size, *work_area_size ); + printk( "Work Area End %d %x\n", + *work_area_start + size, *work_area_start + size ); + #endif } |