From 47a3cd8f73780bad3eff5135f0eb58e8c98af91d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 9 Aug 2012 16:48:00 +0200 Subject: score: Work area initialization API change The work areas (RTEMS work space and C program heap) will be initialized now in a separate step and are no longer part of rtems_initialize_data_structures(). Initialization is performed with tables of Heap_Area entries. This allows usage of scattered memory areas present on various small scale micro-controllers. The sbrk() support API changes also. The bsp_sbrk_init() must now deal with a minimum size for the first memory chunk to take the configured work space size into account. --- c/src/lib/libbsp/sparc/shared/bspgetworkarea.c | 27 +++++++++----------------- 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'c/src/lib/libbsp/sparc/shared/bspgetworkarea.c') diff --git a/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c b/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c index 45d3d0ed87..d799800d61 100644 --- a/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c +++ b/c/src/lib/libbsp/sparc/shared/bspgetworkarea.c @@ -28,24 +28,17 @@ unsigned int early_mem = (unsigned int)&end; * is to be allocated between the RTEMS Workspace and the C Program * Heap. */ -void bsp_get_work_area( - void **work_area_start, - uintptr_t *work_area_size, - void **heap_start, - uintptr_t *heap_size -) +void bsp_work_area_initialize(void) { /* must be identical to STACK_SIZE in start.S */ #define STACK_SIZE (16 * 1024) /* Early dynamic memory allocator is placed just above _end */ - *work_area_start = (void *)early_mem; - *work_area_size = (void *)rdb_start - (void *)early_mem - STACK_SIZE; + void *work_area_start = (void *)early_mem; + uintptr_t work_area_size = + (uintptr_t)rdb_start - (uintptr_t)early_mem - STACK_SIZE; early_mem = ~0; /* Signal bsp_early_malloc not to be used anymore */ - *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA; - *heap_size = BSP_BOOTCARD_HEAP_SIZE_DEFAULT; - /* * The following may be helpful in debugging what goes wrong when * you are allocating the Work Area in a new BSP. @@ -58,19 +51,17 @@ void bsp_get_work_area( "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 */ + work_area_start, + work_area_size, /* decimal */ + work_area_size, /* hexadecimal */ end, - *heap_start, - *heap_size, sp, ((sp >= *work_area_start && sp <= end) ? " OVERLAPS!" : "") ); printk( "rdb_start = 0x%08x\n", rdb_start ); } #endif + + bsp_work_area_initialize_default(work_area_start, work_area_size); } -- cgit v1.2.3