2008-09-23 Joel Sherrill <joel.sherrill@oarcorp.com>

* bootcard.c, include/bootcard.h: Make letting boot_card() handle work
	area allocation mandatory. Rename
	RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION to BSP_BOOTCARD_OPTIONS.
This commit is contained in:
Joel Sherrill
2008-09-23 19:53:41 +00:00
parent 95aa5e134e
commit 0de9fdfb2e
3 changed files with 92 additions and 104 deletions

View File

@@ -1,3 +1,9 @@
2008-09-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* bootcard.c, include/bootcard.h: Make letting boot_card() handle work
area allocation mandatory. Rename
RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION to BSP_BOOTCARD_OPTIONS.
2008-09-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/utility.h: New file.

View File

@@ -62,7 +62,6 @@ extern bool rtems_unified_work_area;
* when the BSP lets the framework handle RAM allocation between
* the RTEMS Workspace and C Program Heap.
*/
#if defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
static rtems_status_code bootcard_bsp_libc_helper(
void *work_area_start,
size_t work_area_size,
@@ -108,7 +107,6 @@ extern bool rtems_unified_work_area;
return RTEMS_SUCCESSFUL;
}
#endif
/*
* This is the initialization framework routine that weaves together
@@ -127,13 +125,11 @@ int boot_card(
char **argv_p = &argv_pointer;
char **envp_p = &envp_pointer;
rtems_interrupt_level bsp_isr_level;
#if defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
rtems_status_code sc = RTEMS_SUCCESSFUL;
void *work_area_start = NULL;
size_t work_area_size = 0;
void *heap_start = NULL;
size_t heap_size = 0;
#endif
/*
* Special case for PowerPC: The interrupt disable mask is stored in SPRG0.
@@ -174,14 +170,7 @@ int boot_card(
* Find out where the block of memory the BSP will use for
* the RTEMS Workspace and the C Program Heap is.
*/
#if defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
{
bsp_get_work_area(
&work_area_start,
&work_area_size,
&heap_start,
&heap_size
);
bsp_get_work_area(&work_area_start, &work_area_size, &heap_start, &heap_size);
if ( work_area_size <= Configuration.work_space_size ) {
printk( "bootcard: Work space too big for work area!\n");
@@ -200,8 +189,6 @@ int boot_card(
#if (BSP_DIRTY_MEMORY == 1)
memset( work_area_start, 0xCF, work_area_size );
#endif
}
#endif
/*
* Initialize RTEMS data structures
@@ -212,7 +199,6 @@ int boot_card(
* Initialize the C library for those BSPs using the shared
* framework.
*/
#if defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
sc = bootcard_bsp_libc_helper(
work_area_start,
work_area_size,
@@ -224,7 +210,6 @@ int boot_card(
bsp_cleanup();
return -1;
}
#endif
/*
* All BSP to do any required initialization now that RTEMS
@@ -295,6 +280,5 @@ int boot_card(
/*
* Now return to the start code.
*/
return 0;
}

View File

@@ -30,7 +30,7 @@
#include <stddef.h>
#include <stdint.h>
#include <bspopts.h> /* for BSP_BOOTCARD_HANDLES_RAM_ALLOCATION */
#include <bspopts.h>
#ifdef __cplusplus
extern "C" {
@@ -48,7 +48,6 @@ void bsp_cleanup(void);
void bsp_reset(void);
#ifdef BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
#define BSP_BOOTCARD_HEAP_USES_WORK_AREA NULL
#define BSP_BOOTCARD_HEAP_SIZE_DEFAULT 0
@@ -59,7 +58,6 @@ void bsp_reset(void);
void **heap_start,
size_t *heap_size
);
#endif
int boot_card( int argc, char **argv, char **envp);