forked from Imagelibrary/rtems
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* shared/m68kbspgetworkarea.c: Add use of bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization. Remove unnecessary includes of rtems/libio.h and rtems/libcsupport.h. * shared/m68kpretaskinghook.c: Removed.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* shared/m68kbspgetworkarea.c: Add use of bsp_get_work_area() in its
|
||||
own file and rely on BSP Framework to perform more initialization.
|
||||
Remove unnecessary includes of rtems/libio.h and rtems/libcsupport.h.
|
||||
* shared/m68kpretaskinghook.c: Removed.
|
||||
|
||||
2008-09-06 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* shared/gdbstub/m68k-stub.c: Convert to "bool".
|
||||
|
||||
@@ -37,8 +37,8 @@ void bsp_get_work_area(
|
||||
)
|
||||
{
|
||||
*work_area_start = _WorkspaceBase;
|
||||
*work_area_size = (unsigned long)_RamBase + (unsigned long) _RamSize -
|
||||
(unsigned long)_WorkspaceBase;
|
||||
*work_area_size = (uintptr_t)_RamBase + (uintptr_t) _RamSize -
|
||||
(uintptr_t)_WorkspaceBase;
|
||||
*heap_start = BSP_BOOTCARD_HEAP_USES_WORK_AREA;
|
||||
*heap_size = (size_t) _HeapSize;
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* This routine is an implementation of the bsp_pretasking_hook
|
||||
* that can be used by all m68k BSPs following linkcmds conventions
|
||||
* regarding heap, stack, and workspace allocation.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <bsp.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/libcsupport.h>
|
||||
|
||||
/*
|
||||
* Function: bsp_pretasking_hook
|
||||
* Created: 95/03/10
|
||||
*
|
||||
* Description:
|
||||
* BSP pretasking hook. Called just before drivers are initialized.
|
||||
* Used to setup libc and install any BSP extensions.
|
||||
*
|
||||
* NOTES:
|
||||
* Must not use libc (to do io) from here, since drivers are
|
||||
* not yet initialized.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
|
||||
extern void bsp_libc_init( void *, unsigned long, int );
|
||||
|
||||
extern char _RamBase[];
|
||||
extern char _WorkspaceBase[];
|
||||
extern char _HeapSize[];
|
||||
|
||||
unsigned long _M68k_Ramsize;
|
||||
#endif
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
#if !defined(BSP_BOOTCARD_HANDLES_RAM_ALLOCATION)
|
||||
void *heapStart;
|
||||
unsigned long heapSize = (unsigned long)_HeapSize;
|
||||
unsigned long ramSpace;
|
||||
|
||||
heapStart = (void *)
|
||||
((unsigned long)_WorkspaceBase + rtems_configuration_get_work_space_size());
|
||||
ramSpace = (unsigned long)_RamBase + _M68k_Ramsize - (unsigned long)heapStart;
|
||||
|
||||
/*
|
||||
* Can't use 'if(heapSize==0)' because the compiler "knows" that nothing
|
||||
* can have an address of 0 and proceeds to optimize-away the test.
|
||||
*/
|
||||
if (heapSize < 10)
|
||||
heapSize = ramSpace;
|
||||
else if (heapSize > ramSpace)
|
||||
rtems_fatal_error_occurred (('H'<<24) | ('E'<<16) | ('A'<<8) | 'P');
|
||||
|
||||
bsp_libc_init(heapStart, heapSize, 0);
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user