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/efi68k/startup/Makefile.in | 4 +- c/src/lib/libbsp/m68k/efi68k/startup/bspstart.c | 47 ++---------------------- c/src/lib/libbsp/m68k/efi68k/startup/linkcmds | 22 +++++------ 3 files changed, 15 insertions(+), 58 deletions(-) (limited to 'c/src/lib/libbsp/m68k/efi68k/startup') 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 } -- cgit v1.2.3