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>
* bspinit.c: Fix warning by adding include file.

View File

@@ -46,6 +46,7 @@
#include <rtems.h>
#include <bsp/bootcard.h>
#include <rtems/bspIo.h>
/*
* 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_status_code sc = RTEMS_SUCCESSFUL;
void *work_area_start = NULL;
intptr_t work_area_size = 0;
uintptr_t work_area_size = 0;
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.
@@ -149,14 +150,14 @@ int boot_card(
* Find out where the block of memory the BSP will use for
* the RTEMS Workspace and the C Program Heap is.
*/
bsp_get_work_area(&work_area_start, (ssize_t*) &work_area_size,
&heap_start, (ssize_t*) &heap_size);
bsp_get_work_area(&work_area_start, &work_area_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(
"bootcard: Work space too big for work area! (%d > %d)\n",
Configuration.work_space_size,
work_area_size
"bootcard: Work space too big for work area! (0x%08lx > 0x%08lx)\n",
(uint32_t)Configuration.work_space_size,
(uint32_t)work_area_size
);
bsp_cleanup();
return -1;

View File

@@ -43,10 +43,10 @@ extern char HeapSize[];
* Heap.
*/
void bsp_get_work_area(
void **work_area_start,
ssize_t *work_area_size,
void **heap_start,
ssize_t *heap_size
void **work_area_start,
uintptr_t *work_area_size,
void **heap_start,
uintptr_t *heap_size
)
{
uintptr_t ram_end;
@@ -61,7 +61,7 @@ void bsp_get_work_area(
*work_area_start = WorkAreaBase;
*work_area_size = ram_end - (uintptr_t) WorkAreaBase;
*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

View File

@@ -54,10 +54,10 @@ void bsp_reset(void);
#define BSP_BOOTCARD_HEAP_SIZE_DEFAULT 0
void bsp_get_work_area(
void **work_area_start,
ssize_t *work_area_size,
void **heap_start,
ssize_t *heap_size
void **work_area_start,
uintptr_t *work_area_size,
void **heap_start,
uintptr_t *heap_size
);
int boot_card( const char *cmdline );