forked from Imagelibrary/rtems
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/bspgetworkarea.c: Add debug prints of memory information.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* shared/bspgetworkarea.c: Add debug prints of memory information.
|
||||
|
||||
2009-09-29 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* shared/include/pci.h: Add prototypes for BusCountPCI(void),
|
||||
|
||||
@@ -12,8 +12,12 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* #define BSP_GET_WORK_AREA_DEBUG */
|
||||
#include <bsp.h>
|
||||
#include <bsp/bootcard.h>
|
||||
#ifdef BSP_GET_WORK_AREA_DEBUG
|
||||
#include <rtems/bspIo.h>
|
||||
#endif
|
||||
|
||||
/* Tells us where to put the workspace in case remote debugger is present. */
|
||||
extern uint32_t rdb_start;
|
||||
@@ -37,4 +41,32 @@ void bsp_get_work_area(
|
||||
*work_area_size = (void *)rdb_start - (void *)&end - STACK_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.
|
||||
*/
|
||||
#ifdef BSP_GET_WORK_AREA_DEBUG
|
||||
{
|
||||
void *sp = __builtin_frame_address(0);
|
||||
void *end = *work_area_start + *work_area_size;
|
||||
printk(
|
||||
"work_area_start = 0x%p\n"
|
||||
"work_area_size = %d 0x%08x\n"
|
||||
"end = 0x%p\n"
|
||||
"heap_start = 0x%p\n"
|
||||
"heap_size = %d\n"
|
||||
"current stack pointer = 0x%p%s\n",
|
||||
*work_area_start,
|
||||
*work_area_size, /* decimal */
|
||||
*work_area_size, /* hexadecimal */
|
||||
end,
|
||||
*heap_start,
|
||||
*heap_size,
|
||||
sp,
|
||||
((sp >= *work_area_start && sp <= end) ? " OVERLAPS!" : "")
|
||||
);
|
||||
printk( "rdb_start = 0x%08x\n", rdb_start );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user