All m68k BSPs now build with new ELF style linkcmds.

This commit is contained in:
Joel Sherrill
2000-01-13 20:45:07 +00:00
parent 11944b9bc3
commit b8c9883755
46 changed files with 192 additions and 681 deletions

View File

@@ -120,9 +120,6 @@ extern "C" {
/* constants */ /* constants */
#define RAM_START 0
#define RAM_END 0x100000
#define TIMER 0x0c000000 #define TIMER 0x0c000000
#define TIMER_VECTOR 0x4D #define TIMER_VECTOR 0x4D

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
vmeintr gnatinstallhandler main sbrk setvec vmeintr gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -39,32 +39,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 void *_HeapStart;
extern rtems_unsigned32 HeapSize;
bsp_libc_init( &_HeapStart, HeapSize, 0 );
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
/* /*
* bsp_start * bsp_start
@@ -77,6 +52,7 @@ void bsp_start( void )
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
void *vbr; void *vbr;
extern void *_WorkspaceBase;
monitors_vector_table = (m68k_isr_entry *)0; /* Monitor Vectors are at 0 */ monitors_vector_table = (m68k_isr_entry *)0; /* Monitor Vectors are at 0 */
m68k_set_vbr( monitors_vector_table ); m68k_set_vbr( monitors_vector_table );
@@ -118,8 +94,7 @@ void bsp_start( void )
m68k_get_vbr( vbr ); m68k_get_vbr( vbr );
Cpu_table.interrupt_vector_table = vbr; Cpu_table.interrupt_vector_table = vbr;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
/* /*
* Account for the console's resources * Account for the console's resources

View File

@@ -15,14 +15,17 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
ram : org = 0x0, l = 1M ram : org = 0x0, l = 1M
} }
_RamBase = 0;
_RamSize = 1M;
SECTIONS SECTIONS
{ {
ram : { ram : {
@@ -117,15 +120,10 @@ SECTIONS
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .);
_WorkspaceBase = .; _WorkspaceBase = .;
} >ram } >ram

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bsplibc bsppost bspstart bspclean bootcard main sbrk setvec \ C_PIECES = bsplibc bsppost bspstart bspclean bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -38,43 +38,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -85,7 +49,7 @@ void bsp_pretasking_hook(void)
void bsp_start( void ) void bsp_start( void )
{ {
void *vbr; void *vbr;
extern unsigned int _WorkspaceBase; extern void *_WorkspaceBase;
/* /*
* we only use a hook to get the C library initialized. * we only use a hook to get the C library initialized.
@@ -97,12 +61,7 @@ void bsp_start( void )
m68k_get_vbr( vbr ); m68k_get_vbr( vbr );
Cpu_table.interrupt_vector_table = vbr; Cpu_table.interrupt_vector_table = vbr;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
#if 0
(((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
#endif
/* Clock_exit is done as an atexit() function */ /* Clock_exit is done as an atexit() function */
} }

View File

@@ -33,14 +33,17 @@ __DYNAMIC = 0;
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
ram : ORIGIN = 0x80000, LENGTH = 512K ram : ORIGIN = 0x80000, LENGTH = 512K
} }
_RamBase = 0x80000;
_RamSize = 0x80000;
__end_of_ram = 0x100000; __end_of_ram = 0x100000;
_copy_data_from_rom = 0; _copy_data_from_rom = 0;
@@ -135,22 +138,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_clear_start = .); _clear_start = .;
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -11,13 +11,13 @@ subdir = startup
RTEMS_ROOT = @RTEMS_ROOT@ RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@ PROJECT_ROOT = @PROJECT_ROOT@
VPATH = @srcdir@:@srcdir@/../../../shared VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bsplibc bsppost bspstart bspclean efi68k_tcp efi68k_wd bootcard \ 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_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -43,43 +43,7 @@ extern void breakpoint(void);
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -90,7 +54,7 @@ void bsp_pretasking_hook(void)
void bsp_start( void ) void bsp_start( void )
{ {
void *vbr; void *vbr;
extern unsigned int _WorkspaceBase; extern void *_WorkspaceBase;
/* set_debug_traps(); */ /* set_debug_traps(); */
/* breakpoint(); */ /* breakpoint(); */
@@ -105,12 +69,7 @@ void bsp_start( void )
m68k_get_vbr( vbr ); m68k_get_vbr( vbr );
Cpu_table.interrupt_vector_table = vbr; Cpu_table.interrupt_vector_table = vbr;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(((unsigned int)_WorkspaceBase + STACK_SIZE + 0x100) & 0xffffff00);
#if 0
(((unsigned int)_end + STACK_SIZE + 0x100) & 0xffffff00);
#endif
/* Clock_exit is done as an atexit() function */ /* Clock_exit is done as an atexit() function */
} }

