From df49c60c9671e4a28e636964d744c1f59fb6cb68 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 12 Jun 2000 15:00:15 +0000 Subject: Merged from 4.5.0-beta3a --- c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am | 13 +- c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c | 29 +-- c/src/lib/libbsp/m68k/mvme167/startup/linkcmds | 227 ++++++++++++--------- c/src/lib/libbsp/m68k/mvme167/startup/page_table.c | 2 +- 4 files changed, 148 insertions(+), 123 deletions(-) (limited to 'c/src/lib/libbsp/m68k/mvme167/startup') diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am b/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am index 0ae5078b6f..e5f1fdd3a6 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am +++ b/c/src/lib/libbsp/m68k/mvme167/startup/Makefile.am @@ -1,6 +1,6 @@ -## +## ## $Id$ -## +## AUTOMAKE_OPTIONS = foreign 1.4 @@ -23,7 +23,6 @@ include $(top_srcdir)/../../../../../../automake/lib.am # # USE_INIT_FINI tells main.c what C++ help we need. - AM_CPPFLAGS += -DUSE_INIT_FINI $(PGM): $(OBJS) @@ -32,16 +31,12 @@ $(PGM): $(OBJS) $(PROJECT_RELEASE)/lib/linkcmds: linkcmds $(INSTALL_DATA) $< $@ -$(PROJECT_RELEASE)/lib/elflinkcmds: elflinkcmds - $(INSTALL_DATA) $< $@ - -TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds \ - $(PROJECT_RELEASE)/lib/elflinkcmds +TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES) .PRECIOUS: $(PGM) -EXTRA_DIST = bspclean.c bspstart.c elflinkcmds linkcmds page_table.c +EXTRA_DIST = bspclean.c bspstart.c linkcmds page_table.c include $(top_srcdir)/../../../../../../automake/local.am diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c index f443a48153..05f78e0c85 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/mvme167/startup/bspstart.c @@ -79,15 +79,18 @@ void bsp_pretasking_hook(void); /* m68k version */ */ void bsp_start( void ) { - extern void *_WorkspaceBase; - extern m68k_isr_entry M68Kvec[]; - extern void *_WorkspaceBase; - void M68KFPSPInstallExceptionHandlers (void); + extern m68k_isr_entry M68Kvec[]; + extern void *_WorkspaceBase; + extern void *_RamSize; + extern unsigned long _M68k_Ramsize; + m68k_isr_entry *rom_monitor_vector_table; int index; + _M68k_Ramsize = (unsigned long)&_RamSize; /* RAM size set in linker script */ + /* * 167Bug Vectors are at 0xFFE00000 */ @@ -129,7 +132,8 @@ void bsp_start( void ) Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ Cpu_table.postdriver_hook = bsp_postdriver_hook; Cpu_table.interrupt_vector_table = (m68k_isr_entry *) &M68Kvec; - Cpu_table.interrupt_stack_size = 4096; /* Must match value in start.s */ + /* Must match value in start.s */ + Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY; /* * If the application has not overriden the default User_extension_table, @@ -147,19 +151,4 @@ void bsp_start( void ) * not malloc'ed. It is just "pulled from the air". */ BSP_Configuration.work_space_start = (void *)&_WorkspaceBase; - - /* - * Increase the number of semaphores that can be created on this node. The - * termios package requires one semaphore to protect the list of termios- - * capable terminals, and up to four semaphores per termios-capable - * terminal (add calls here as required). The maximum number of semaphores - * must be set before returning to boot_card(), which will call - * rtems_initialize_executive_early(). This latter function eventually - * calls _RTEMS_API_Initialize(), which in turn calls - * _Semaphore_Manager_initialization(), which allocates the space for the - * maximum number of semaphores in the object table. These calls occur - * before the call to the predriver hook and the calls to the device - * initialization callbacks. Hence, we must do this here. - */ - console_reserve_resources( &BSP_Configuration ); } diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds index 9cbf889dd7..c22f578905 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds @@ -22,11 +22,11 @@ OUTPUT_ARCH(m68k) ENTRY(_start) /* - * Declare some sizes. + * Declare some sizes. Heap is sized at whatever ram space is left. */ -_RamBase = 0x00800000; +_RamBase = DEFINED(_RamBase) ? _RamBase : 0x00800000; _RamSize = DEFINED(_RamSize) ? _RamSize : 4M; -_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; +_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0; _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; MEMORY @@ -42,103 +42,144 @@ MEMORY SECTIONS { - ram : { - . = .; - } >ram + /* + * Text, data and bss segments + */ + .text : { + *(.text) - /* - * Text, data and bss segments - */ - .text : { - *(.text) + /* + * C++ constructors/destructors + */ + *(.gnu.linkonce.t.*) - /* - * C++ constructors/destructors - */ - *(.gnu.linkonce.t.*) + /* + * Initialization and finalization code. + * + * Various files can provide initialization and finalization + * functions. crtbegin.o and crtend.o are two instances. The + * body of these functions are in .init and .fini sections. We + * accumulate the bodies here, and prepend function prologues + * from crti.o and function epilogues from crtn.o. crti.o must + * be linked first; crtn.o must be linked last. Because these + * are wildcards, it doesn't matter if the user does not + * actually link against crti.o and crtn.o; the linker won't + * look for a file to match a wildcard. The wildcard also + * means that it doesn't matter which directory crti.o and + * crtn.o are in. + */ + PROVIDE (_init = .); + *crti.o(.init) + *(.init) + *crtn.o(.init) + + PROVIDE (_fini = .); + *crti.o(.fini) + *(.fini) + *crtn.o(.fini) - /* - * Initialization and finalization code. - * - * Various files can provide initialization and finalization - * functions. crtbegin.o and crtend.o are two instances. The - * body of these functions are in .init and .fini sections. We - * accumulate the bodies here, and prepend function prologues - * from crti.o and function epilogues from crtn.o. crti.o must - * be linked first; crtn.o must be linked last. Because these - * are wildcards, it doesn't matter if the user does not - * actually link against crti.o and crtn.o; the linker won't - * look for a file to match a wildcard. The wildcard also - * means that it doesn't matter which directory crti.o and - * crtn.o are in. - */ - PROVIDE (_init = .); - *crti.o(.init) - *(.init) - *crtn.o(.init) - PROVIDE (_fini = .); - *crti.o(.fini) - *(.fini) - *crtn.o(.fini) + /* + * C++ constructors/destructors + * + * gcc uses crtbegin.o to find the start of the constructors + * and destructors so we make sure it is first. Because this + * is a wildcard, it doesn't matter if the user does not + * actually link against crtbegin.o; the linker won't look for + * a file to match a wildcard. The wildcard also means that + * it doesn't matter which directory crtbegin.o is in. The + * constructor and destructor list are terminated in + * crtend.o. The same comments apply to it. + */ + . = ALIGN (16); + *crtbegin.o(.ctors) + *(.ctors) + *crtend.o(.ctors) + + *crtbegin.o(.dtors) + *(.dtors) + *crtend.o(.dtors) - /* - * C++ constructors/destructors - * - * gcc uses crtbegin.o to find the start of the constructors - * and destructors so we make sure it is first. Because this - * is a wildcard, it doesn't matter if the user does not - * actually link against crtbegin.o; the linker won't look for - * a file to match a wildcard. The wildcard also means that - * it doesn't matter which directory crtbegin.o is in. The - * constructor and destructor list are terminated in - * crtend.o. The same comments apply to it. - */ - . = ALIGN (16); - *crtbegin.o(.ctors) - *(.ctors) - *crtend.o(.ctors) - *crtbegin.o(.dtors) - *(.dtors) - *crtend.o(.dtors) + /* + * Exception frame info + */ + . = ALIGN (16); + *(.eh_frame) - /* - * Exception frame info - */ - . = ALIGN (16); - *(.eh_frame) + /* + * Read-only data + */ + . = ALIGN (16); + PROVIDE(_rodata_start = . ); + *(.rodata) + *(.gnu.linkonce.r*) + PROVIDE(_erodata = . ); - /* - * Read-only data - */ - . = ALIGN (16); - _rodata_start = . ; - *(.rodata) - *(.gnu.linkonce.r*) + . = ALIGN (16); + PROVIDE (_etext = .); + } >ram + + .data : { + PROVIDE (_copy_start = .); + *(.data) + *(.gnu.linkonce.d*) + *(.gcc_except_table) + . = ALIGN (16); + PROVIDE (_edata = .); + PROVIDE (_copy_end = .); + } >ram + + .bss : { + _clear_start = .; + *(.bss) + *(COMMON) + . = ALIGN (16); + PROVIDE (end = .); - . = ALIGN (16); - PROVIDE (_etext = .); - } >ram - .data : { - PROVIDE (_copy_start = .); - *(.data) - *(.gnu.linkonce.d*) - *(.gcc_except_table) - . = ALIGN (16); - PROVIDE (_edata = .); - PROVIDE (_copy_end = .); - } >ram - .bss : { - _clear_start = .; - *(.bss) - *(COMMON) - . = ALIGN (16); - PROVIDE (end = .); + . += _StackSize; + . = ALIGN (16); + _stack_init = .; + _clear_end = .; - . += _StackSize; - . = ALIGN (16); - _stack_init = .; - _clear_end = .; + _WorkspaceBase = .; + } >ram - _WorkspaceBase = .; - } >ram + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ } diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c b/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c index 5d44f3159b..ebbcc9739d 100644 --- a/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c +++ b/c/src/lib/libbsp/m68k/mvme167/startup/page_table.c @@ -79,7 +79,7 @@ void page_table_init( * E = 0b1 enable address translation * S-Field = 0b1X ignore FC2 when matching * U1, U0 = 0b00 user page attributes not used - * CM = 0b01 cachable, writethrough + * CM = 0b01 cachable, copyback * W = 0b0 read/write access allowed */ dtt0 = 0x007FC020; -- cgit v1.2.3