From b8c98837559029b807fc80b54d170b2c3184df1f Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 13 Jan 2000 20:45:07 +0000 Subject: All m68k BSPs now build with new ELF style linkcmds. --- c/src/lib/libbsp/m68k/dmv152/include/bsp.h | 3 -- c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c | 31 ++------------ c/src/lib/libbsp/m68k/dmv152/startup/linkcmds | 18 ++++----- c/src/lib/libbsp/m68k/efi332/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/efi332/startup/bspstart.c | 47 ++-------------------- c/src/lib/libbsp/m68k/efi332/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c | 47 ++-------------------- c/src/lib/libbsp/m68k/efi68k/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c | 36 ++--------------- c/src/lib/libbsp/m68k/gen68302/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/gen68340/start/start.S | 8 ---- .../libbsp/m68k/gen68340/start/startfor340only.S | 7 ---- c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c | 27 +------------ c/src/lib/libbsp/m68k/gen68340/startup/linkcmds | 43 ++++++-------------- .../libbsp/m68k/gen68360/startup/linkcmds.bootp | 8 ++-- .../lib/libbsp/m68k/gen68360/startup/linkcmds.prom | 8 ++-- c/src/lib/libbsp/m68k/idp/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/idp/startup/bspstart.c | 36 ++--------------- c/src/lib/libbsp/m68k/idp/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c | 37 ++--------------- c/src/lib/libbsp/m68k/mvme136/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c | 37 ++--------------- c/src/lib/libbsp/m68k/mvme147/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c | 36 ++--------------- c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c | 35 ++-------------- c/src/lib/libbsp/m68k/mvme162/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/mvme167/bsp_specs | 2 +- c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c | 44 +------------------- c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds | 17 ++------ c/src/lib/libbsp/m68k/mvme167/startup/linkcmds | 27 +++++-------- c/src/lib/libbsp/m68k/ods68302/start/debugreset.S | 18 ++------- c/src/lib/libbsp/m68k/ods68302/start/reset.S | 11 ++--- c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c | 43 ++------------------ c/src/lib/libbsp/m68k/ods68302/startup/linkcmds | 22 +++++----- c/src/lib/libbsp/m68k/shared/start.S | 1 - 46 files changed, 192 insertions(+), 681 deletions(-) (limited to 'c/src/lib/libbsp') diff --git a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h b/c/src/lib/libbsp/m68k/dmv152/include/bsp.h index 59d91c4537..20b711b461 100644 --- a/c/src/lib/libbsp/m68k/dmv152/include/bsp.h +++ b/c/src/lib/libbsp/m68k/dmv152/include/bsp.h @@ -120,9 +120,6 @@ extern "C" { /* constants */ -#define RAM_START 0 -#define RAM_END 0x100000 - #define TIMER 0x0c000000 #define TIMER_VECTOR 0x4D diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in b/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in index ad1bdae884..43f6192b6d 100644 --- a/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/dmv152/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c index 25e9d86629..90f171ef0a 100644 --- a/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/dmv152/startup/bspstart.c @@ -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 diff --git a/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds b/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds index 2e6ec77838..7f92758e77 100644 --- a/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/dmv152/startup/linkcmds @@ -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 diff --git a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in index af4a634cc6..6bdd69c9d3 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/efi332/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c index 23651d0736..765b26c902 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi332/startup/bspstart.c @@ -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 */ } diff --git a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds b/c/src/lib/libbsp/m68k/efi332/startup/linkcmds index 85038ff746..6ac7ee77a4 100644 --- a/c/src/lib/libbsp/m68k/efi332/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/efi332/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in index 0bc870292c..5772b2b474 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/efi68k/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c index fdc19d1c58..180f3db116 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c @@ -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 */ } diff --git a/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds b/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds index 775c84d955..c174c3f4c8 100644 --- a/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in index f4ce788577..a4ed3ac474 100644 --- a/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/gen68302/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c index ac7666d1bd..a33ef2bbf8 100644 --- a/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/gen68302/startup/bspstart.c @@ -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 diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds index 2fd0352112..99d0f27cac 100644 --- a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/gen68340/start/start.S b/c/src/lib/libbsp/m68k/gen68340/start/start.S index 3569118a8b..471cf7ab68 100644 --- a/c/src/lib/libbsp/m68k/gen68340/start/start.S +++ b/c/src/lib/libbsp/m68k/gen68340/start/start.S @@ -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) diff --git a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S b/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S index 37cd6feb29..5c9572b0fd 100644 --- a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S +++ b/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.S @@ -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 diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in index 2ec8e02d72..bdba0774e6 100644 --- a/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/gen68340/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c b/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c index 2b65db460a..23f5a13bf5 100644 --- a/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/gen68340/startup/bspstart.c @@ -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 diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds index 0a716924c1..297579ce25 100644 --- a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram /* diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp index ff49004bc7..9b247306b2 100644 --- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp +++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp @@ -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 = .; diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom index 0903e00e4a..f88fc609fe 100644 --- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom +++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom @@ -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 = .; diff --git a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in b/c/src/lib/libbsp/m68k/idp/startup/Makefile.in index f4ce788577..a4ed3ac474 100644 --- a/c/src/lib/libbsp/m68k/idp/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/idp/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c index d67cb92225..877fd1d053 100644 --- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c @@ -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 */ diff --git a/c/src/lib/libbsp/m68k/idp/startup/linkcmds b/c/src/lib/libbsp/m68k/idp/startup/linkcmds index d676f6589d..9eadcedcda 100644 --- a/c/src/lib/libbsp/m68k/idp/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/idp/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in index aaba9f37c7..d4cb66a349 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme136/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c index c305787f13..79089b356c 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme136/startup/bspstart.c @@ -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; } diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds index 486b188387..67101dcd32 100644 --- a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in index aaba9f37c7..d4cb66a349 100644 --- a/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme147/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c index 1d0d945bc6..99fc20928d 100644 --- a/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme147/startup/bspstart.c @@ -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; } diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds index 234232c4fc..c40af97d9d 100644 --- a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in index 2f19a31294..536bb97884 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme147s/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c index 4f63bc60d9..aa1b6c61ca 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c @@ -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; } diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds index 773781321a..e752b5b33e 100644 --- a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in index bf6460c72b..c3ffcc00cd 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme162/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c index 83d9c2e754..bd66195bc8 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme162/startup/bspstart.c @@ -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; } diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds index e51d8196f0..8f8c639790 100644 --- a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/mvme167/bsp_specs b/c/src/lib/libbsp/m68k/mvme167/bsp_specs index 615f7c8b44..7ece396fb5 100644 --- a/c/src/lib/libbsp/m68k/mvme167/bsp_specs +++ b/c/src/lib/libbsp/m68k/mvme167/bsp_specs @@ -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: \ diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in b/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in index cfbb545914..db71259ef4 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c index 559463e4a5..f443a48153 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c @@ -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); diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds b/c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds index 927d5b932a..3aa5a9d279 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds +++ b/c/src/lib/libbsp/m68k/mvme167/startup/elflinkcmds @@ -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 = .; diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds index 8ddee103c5..9cbf889dd7 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds @@ -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 } diff --git a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S index 74049191c4..3438f93c51 100644 --- a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S +++ b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S @@ -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 | diff --git a/c/src/lib/libbsp/m68k/ods68302/start/reset.S b/c/src/lib/libbsp/m68k/ods68302/start/reset.S index 95447da7e1..1ed00d2401 100644 --- a/c/src/lib/libbsp/m68k/ods68302/start/reset.S +++ b/c/src/lib/libbsp/m68k/ods68302/start/reset.S @@ -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 diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in index 592d59cec2..cc5b6a7e82 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in @@ -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) diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c index d752bb2cbe..c980c29e63 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c @@ -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 diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds index 89858099cf..3911aaed12 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds @@ -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 = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } diff --git a/c/src/lib/libbsp/m68k/shared/start.S b/c/src/lib/libbsp/m68k/shared/start.S index 50099d9c43..4c9372e735 100644 --- a/c/src/lib/libbsp/m68k/shared/start.S +++ b/c/src/lib/libbsp/m68k/shared/start.S @@ -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 -- cgit v1.2.3