View File

@@ -42,6 +42,9 @@ MEMORY
ram : ORIGIN = 0x203000, LENGTH = 256K ram : ORIGIN = 0x203000, LENGTH = 256K
} }
_RamBase = 0x200000;
_RamSize = 256K;
_VBR = 0x200000; /* location of the VBR table (in RAM) */ _VBR = 0x200000; /* location of the VBR table (in RAM) */
__end_of_ram = 0x240000; __end_of_ram = 0x240000;
_copy_data_from_rom = 0; _copy_data_from_rom = 0;
@@ -49,8 +52,8 @@ _copy_data_from_rom = 0;
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
/* /*
* stick everything in ram (of course) * stick everything in ram (of course)
@@ -144,22 +147,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_clear_start = .); _clear_start = .;
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -39,37 +39,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -79,6 +49,7 @@ void bsp_pretasking_hook(void)
void bsp_start( void ) void bsp_start( void )
{ {
extern void *_WorkspaceBase;
/* /*
* Allocate the memory for the RTEMS Work Space. This can come from * 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". * not malloc'ed. It is just "pulled from the air".
*/ */
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
/* /*
* initialize the CPU table for this BSP * initialize the CPU table for this BSP

View File

@@ -17,14 +17,17 @@ MEMORY
ram : org = 0x0000, l = 16M ram : org = 0x0000, l = 16M
} }
_RamBase = 0;
_RamSize = 16M;
m302 = 0xf7f000; m302 = 0xf7f000;
_VBR = 0x000000; /* location of the VBR table (in RAM) */ _VBR = 0x000000; /* location of the VBR table (in RAM) */
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
SECTIONS SECTIONS
{ {
@@ -114,22 +117,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_clear_start = .); _clear_start = .;
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -851,14 +851,6 @@ SYM(_mainDone):
bra.l SYM(_mainDone) | Stuck forever bra.l SYM(_mainDone) | Stuck forever
.align 2 .align 2
PUBLIC (_HeapSize)
SYM (_HeapSize):
.long HeapSize
PUBLIC (_StackSize)
SYM (_StackSize):
.long StackSize
END_CODE
BEGIN_DATA_DCL BEGIN_DATA_DCL
.align 2 .align 2
PUBLIC (environ) PUBLIC (environ)

View File

@@ -476,13 +476,6 @@ SYM(_mainDone):
bra.s SYM(_mainDone) | Stuck forever bra.s SYM(_mainDone) | Stuck forever
.align 2 .align 2
PUBLIC (_HeapSize)
SYM (_HeapSize):
.long HeapSize
PUBLIC (_StackSize)
SYM (_StackSize):
.long StackSize
END_CODE
BEGIN_DATA_DCL BEGIN_DATA_DCL
.align 2 .align 2

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard main sbrk \ C_PIECES = bspclean bsplibc bsppost bspstart init68340 bootcard \
setvec dumpanic gnatinstallhandler m68kpretaskinghook main sbrk setvec dumpanic gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -44,32 +44,7 @@ char *rtems_progname;
*/ */
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 void *_HeapStart;
extern rtems_unsigned32 _HeapSize;
bsp_libc_init(&_HeapStart, _HeapSize, 0);
#ifdef RTEMS_DEBUG
rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
#endif
}
/* /*
* bsp_start * bsp_start

View File

@@ -17,22 +17,18 @@
* $Id$ * $Id$
*/ */
/*
* a.out format doesn't handle prom images very well
*/
OUTPUT_FORMAT(coff-m68k)
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
RamSize = DEFINED(RamSize) ? RamSize : 4M; _RamBase = 0x10000000;
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
* It would be nice if the ram length could be given as * 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. * values in the LENGTH expression.
*/ */
MEMORY { MEMORY {
@@ -50,11 +46,6 @@ ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
* Load objects * Load objects
*/ */
SECTIONS { SECTIONS {
/*
* Hardware variations
*/
_RamSize = RamSize;
__RamSize = RamSize;
/* /*
* Boot PROM * Boot PROM
@@ -68,8 +59,7 @@ SECTIONS {
* Dynamic RAM * Dynamic RAM
*/ */
ram : { ram : {
_RamBase = .; . = .;
__RamBase = .;
} >ram } >ram
/* /*
@@ -155,26 +145,19 @@ SECTIONS {
} >ram } >ram
.bss : { .bss : {
M68Kvec = .; M68Kvec = .;
_M68Kvec = .;
. += (256 * 4); . += (256 * 4);
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
/* /*

View File

@@ -18,8 +18,8 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
@@ -120,8 +120,8 @@ SECTIONS {
_end = .; _end = .;
_HeapStart = .; _HeapStart = .;
. += HeapSize; . += _HeapSize;
. += StackSize; . += _StackSize;
. = ALIGN (16); . = ALIGN (16);
stack_init = .; stack_init = .;
clear_end = .; clear_end = .;

View File

@@ -18,8 +18,8 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
@@ -119,8 +119,8 @@ SECTIONS {
_end = .; _end = .;
_HeapStart = .; _HeapStart = .;
. += HeapSize; . += _HeapSize;
. += StackSize; . += _StackSize;
. = ALIGN (16); . = ALIGN (16);
stack_init = .; stack_init = .;
clear_end = .; clear_end = .;

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -46,37 +46,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -88,6 +58,7 @@ void bsp_start( void )
{ {
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
extern void *_WorkspaceBase;
duart_base = (unsigned char *)DUART_ADDR; 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_vector_table = (m68k_isr_entry *) &M68Kvec;
Cpu_table.interrupt_stack_size = 4096; Cpu_table.interrupt_stack_size = 4096;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
/* led_putnum('e'); * for debugging purposes only */ /* led_putnum('e'); * for debugging purposes only */

View File

@@ -20,8 +20,10 @@ MEMORY
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x0;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 2M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
SECTIONS SECTIONS
{ {
@@ -111,23 +113,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -40,37 +40,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -82,6 +52,7 @@ void bsp_start( void )
{ {
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
extern void *_WorkspaceBase;
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */ monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
m68k_set_vbr( monitors_vector_table ); 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_vector_table = (m68k_isr_entry *) &M68Kvec;
Cpu_table.interrupt_stack_size = 4096; Cpu_table.interrupt_stack_size = 4096;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
} }

View File

@@ -15,8 +15,10 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x0;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -111,23 +113,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -43,37 +43,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -85,6 +55,7 @@ void bsp_start( void )
{ {
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
extern void *_WorkspaceBase;
monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */ monitors_vector_table = (m68k_isr_entry *)0; /* 135Bug Vectors are at 0 */
m68k_set_vbr( monitors_vector_table ); 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_vector_table = (m68k_isr_entry *) &M68Kvec;
Cpu_table.interrupt_stack_size = 4096; Cpu_table.interrupt_stack_size = 4096;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
} }

View File

@@ -19,8 +19,10 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x0;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -115,23 +117,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -17,8 +17,8 @@ VPATH = \
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main sbrk setvec \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
gnatinstallhandler main sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -43,36 +43,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -85,6 +56,7 @@ void bsp_start( void )
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
rtems_unsigned8 node_number; rtems_unsigned8 node_number;
extern void *_WorkspaceBase;
monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */ monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */
m68k_set_vbr( monitors_vector_table ); 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_vector_table = (m68k_isr_entry *) &M68Kvec;
Cpu_table.interrupt_stack_size = 4096; Cpu_table.interrupt_stack_size = 4096;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
} }

View File

@@ -19,8 +19,10 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x0;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -115,23 +117,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
setvec gnatinstallhandler main page_table sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -47,36 +47,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -88,6 +59,7 @@ void bsp_start( void )
{ {
m68k_isr_entry *monitors_vector_table; m68k_isr_entry *monitors_vector_table;
int index; int index;
extern void *_WorkspaceBase;
/* /*
* 162Bug Vectors are at 0xFFE00000 * 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_vector_table = (m68k_isr_entry *) &M68Kvec;
Cpu_table.interrupt_stack_size = 4096; Cpu_table.interrupt_stack_size = 4096;
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
} }

View File

@@ -22,8 +22,10 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x100000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -118,23 +120,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -15,7 +15,7 @@
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \ %{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
-lc -lgcc --end-group \ -lc -lgcc --end-group \
%{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T %{!qelf: %{!qnolinkcmds: -T linkcmds%s}} %{qelf: %{!qnolinkcmd: -T
elflinkcmds%s}}} linkcmds%s}}}
*startfile: *startfile:
%{!qrtems: %(old_startfile)} %{qrtems: \ %{!qrtems: %(old_startfile)} %{qrtems: \

View File

@@ -16,8 +16,8 @@ VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
PGM = ${ARCH}/startup.rel PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = bspclean bsplibc bsppost bspstart bootcard main page_table sbrk \ C_PIECES = bspclean bsplibc bsppost bspstart bootcard m68kpretaskinghook \
setvec gnatinstallhandler main page_table sbrk setvec gnatinstallhandler
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -48,48 +48,7 @@ rtems_cpu_table Cpu_table;
*/ */
void bsp_postdriver_hook( void ); void bsp_postdriver_hook( void );
void bsp_libc_init( void *, unsigned32, int ); void bsp_libc_init( void *, unsigned32, int );
void bsp_pretasking_hook(void); /* m68k version */
/*
* 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
}
/* /*
* bsp_start() * bsp_start()
@@ -122,6 +81,7 @@ void bsp_start( void )
{ {
extern void *_WorkspaceBase; extern void *_WorkspaceBase;
extern m68k_isr_entry M68Kvec[]; extern m68k_isr_entry M68Kvec[];
extern void *_WorkspaceBase;
void M68KFPSPInstallExceptionHandlers (void); void M68KFPSPInstallExceptionHandlers (void);

View File

@@ -21,20 +21,11 @@ OUTPUT_FORMAT("elf32-m68k")
OUTPUT_ARCH(m68k) OUTPUT_ARCH(m68k)
ENTRY(_start) 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. * 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; _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -170,9 +161,9 @@ SECTIONS
. += HeapSize; /* XXX -- Old gld can't handle this */ . += HeapSize; /* XXX -- Old gld can't handle this */
_HeapEnd = .; _HeapEnd = .;
_StackStart = .; _StackStart = .;
. += StackSize; /* XXX -- Old gld can't handle this */ . += _StackSize; /* XXX -- Old gld can't handle this */
/* . += 0x10000; */ /* HeapSize for old gld */ /* . += 0x10000; */ /* HeapSize for old gld */
/* . += 0x1000; */ /* StackSize for old gld */ /* . += 0x1000; */ /* _StackSize for old gld */
. = ALIGN (16); . = ALIGN (16);
_StackEnd = .; _StackEnd = .;
stack_init = .; stack_init = .;

View File

@@ -21,17 +21,13 @@
OUTPUT_ARCH(m68k) OUTPUT_ARCH(m68k)
ENTRY(_start) 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. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x00800000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY MEMORY
{ {
@@ -132,22 +128,17 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .);
PROVIDE (_WorkspaceBase = .); _WorkspaceBase = .;
} >ram } >ram
} }

View File

@@ -47,22 +47,17 @@ start:
| |
zerobss: zerobss:
moveal #end,%a0 | find end of .bss moveal #_clear_end,%a0 | find end of .bss
moveal #bss_start,%a1 | find beginning of .bss moveal #_clear_start,%a1 | find beginning of .bss
moveq #0,%d0 moveq #0,%d0
zerobss_loop: zerobss_loop:
movel %d0,%a1@+ | to zero out uninitialized movel %d0,%a1@+ | to zero out uninitialized
cmpal %a0,%a1 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 movel %d0,_stack_init | load stack top
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
movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
movel %d0,%a7 | set master stack pointer movel %d0,%a7 | set master stack pointer
@@ -81,11 +76,6 @@ zerobss_loop:
start_frame: start_frame:
.space 4,0 .space 4,0
.global stack_start
stack_start:
.space 4,0
| |
| Uninitialised data | Uninitialised data
| |

View File

@@ -453,8 +453,8 @@ copy_data_loop:
| |
zerobss: zerobss:
moveal #end,%a0 | find end of .bss moveal #_clear_end,%a0 | find end of .bss
moveal #_bss_start,%a1 | find beginning of .bss moveal #_clear_start,%a1 | find beginning of .bss
moveq #0,%d0 moveq #0,%d0
zerobss_loop: zerobss_loop:
@@ -463,12 +463,7 @@ zerobss_loop:
cmpal %a0,%a1 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 movel %d0,_stack_init | load stack top
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
movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!!
movel %d0,%a7 | set master stack pointer movel %d0,%a7 | set master stack pointer

View File

@@ -17,8 +17,8 @@ PGM = ${ARCH}/startup.rel
# C source names, if any, go here -- minus the .c # C source names, if any, go here -- minus the .c
C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \ C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \
memcheck trace gnatinstallhandler bsplibc bsppost bspstart bspclean sbrk \ m68kpretaskinghook memcheck trace gnatinstallhandler bsplibc \
setvec bsppost bspstart bspclean sbrk setvec
C_FILES = $(C_PIECES:%=%.c) C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

View File

@@ -40,36 +40,7 @@ char *rtems_progname;
void bsp_postdriver_hook(void); void bsp_postdriver_hook(void);
void bsp_libc_init( void *, unsigned32, int ); 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 * bsp_start
@@ -79,13 +50,8 @@ void bsp_pretasking_hook(void)
void bsp_start( void ) void bsp_start( void )
{ {
/* extern void *_WorkspaceBase;
* 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.
*/
#if 0 #if 0
Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/; Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/;
#endif #endif
@@ -96,8 +62,7 @@ void bsp_start( void )
* not malloc'ed. It is just "pulled from the air". * not malloc'ed. It is just "pulled from the air".
*/ */
BSP_Configuration.work_space_start = (void *) BSP_Configuration.work_space_start = (void *) &_WorkspaceBase;
(RAM_END - BSP_Configuration.work_space_size);
/* /*
* initialize the CPU table for this BSP * initialize the CPU table for this BSP

View File

@@ -8,8 +8,10 @@
/* /*
* Declare some sizes. * Declare some sizes.
*/ */
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; _RamBase = 0x0;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; _RamSize = DEFINED(_RamSize) ? _RamSize : 1M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
@@ -113,24 +115,18 @@ SECTIONS
PROVIDE (_copy_end = .); PROVIDE (_copy_end = .);
} >ram } >ram
.bss : { .bss : {
PROVIDE (_bss_start = .); _clear_start = .;
PROVIDE (_clear_start = .);
*(.bss) *(.bss)
*(COMMON) *(COMMON)
. = ALIGN (16); . = ALIGN (16);
PROVIDE (end = .); PROVIDE (end = .);
. += StackSize; . += _StackSize;
PROVIDE (_stack_init = .);
. = ALIGN (16); . = ALIGN (16);
PROVIDE (_HeapStart = .); _stack_init = .;
. += HeapSize; _clear_end = .;
PROVIDE (_HeapEnd = .);
PROVIDE (_clear_end = .); _WorkspaceBase = .;
PROVIDE (_WorkspaceBase = .);
} >ram } >ram
} }

View File

@@ -77,7 +77,6 @@ loop: movel #0,a1@+ | to zero out uninitialized
jlt loop | loop until _end reached jlt loop | loop until _end reached
movel # SYM (_stack_init),d0 | d0 = stop of stack 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!!! movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!!
movel d0,a7 | set master stack pointer movel d0,a7 | set master stack pointer
movel d0,a6 | set base pointer movel d0,a6 | set base pointer