forked from Imagelibrary/rtems
All m68k BSPs now build with new ELF style linkcmds.
This commit is contained in:
@@ -120,9 +120,6 @@ extern "C" {
|
||||
|
||||
/* constants */
|
||||
|
||||
#define RAM_START 0
|
||||
#define RAM_END 0x100000
|
||||
|
||||
#define TIMER 0x0c000000
|
||||
#define TIMER_VECTOR 0x4D
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
vmeintr gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec vmeintr gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -39,32 +39,7 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern void *_HeapStart;
|
||||
extern rtems_unsigned32 HeapSize;
|
||||
|
||||
bsp_libc_init( &_HeapStart, HeapSize, 0 );
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
@@ -77,6 +52,7 @@ void bsp_start( void )
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
void *vbr;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* Monitor Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
@@ -118,8 +94,7 @@ void bsp_start( void )
|
||||
m68k_get_vbr( vbr );
|
||||
Cpu_table.interrupt_vector_table = vbr;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* Account for the console's resources
|
||||
|
||||
@@ -15,14 +15,17 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ram : org = 0x0, l = 1M
|
||||
}
|
||||
|
||||
_RamBase = 0;
|
||||
_RamSize = 1M;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
ram : {
|
||||
@@ -117,15 +120,10 @@ SECTIONS
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bsplibc bsppost bspstart bspclean bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bsplibc bsppost bspstart bspclean bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -38,43 +38,7 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
/* extern int end; */
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
|
||||
(rtems_unsigned32) BSP_Configuration.work_space_size;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
if (heap_start > (rtems_unsigned32) RAM_END) {
|
||||
/* rtems_fatal_error_occurred can not be used before initalization */
|
||||
RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
|
||||
RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r");
|
||||
}
|
||||
|
||||
bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
@@ -85,7 +49,7 @@ void bsp_pretasking_hook(void)
|
||||
void bsp_start( void )
|
||||
{
|
||||
void *vbr;
|
||||
extern unsigned int _WorkspaceBase;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* we only use a hook to get the C library initialized.
|
||||
@@ -97,12 +61,7 @@ void bsp_start( void )
|
||||
m68k_get_vbr( vbr );
|
||||
Cpu_table.interrupt_vector_table = vbr;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
|
||||
|
||||
#if 0
|
||||
(((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
|
||||
#endif
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
}
|
||||
|
||||
@@ -33,14 +33,17 @@ __DYNAMIC = 0;
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ram : ORIGIN = 0x80000, LENGTH = 512K
|
||||
}
|
||||
|
||||
_RamBase = 0x80000;
|
||||
_RamSize = 0x80000;
|
||||
|
||||
__end_of_ram = 0x100000;
|
||||
_copy_data_from_rom = 0;
|
||||
|
||||
@@ -135,22 +138,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ subdir = startup
|
||||
RTEMS_ROOT = @RTEMS_ROOT@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
VPATH = @srcdir@:@srcdir@/../../../shared
|
||||
VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd bootcard \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
m68kpretaskinghook main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -43,44 +43,8 @@ extern void breakpoint(void);
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
/* extern int end; */
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) BSP_Configuration.work_space_start +
|
||||
(rtems_unsigned32) BSP_Configuration.work_space_size;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
if (heap_start > (rtems_unsigned32) RAM_END) {
|
||||
/* rtems_fatal_error_occurred can not be used before initalization */
|
||||
RAW_PUTS("\n\rRTEMS: Out of memory.\n\r");
|
||||
RAW_PUTS("RTEMS: Check RAM_END and the size of the work space.\n\r");
|
||||
}
|
||||
|
||||
bsp_libc_init((void *) heap_start, (RAM_END - heap_start), 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
@@ -90,7 +54,7 @@ void bsp_pretasking_hook(void)
|
||||
void bsp_start( void )
|
||||
{
|
||||
void *vbr;
|
||||
extern unsigned int _WorkspaceBase;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
/* set_debug_traps(); */
|
||||
/* breakpoint(); */
|
||||
@@ -105,12 +69,7 @@ void bsp_start( void )
|
||||
m68k_get_vbr( vbr );
|
||||
Cpu_table.interrupt_vector_table = vbr;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
|
||||
|
||||
#if 0
|
||||
(((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
|
||||
#endif
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/* Clock_exit is done as an atexit() function */
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ MEMORY
|
||||
ram : ORIGIN = 0x203000, LENGTH = 256K
|
||||
}
|
||||
|
||||
_RamBase = 0x200000;
|
||||
_RamSize = 256K;
|
||||
|
||||
_VBR = 0x200000; /* location of the VBR table (in RAM) */
|
||||
__end_of_ram = 0x240000;
|
||||
_copy_data_from_rom = 0;
|
||||
@@ -49,8 +52,8 @@ _copy_data_from_rom = 0;
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
/*
|
||||
* stick everything in ram (of course)
|
||||
@@ -144,22 +147,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -39,37 +39,7 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
@@ -79,6 +49,7 @@ void bsp_pretasking_hook(void)
|
||||
|
||||
void bsp_start( void )
|
||||
{
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
@@ -97,8 +68,7 @@ void bsp_start( void )
|
||||
* not malloc'ed. It is just "pulled from the air".
|
||||
*/
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* initialize the CPU table for this BSP
|
||||
|
||||
@@ -17,14 +17,17 @@ MEMORY
|
||||
ram : org = 0x0000, l = 16M
|
||||
}
|
||||
|
||||
_RamBase = 0;
|
||||
_RamSize = 16M;
|
||||
|
||||
m302 = 0xf7f000;
|
||||
_VBR = 0x000000; /* location of the VBR table (in RAM) */
|
||||
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
@@ -114,22 +117,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -851,14 +851,6 @@ SYM(_mainDone):
|
||||
bra.l SYM(_mainDone) | Stuck forever
|
||||
|
||||
.align 2
|
||||
PUBLIC (_HeapSize)
|
||||
SYM (_HeapSize):
|
||||
.long HeapSize
|
||||
PUBLIC (_StackSize)
|
||||
SYM (_StackSize):
|
||||
.long StackSize
|
||||
END_CODE
|
||||
|
||||
BEGIN_DATA_DCL
|
||||
.align 2
|
||||
PUBLIC (environ)
|
||||
|
||||
@@ -476,13 +476,6 @@ SYM(_mainDone):
|
||||
bra.s SYM(_mainDone) | Stuck forever
|
||||
|
||||
.align 2
|
||||
PUBLIC (_HeapSize)
|
||||
SYM (_HeapSize):
|
||||
.long HeapSize
|
||||
PUBLIC (_StackSize)
|
||||
SYM (_StackSize):
|
||||
.long StackSize
|
||||
END_CODE
|
||||
|
||||
BEGIN_DATA_DCL
|
||||
.align 2
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard main sbrk \
|
||||
setvec dumpanic gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard \
|
||||
m68kpretaskinghook main sbrk setvec dumpanic gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -44,32 +44,7 @@ char *rtems_progname;
|
||||
*/
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern void *_HeapStart;
|
||||
extern rtems_unsigned32 _HeapSize;
|
||||
|
||||
bsp_libc_init(&_HeapStart, _HeapSize, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
|
||||
@@ -17,22 +17,18 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* a.out format doesn't handle prom images very well
|
||||
*/
|
||||
OUTPUT_FORMAT(coff-m68k)
|
||||
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
RamSize = DEFINED(RamSize) ? RamSize : 4M;
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x10000000;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
/*
|
||||
* Declare on-board memory.
|
||||
* It would be nice if the ram length could be given as
|
||||
* LENGTH=RamSize, but gld doesn't allow non-constant
|
||||
* LENGTH=_RamSize, but gld doesn't allow non-constant
|
||||
* values in the LENGTH expression.
|
||||
*/
|
||||
MEMORY {
|
||||
@@ -50,11 +46,6 @@ ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
|
||||
* Load objects
|
||||
*/
|
||||
SECTIONS {
|
||||
/*
|
||||
* Hardware variations
|
||||
*/
|
||||
_RamSize = RamSize;
|
||||
__RamSize = RamSize;
|
||||
|
||||
/*
|
||||
* Boot PROM
|
||||
@@ -68,8 +59,7 @@ SECTIONS {
|
||||
* Dynamic RAM
|
||||
*/
|
||||
ram : {
|
||||
_RamBase = .;
|
||||
__RamBase = .;
|
||||
. = .;
|
||||
} >ram
|
||||
|
||||
/*
|
||||
@@ -154,27 +144,20 @@ SECTIONS {
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
M68Kvec = .;
|
||||
_M68Kvec = .;
|
||||
. += (256 * 4);
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
M68Kvec = .;
|
||||
. += (256 * 4);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
|
||||
/*
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
/*
|
||||
* Declare on-board memory.
|
||||
@@ -120,8 +120,8 @@ SECTIONS {
|
||||
_end = .;
|
||||
|
||||
_HeapStart = .;
|
||||
. += HeapSize;
|
||||
. += StackSize;
|
||||
. += _HeapSize;
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
stack_init = .;
|
||||
clear_end = .;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
/*
|
||||
* Declare on-board memory.
|
||||
@@ -119,8 +119,8 @@ SECTIONS {
|
||||
_end = .;
|
||||
|
||||
_HeapStart = .;
|
||||
. += HeapSize;
|
||||
. += StackSize;
|
||||
. += _HeapSize;
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
stack_init = .;
|
||||
clear_end = .;
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -46,38 +46,8 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int _end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &_end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
/* Create 64 KByte memory region for RTEMS executive */
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
@@ -88,6 +58,7 @@ void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
duart_base = (unsigned char *)DUART_ADDR;
|
||||
|
||||
@@ -126,8 +97,7 @@ void bsp_start( void )
|
||||
Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/* led_putnum('e'); * for debugging purposes only */
|
||||
|
||||
|
||||
@@ -20,8 +20,10 @@ MEMORY
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x0;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 2M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
@@ -111,23 +113,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -40,37 +40,7 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
@@ -82,6 +52,7 @@ void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
@@ -109,7 +80,5 @@ void bsp_start( void )
|
||||
Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x0;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -111,23 +113,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -43,38 +43,8 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
@@ -85,6 +55,7 @@ void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
@@ -115,7 +86,5 @@ void bsp_start( void )
|
||||
Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x0;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -115,23 +117,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ VPATH = \
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \
|
||||
gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -43,37 +43,8 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
@@ -85,6 +56,7 @@ void bsp_start( void )
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
rtems_unsigned8 node_number;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */
|
||||
m68k_set_vbr( monitors_vector_table );
|
||||
@@ -174,7 +146,5 @@ void bsp_start( void )
|
||||
Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x0;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -115,23 +117,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
|
||||
setvec gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main page_table sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -47,36 +47,7 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
@@ -88,6 +59,7 @@ void bsp_start( void )
|
||||
{
|
||||
m68k_isr_entry *monitors_vector_table;
|
||||
int index;
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* 162Bug Vectors are at 0xFFE00000
|
||||
@@ -132,6 +104,5 @@ void bsp_start( void )
|
||||
Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,10 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x100000;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -118,23 +120,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
|
||||
-lc -lgcc --end-group \
|
||||
%{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
|
||||
elflinkcmds%s}}}
|
||||
linkcmds%s}}}
|
||||
|
||||
*startfile:
|
||||
%{!qrtems: %(old_startfile)} %{qrtems: \
|
||||
|
||||
@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
|
||||
PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \
|
||||
setvec gnatinstallhandler
|
||||
C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
|
||||
main page_table sbrk setvec gnatinstallhandler
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -48,48 +48,7 @@ rtems_cpu_table Cpu_table;
|
||||
*/
|
||||
void bsp_postdriver_hook( void );
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
|
||||
/*
|
||||
* bsp_pretasking_hook
|
||||
*
|
||||
* Called when RTEMS initialization is complete but before interrupts and
|
||||
* tasking are enabled. Used to setup libc and install any BSP extensions.
|
||||
*
|
||||
* Must not use libc (to do io) from here, since drivers are not yet
|
||||
* initialized.
|
||||
*
|
||||
* Installed in the rtems_cpu_table defined in
|
||||
* rtems/c/src/exec/score/cpu/m68k/cpu.h in main() below. Called from
|
||||
* rtems_initialize_executive() defined in rtems/c/src/exec/sapi/src/init.c
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* Return values: NONE
|
||||
*/
|
||||
void bsp_pretasking_hook( void )
|
||||
{
|
||||
/*
|
||||
* These are assigned addresses in the linkcmds file for the BSP. This
|
||||
* approach is better than having these defined as manifest constants and
|
||||
* compiled into the kernel, but it is still not ideal when dealing with
|
||||
* multiprocessor configuration in which each board as a different memory
|
||||
* map. A better place for defining these symbols might be the makefiles.
|
||||
* Consideration should also be given to developing an approach in which
|
||||
* the kernel and the application can be linked and burned into ROM
|
||||
* independently of each other.
|
||||
*/
|
||||
extern unsigned char _HeapStart, _HeapEnd;
|
||||
|
||||
bsp_libc_init(&_HeapStart, &_HeapEnd - &_HeapStart, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* bsp_start()
|
||||
@@ -122,6 +81,7 @@ void bsp_start( void )
|
||||
{
|
||||
extern void *_WorkspaceBase;
|
||||
extern m68k_isr_entry M68Kvec[];
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
void M68KFPSPInstallExceptionHandlers (void);
|
||||
|
||||
|
||||
@@ -21,20 +21,11 @@ OUTPUT_FORMAT("elf32-m68k")
|
||||
OUTPUT_ARCH(m68k)
|
||||
ENTRY(_start)
|
||||
|
||||
/* Base address and size of RAM on the MVME167 */
|
||||
|
||||
RAM_SIZE = 4M;
|
||||
RAM_START = 0x00800000;
|
||||
RAM_END = RAM_START + RAM_SIZE;
|
||||
|
||||
/*
|
||||
* Declare some sizes.
|
||||
* XXX: The assignment of ". += XyzSize;" fails in older gld's if the
|
||||
* number used there is not constant. If this happens to you, edit
|
||||
* the lines marked XXX below to use a constant value.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -170,9 +161,9 @@ SECTIONS
|
||||
. += HeapSize; /* XXX -- Old gld can't handle this */
|
||||
_HeapEnd = .;
|
||||
_StackStart = .;
|
||||
. += StackSize; /* XXX -- Old gld can't handle this */
|
||||
. += _StackSize; /* XXX -- Old gld can't handle this */
|
||||
/* . += 0x10000; */ /* HeapSize for old gld */
|
||||
/* . += 0x1000; */ /* StackSize for old gld */
|
||||
/* . += 0x1000; */ /* _StackSize for old gld */
|
||||
. = ALIGN (16);
|
||||
_StackEnd = .;
|
||||
stack_init = .;
|
||||
|
||||
@@ -21,17 +21,13 @@
|
||||
OUTPUT_ARCH(m68k)
|
||||
ENTRY(_start)
|
||||
|
||||
/* Base address and size of RAM on the MVME167 */
|
||||
|
||||
RAM_SIZE = 4M;
|
||||
RAM_START = 0x00800000;
|
||||
RAM_END = RAM_START + RAM_SIZE;
|
||||
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x00800000;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
@@ -132,22 +128,17 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
PROVIDE (_clear_end = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
@@ -47,22 +47,17 @@ start:
|
||||
|
|
||||
|
||||
zerobss:
|
||||
moveal #end,%a0 | find end of .bss
|
||||
moveal #bss_start,%a1 | find beginning of .bss
|
||||
moveal #_clear_end,%a0 | find end of .bss
|
||||
moveal #_clear_start,%a1 | find beginning of .bss
|
||||
moveq #0,%d0
|
||||
|
||||
zerobss_loop:
|
||||
|
||||
movel %d0,%a1@+ | to zero out uninitialized
|
||||
cmpal %a0,%a1
|
||||
jlt zerobss_loop | loop until _end reached
|
||||
jlt zerobss_loop | loop until end reached
|
||||
|
||||
movel #end,%d0 | d0 = end of bss/start of heap
|
||||
addl #heap_size,%d0 | d0 = end of heap
|
||||
|
||||
movel %d0,stack_start | Save for brk() routine
|
||||
addl #stack_size,%d0 | make room for stack
|
||||
andl #0xffffffc0,%d0 | align it on 16 byte boundary
|
||||
movel %d0,_stack_init | load stack top
|
||||
|
||||
movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
|
||||
movel %d0,%a7 | set master stack pointer
|
||||
@@ -81,11 +76,6 @@ zerobss_loop:
|
||||
start_frame:
|
||||
.space 4,0
|
||||
|
||||
.global stack_start
|
||||
|
||||
stack_start:
|
||||
.space 4,0
|
||||
|
||||
|
|
||||
| Uninitialised data
|
||||
|
|
||||
|
||||
@@ -453,8 +453,8 @@ copy_data_loop:
|
||||
|
|
||||
|
||||
zerobss:
|
||||
moveal #end,%a0 | find end of .bss
|
||||
moveal #_bss_start,%a1 | find beginning of .bss
|
||||
moveal #_clear_end,%a0 | find end of .bss
|
||||
moveal #_clear_start,%a1 | find beginning of .bss
|
||||
moveq #0,%d0
|
||||
|
||||
zerobss_loop:
|
||||
@@ -463,12 +463,7 @@ zerobss_loop:
|
||||
cmpal %a0,%a1
|
||||
jlt zerobss_loop | loop until _end reached
|
||||
|
||||
movel #end,%d0 | d0 = end of bss/start of heap
|
||||
addl #heap_size,%d0 | d0 = end of heap
|
||||
|
||||
movel %d0,stack_start | Save for brk() routine
|
||||
addl #stack_size,%d0 | make room for stack
|
||||
andl #0xffffffc0,%d0 | align it on 16 byte boundary
|
||||
movel %d0,_stack_init | load stack top
|
||||
|
||||
movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
|
||||
movel %d0,%a7 | set master stack pointer
|
||||
|
||||
@@ -17,8 +17,8 @@ PGM = ${ARCH}/startup.rel
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \
|
||||
memcheck trace gnatinstallhandler bsplibc bsppost bspstart bspclean sbrk \
|
||||
setvec
|
||||
m68kpretaskinghook memcheck trace gnatinstallhandler bsplibc \
|
||||
bsppost bspstart bspclean sbrk setvec
|
||||
C_FILES = $(C_PIECES:%=%.c)
|
||||
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -40,37 +40,8 @@ char *rtems_progname;
|
||||
|
||||
void bsp_postdriver_hook(void);
|
||||
void bsp_libc_init( void *, unsigned32, int );
|
||||
void bsp_pretasking_hook(void); /* m68k version */
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
|
||||
heap_start = (rtems_unsigned32) &end;
|
||||
if (heap_start & (CPU_ALIGNMENT-1))
|
||||
heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
|
||||
|
||||
bsp_libc_init((void *) heap_start, 64 * 1024, 0);
|
||||
|
||||
#ifdef RTEMS_DEBUG
|
||||
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* bsp_start
|
||||
*
|
||||
@@ -79,13 +50,8 @@ void bsp_pretasking_hook(void)
|
||||
|
||||
void bsp_start( void )
|
||||
{
|
||||
/*
|
||||
* Allocate the memory for the RTEMS Work Space. This can come from
|
||||
* a variety of places: hard coded address, malloc'ed from outside
|
||||
* RTEMS world (e.g. simulator or primitive memory manager), or (as
|
||||
* typically done by stock BSPs) by subtracting the required amount
|
||||
* of work space from the last physical address on the CPU board.
|
||||
*/
|
||||
extern void *_WorkspaceBase;
|
||||
|
||||
#if 0
|
||||
Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
|
||||
#endif
|
||||
@@ -96,8 +62,7 @@ void bsp_start( void )
|
||||
* not malloc'ed. It is just "pulled from the air".
|
||||
*/
|
||||
|
||||
BSP_Configuration.work_space_start = (void *)
|
||||
(RAM_END - BSP_Configuration.work_space_size);
|
||||
BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
|
||||
|
||||
/*
|
||||
* initialize the CPU table for this BSP
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
/*
|
||||
* Declare some sizes.
|
||||
*/
|
||||
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
|
||||
StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
|
||||
_RamBase = 0x0;
|
||||
_RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
|
||||
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
|
||||
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
|
||||
|
||||
/*
|
||||
* Declare on-board memory.
|
||||
@@ -113,24 +115,18 @@ SECTIONS
|
||||
PROVIDE (_copy_end = .);
|
||||
} >ram
|
||||
.bss : {
|
||||
PROVIDE (_bss_start = .);
|
||||
PROVIDE (_clear_start = .);
|
||||
_clear_start = .;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN (16);
|
||||
PROVIDE (end = .);
|
||||
|
||||
. += StackSize;
|
||||
PROVIDE (_stack_init = .);
|
||||
|
||||
. += _StackSize;
|
||||
. = ALIGN (16);
|
||||
PROVIDE (_HeapStart = .);
|
||||
. += HeapSize;
|
||||
PROVIDE (_HeapEnd = .);
|
||||
_stack_init = .;
|
||||
_clear_end = .;
|
||||
|
||||
PROVIDE (_clear_end = .);
|
||||
|
||||
PROVIDE (_WorkspaceBase = .);
|
||||
_WorkspaceBase = .;
|
||||
} >ram
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ loop: movel #0,a1@+ | to zero out uninitialized
|
||||
jlt loop | loop until _end reached
|
||||
|
||||
movel # SYM (_stack_init),d0 | d0 = stop of stack
|
||||
andl #0xffffffc0,d0 | align it on 16 byte boundary
|
||||
movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
|
||||
movel d0,a7 | set master stack pointer
|
||||
movel d0,a6 | set base pointer
|
||||
|
||||
Reference in New Issue
Block a user