forked from Imagelibrary/rtems
2009-02-27 Joel Sherrill <joel.sherrill@OARcorp.com>
* bspgetworkarea.c: Add check to determine if current stack pointer is in work area.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2009-02-27 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* bspgetworkarea.c: Add check to determine if current stack pointer is
|
||||||
|
in work area.
|
||||||
|
|
||||||
2009-02-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2009-02-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
* include/utility.h: Added define.
|
* include/utility.h: Added define.
|
||||||
|
|||||||
@@ -63,11 +63,30 @@ void bsp_get_work_area(
|
|||||||
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
|
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
|
||||||
*heap_size = (ssize_t) HeapSize;
|
*heap_size = (ssize_t) HeapSize;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
#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 );
|
void *sp = __builtin_frame_address(0);
|
||||||
printk( "end = %p\n", *work_area_start + *work_area_size );
|
void *end = *work_area_start + *work_area_size;
|
||||||
printk( "heap_start = %p\n", *heap_start );
|
printk(
|
||||||
printk( "heap_size = %d\n", *heap_size );
|
"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!" : "")
|
||||||
|
);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user