diff options
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 } |