2009-05-08 Joel Sherrill <joel.sherrill@oarcorp.com>

* bootcard.c, bspgetworkarea.c, include/bootcard.h: Switch from ssize_t
	to uintptr_t for bsp_get_work_area() since the work area is larger
	than a single allocatable object.
This commit is contained in:
Joel Sherrill
2009-05-08 13:24:27 +00:00
parent eee78e5cfc
commit 5ab278ff9e
4 changed files with 24 additions and 17 deletions

View File

@@ -1,3 +1,9 @@
2009-05-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* bootcard.c, bspgetworkarea.c, include/bootcard.h: Switch from ssize_t
to uintptr_t for bsp_get_work_area() since the work area is larger
than a single allocatable object.
2009-05-06 Joel Sherrill <joel.sherrill@oarcorp.com> 2009-05-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* bspinit.c: Fix warning by adding include file. * bspinit.c: Fix warning by adding include file.

View File

@@ -46,6 +46,7 @@
#include <rtems.h> #include <rtems.h>
#include <bsp/bootcard.h> #include <bsp/bootcard.h>
#include <rtems/bspIo.h>
/* /*
* At most a single pointer to the cmdline for those target * At most a single pointer to the cmdline for those target
@@ -121,9 +122,9 @@ int boot_card(
rtems_interrupt_level bsp_isr_level; rtems_interrupt_level bsp_isr_level;
rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_status_code sc = RTEMS_SUCCESSFUL;
void *work_area_start = NULL; void *work_area_start = NULL;
intptr_t work_area_size = 0; uintptr_t work_area_size = 0;
void *heap_start = NULL; void *heap_start = NULL;
intptr_t heap_size = 0; uintptr_t heap_size = 0;
/* /*
* Special case for PowerPC: The interrupt disable mask is stored in SPRG0. * Special case for PowerPC: The interrupt disable mask is stored in SPRG0.
@@ -149,14 +150,14 @@ int boot_card(
* Find out where the block of memory the BSP will use for * Find out where the block of memory the BSP will use for
* the RTEMS Workspace and the C Program Heap is. * the RTEMS Workspace and the C Program Heap is.
*/ */
bsp_get_work_area(&work_area_start, (ssize_t*) &work_area_size, bsp_get_work_area(&work_area_start, &work_area_size,
&heap_start, (ssize_t*) &heap_size); &heap_start, &heap_size);
if ( work_area_size <= Configuration.work_space_size ) { if ( (uint32_t) work_area_size <= (uint32_t) Configuration.work_space_size ) {
printk( printk(
"bootcard: Work space too big for work area! (%d > %d)\n", "bootcard: Work space too big for work area! (0x%08lx > 0x%08lx)\n",
Configuration.work_space_size, (uint32_t)Configuration.work_space_size,
work_area_size (uint32_t)work_area_size
); );
bsp_cleanup(); bsp_cleanup();
return -1; return -1;

View File

@@ -44,9 +44,9 @@ extern char HeapSize[];
*/ */
void bsp_get_work_area( void bsp_get_work_area(
void **work_area_start, void **work_area_start,
ssize_t *work_area_size, uintptr_t *work_area_size,
void **heap_start, void **heap_start,
ssize_t *heap_size uintptr_t *heap_size
) )
{ {
uintptr_t ram_end; uintptr_t ram_end;
@@ -61,7 +61,7 @@ void bsp_get_work_area(
*work_area_start = WorkAreaBase; *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_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
*heap_size = (ssize_t) HeapSize; *heap_size = (uintptr_t) HeapSize;
/* /*
* The following may be helpful in debugging what goes wrong when * The following may be helpful in debugging what goes wrong when

View File

@@ -55,9 +55,9 @@ void bsp_reset(void);
void bsp_get_work_area( void bsp_get_work_area(
void **work_area_start, void **work_area_start,
ssize_t *work_area_size, uintptr_t *work_area_size,
void **heap_start, void **heap_start,
ssize_t *heap_size uintptr_t *heap_size
); );
int boot_card( const char *cmdline ); int boot_card( const char *cmdline );