summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/pc386/startup
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-08-09 16:48:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-10-25 14:54:06 +0200
commit47a3cd8f73780bad3eff5135f0eb58e8c98af91d (patch)
tree8acdfc6ebe5d596f9c6b974e6c460dc69e824e3c /c/src/lib/libbsp/i386/pc386/startup
parentscore: Append to free list in _Heap_Extend() (diff)
downloadrtems-47a3cd8f73780bad3eff5135f0eb58e8c98af91d.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/startup')
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c b/c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c
index 8668d45467..f6ff1391ec 100644
--- a/c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspgetworkarea.c
@@ -1,5 +1,5 @@
/*
- * This routine is an implementation of the bsp_get_work_area()
+ * This routine is an implementation of the bsp_work_area_initialize()
* that can be used by all m68k BSPs following linkcmds conventions
* regarding heap, stack, and workspace allocation.
*
@@ -120,30 +120,10 @@ void bsp_size_memory(void)
bsp_mem_size = topAddr;
}
-/*
- * This method returns the base address and size of the area which
- * 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)
{
- *work_area_start = (void *) rtemsWorkAreaStart;
- *work_area_size = (uintptr_t) bsp_mem_size - (uintptr_t) rtemsWorkAreaStart;
- *heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
- *heap_size = (uintptr_t) HeapSize;
-
- #ifdef BSP_GET_WORK_AREA_DEBUG
- printk( "bsp_mem_size = 0x%08x\n", bsp_mem_size );
- printk( "rtemsWorkAreaStart = 0x%08x\n", rtemsWorkAreaStart );
- printk( "WorkArea Base = %p\n", *work_area_start );
- printk( "WorkArea Size = 0x%08x\n", *work_area_size );
- printk( "C Program Heap Base = %p\n", *heap_start );
- printk( "C Program Heap Size = 0x%08x\n", *heap_size );
- printk( "End of WorkArea = %p\n", *work_area_start + *work_area_size );
- #endif
+ void *area_start = (void *) rtemsWorkAreaStart;
+ uintptr_t work_area_size = (uintptr_t) bsp_mem_size - (uintptr_t) rtemsWorkAreaStart;
+
+ bsp_work_area_initialize_default( area_start, area_size );
}