forked from Imagelibrary/rtems
2008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com>
* bootcard.c, bspgetworkarea.c, bsppretaskinghook.c, include/bootcard.h: Change size_t to ssize_t on bsp_get_work_area(). On 16-bit architectures, size_t can be 16-bits which would limit the work area to 64K.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-10-02 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* bootcard.c, bspgetworkarea.c, bsppretaskinghook.c,
|
||||
include/bootcard.h: Change size_t to ssize_t on bsp_get_work_area().
|
||||
On 16-bit architectures, size_t can be 16-bits which would limit the
|
||||
work area to 64K.
|
||||
|
||||
2008-09-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* include/utility.h: Renamed various macros.
|
||||
|
||||
@@ -63,13 +63,13 @@ extern bool rtems_unified_work_area;
|
||||
* the RTEMS Workspace and C Program Heap.
|
||||
*/
|
||||
static rtems_status_code bootcard_bsp_libc_helper(
|
||||
void *work_area_start,
|
||||
size_t work_area_size,
|
||||
void *heap_start,
|
||||
size_t heap_size
|
||||
void *work_area_start,
|
||||
ssize_t work_area_size,
|
||||
void *heap_start,
|
||||
ssize_t heap_size
|
||||
)
|
||||
{
|
||||
size_t heap_size_default = 0;
|
||||
ssize_t heap_size_default = 0;
|
||||
|
||||
if ( !rtems_unified_work_area &&
|
||||
heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA) {
|
||||
@@ -86,11 +86,11 @@ static rtems_status_code bootcard_bsp_libc_helper(
|
||||
* For the default heap size use the free space from the start of the
|
||||
* work area up to the work space start as heap area.
|
||||
*/
|
||||
heap_size_default = (size_t) ((char *) Configuration.work_space_start
|
||||
heap_size_default = (ssize_t) ((char *) Configuration.work_space_start
|
||||
- (char *) work_area_start);
|
||||
|
||||
/* Keep it as a multiple of 16 bytes */
|
||||
heap_size_default &= ~((size_t) 0xf);
|
||||
heap_size_default &= ~((ssize_t) 0xf);
|
||||
|
||||
/* Use default heap size if requested */
|
||||
if (heap_size == BSP_BOOTCARD_HEAP_SIZE_DEFAULT) {
|
||||
@@ -127,9 +127,9 @@ int boot_card(
|
||||
rtems_interrupt_level bsp_isr_level;
|
||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||
void *work_area_start = NULL;
|
||||
size_t work_area_size = 0;
|
||||
ssize_t work_area_size = 0;
|
||||
void *heap_start = NULL;
|
||||
size_t heap_size = 0;
|
||||
ssize_t heap_size = 0;
|
||||
|
||||
/*
|
||||
* Special case for PowerPC: The interrupt disable mask is stored in SPRG0.
|
||||
|
||||
@@ -43,10 +43,10 @@ extern char HeapSize[];
|
||||
* Heap.
|
||||
*/
|
||||
void bsp_get_work_area(
|
||||
void **work_area_start,
|
||||
size_t *work_area_size,
|
||||
void **heap_start,
|
||||
size_t *heap_size
|
||||
void **work_area_start,
|
||||
ssize_t *work_area_size,
|
||||
void **heap_start,
|
||||
ssize_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 = (size_t) HeapSize;
|
||||
*heap_size = (ssize_t) HeapSize;
|
||||
|
||||
#ifdef BSP_GET_WORK_AREA_DEBUG
|
||||
printk( "work_area_start = %p\n", *work_area_start );
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/*
|
||||
* This is a shared BSP pretasking hook which does nothing.
|
||||
* If all the BSP needs to do is initialize the C library,
|
||||
* then it can rely on bootcard.c and provide bsp_get_work_area().
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <bspopts.h>
|
||||
|
||||
@@ -53,10 +54,10 @@ void bsp_reset(void);
|
||||
#define BSP_BOOTCARD_HEAP_SIZE_DEFAULT 0
|
||||
|
||||
void bsp_get_work_area(
|
||||
void **work_area_start,
|
||||
size_t *work_area_size,
|
||||
void **heap_start,
|
||||
size_t *heap_size
|
||||
void **work_area_start,
|
||||
ssize_t *work_area_size,
|
||||
void **heap_start,
|
||||
ssize_t *heap_size
|
||||
);
|
||||
|
||||
int boot_card( int argc, char **argv, char **envp);
|
||||
|
||||
Reference in New Issue
Block a user