From f6be448f64486c8bf2f1e1be6351db638f091b20 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 21 Sep 2008 20:48:40 +0000 Subject: 2008-09-21 Joel Sherrill * bspgetworkarea.c: Fix typo. Add debug printk statements. --- c/src/lib/libbsp/shared/ChangeLog | 4 ++++ c/src/lib/libbsp/shared/bspgetworkarea.c | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index 775f7dcbcd..036f55bcf8 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,7 @@ +2008-09-21 Joel Sherrill + + * bspgetworkarea.c: Fix typo. Add debug printk statements. + 2008-09-20 Joel Sherrill * bspgetworkarea.c: Augment to optionally know U-Boot. diff --git a/c/src/lib/libbsp/shared/bspgetworkarea.c b/c/src/lib/libbsp/shared/bspgetworkarea.c index 3bd67444dd..5cc5ce4502 100644 --- a/c/src/lib/libbsp/shared/bspgetworkarea.c +++ b/c/src/lib/libbsp/shared/bspgetworkarea.c @@ -1,6 +1,6 @@ /* * This routine is an implementation of the bsp_get_work_area() - * that can be used by all m68k BSPs following linkcmds conventions + * that can be used by all BSPs following linkcmds conventions * regarding heap, stack, and workspace allocation. * * COPYRIGHT (c) 1989-2008. @@ -13,8 +13,13 @@ * $Id$ */ +/* #define BSP_GET_WORK_AREA_DEBUG */ + #include #include +#ifdef BSP_GET_WORK_AREA_DEBUG + #include +#endif /* * These are provided by the linkcmds for ALL of the BSPs which use this file. @@ -50,11 +55,19 @@ void bsp_get_work_area( ram_end = (uintptr_t) bsp_uboot_board_info.bi_memstart + bsp_uboot_board_info.bi_memsize; #else - ram_end = RamBase + (uintptr_t)RamSize; + ram_end = (uintptr_t)RamBase + (uintptr_t)RamSize; #endif *work_area_start = WorkAreaBase; - *work_area_size = ram_end = (uintptr_t) WorkAreaBase; + *work_area_size = ram_end - (uintptr_t) WorkAreaBase; *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; *heap_size = (size_t) HeapSize; + + #ifdef BSP_GET_WORK_AREA_DEBUG + printk( "work_area_start = %p\n", *work_area_start ); + printk( "work_area_size = %d 0x%08x\n", *work_area_size, *work_area_size ); + printk( "end = %p\n", *work_area_start + *work_area_size ); + printk( "heap_start = %p\n", *heap_start ); + printk( "heap_size = %d\n", *heap_size ); + #endif } -- cgit v1.2.3