summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/dmv177/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-05-30 10:09:14 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-05-30 10:09:14 +0000
commitc932d85019761fbafef02fc72119e4bcd4e50978 (patch)
tree20d32f1b768006bfee2385a9cf03a4411373e502 /c/src/lib/libbsp/powerpc/dmv177/startup
parentchanged version to 980527 (diff)
downloadrtems-c932d85019761fbafef02fc72119e4bcd4e50978.tar.bz2
New files -- from rtems-LM-980406 which was based on an RTEMS from 12/97.
This was called the dmv170 BSP in that source tree but since the DMV171 is now obsolete, we have transitioned to the DMV177 and have no intention of checking compatibility with any other models.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/dmv177/startup')
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in68
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.s25
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c312
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c184
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds173
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/rtems-ctor.cc151
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/sbrk.c61
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c71
-rw-r--r--c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c84
9 files changed, 1129 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in
new file mode 100644
index 0000000000..229bfa3eef
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in
@@ -0,0 +1,68 @@
+#
+# $Id$
+#
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+RTEMS_ROOT = @RTEMS_ROOT@
+PROJECT_ROOT = @PROJECT_ROOT@
+RTEMS_CUSTOM = $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg
+
+PGM=${ARCH}/startup.rel
+
+# C source names, if any, go here -- minus the .c
+C_PIECES=bspstart sbrk setvec genpvec vmeintr
+C_FILES=$(C_PIECES:%=%.c)
+C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
+
+CC_PIECES=rtems-ctor
+CC_FILES=$(CC_PIECES:%=%.cc)
+CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o)
+
+H_FILES=
+
+# Assembly source names, if any, go here -- minus the .s
+S_PIECES=bspclean
+S_FILES=$(S_PIECES:%=%.s)
+S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
+
+SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
+OBJS=$(C_O_FILES) $(S_O_FILES)
+
+# We install the RTEMS constructor as a separate .o
+# so it can be easily place correctly by the compiler config file.
+INSTALLED_O_FILES=$(ARCH)/rtems-ctor.o
+
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+#
+# (OPTIONAL) Add local stuff here using +=
+#
+
+DEFINES +=
+CPPFLAGS +=
+CFLAGS +=
+
+LD_PATHS +=
+LD_LIBS +=
+LDFLAGS +=
+
+#
+# Add your list of files to delete here. The config files
+# already know how to delete some stuff, so you may want
+# to just run 'make clean' first to see what gets missed.
+# 'make clobber' already includes 'make clean'
+#
+
+CLEAN_ADDITIONS +=
+CLOBBER_ADDITIONS +=
+
+${PGM}: ${SRCS} ${OBJS}
+ $(make-rel)
+
+all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM)
+ $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib
+ $(INSTALL_VARIANT) $(INSTALLED_O_FILES) ${PROJECT_RELEASE}/lib
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.s b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.s
new file mode 100644
index 0000000000..339f9d6eb6
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.s
@@ -0,0 +1,25 @@
+/*
+ * bspclean.s -- based on mvme-exit.S from libgloss which was designed to
+ * work for targets using the ppcbug monitor
+ *
+ * Copyright (c) 1995 Cygnus Support
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ */
+
+#include "ppc-asm.h"
+
+ .file "bspclean.s"
+ .text
+FUNC_START(bsp_cleanup)
+ li r10,0x63
+ sc
+FUNC_END(bsp_cleanup)
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
new file mode 100644
index 0000000000..fba086515c
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c
@@ -0,0 +1,312 @@
+/* bspstart.c
+ *
+ * This set of routines starts the application. It includes application,
+ * board, and monitor specific initialization and configuration.
+ * The generic CPU dependent initialization has been performed
+ * before any of these are invoked.
+ *
+ * Called by RTEMS::RTEMS constructor in rtems-ctor.cc
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <rtems/libio.h>
+
+#include <libcsupport.h>
+
+#include <string.h>
+#include <fcntl.h>
+
+#ifdef STACK_CHECKER_ON
+#include <stackchk.h>
+#endif
+
+/*
+ * The original table from the application and our copy of it with
+ * some changes.
+ */
+
+extern rtems_configuration_table Configuration;
+rtems_configuration_table BSP_Configuration;
+rtems_cpu_table Cpu_table;
+rtems_unsigned32 bsp_isr_level;
+
+/* PAGE
+ *
+ * bsp_libc_init
+ *
+ * Initialize whatever libc we are using called from bsp_postdriver_hook.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ *
+ */
+
+void bsp_libc_init(void)
+{
+ extern int end;
+ rtems_unsigned32 heap_start;
+ rtems_unsigned32 heap_size;
+
+ heap_start = (rtems_unsigned32) &end;
+ if (heap_start & (CPU_ALIGNMENT-1))
+ heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
+
+ heap_size = BSP_Configuration.work_space_start - (void *)&end;
+ heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */
+
+ RTEMS_Malloc_Initialize((void *) heap_start, heap_size, 0);
+
+ /*
+ * Init the RTEMS libio facility to provide UNIX-like system
+ * calls for use by newlib (ie: provide __rtems_open, __rtems_close, etc)
+ * Uses malloc() to get area for the iops, so must be after malloc init
+ */
+
+ rtems_libio_init();
+
+ /*
+ * Set up for the libc handling.
+ */
+
+ if (BSP_Configuration.ticks_per_timeslice > 0)
+ libc_init(1); /* reentrant if possible */
+ else
+ libc_init(0); /* non-reentrant */
+
+}
+
+
+/* PAGE
+ *
+ * bsp_pretasking_hook
+ *
+ * BSP pretasking hook. Called just before drivers are initialized.
+ * Used to setup libc and install any BSP extensions.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ *
+ */
+
+void bsp_pretasking_hook(void)
+{
+ bsp_libc_init();
+
+#ifdef STACK_CHECKER_ON
+ /*
+ * Initialize the stack bounds checker
+ * We can either turn it on here or from the app.
+ */
+
+ Stack_check_Initialize();
+#endif
+
+#ifdef RTEMS_DEBUG
+ rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
+#endif
+
+}
+
+/* PAGE
+ *
+ * bsp_predriver_hook
+ *
+ * Initialization before drivers are setup.
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ */
+
+void bsp_predriver_hook(void)
+{
+ initialize_external_exception_vector();
+}
+
+/* PAGE
+ *
+ * bsp_postdriver_hook
+ *
+ * After drivers are setup, register some "filenames"
+ * and open stdin, stdout, stderr files
+ *
+ * Newlib will automatically associate the files with these
+ * (it hardcodes the numbers)
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ *
+ */
+
+void bsp_postdriver_hook(void)
+{
+ int stdin_fd, stdout_fd, stderr_fd;
+ int error_code;
+
+ error_code = 'S' << 24 | 'T' << 16;
+
+ if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) == -1)
+ rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' );
+
+ if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
+ rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' );
+
+ if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) == -1)
+ rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' );
+
+ if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2))
+ rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' );
+}
+
+/* PAGE
+ *
+ * bsp_start
+ *
+ * This routine does the bulk of the system initialization.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ *
+ */
+
+void bsp_start( void )
+{
+ unsigned char *work_space_start;
+ unsigned int msr_value = 0x2030;
+
+ /*
+ * Set BSP to initial value. Note: This value is a guess
+ * check how the real board comes up. This is critical to
+ * getting the source to work with the debugger.
+ */
+ _CPU_MSR_SET( msr_value );
+
+ /*
+ * Set up our hooks
+ * Make sure libc_init is done before drivers initialized so that
+ * they can use atexit()
+ */
+
+ Cpu_table.exceptions_in_RAM = TRUE;
+
+ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
+
+ Cpu_table.predriver_hook = bsp_predriver_hook;
+
+ Cpu_table.postdriver_hook = bsp_postdriver_hook;
+
+ Cpu_table.idle_task = NULL; /* do not override system IDLE task */
+
+ Cpu_table.clicks_per_usec = 66 / 4; /* XXX get from linkcmds */
+
+
+ /*
+ * SIS does zero out memory BUT only when IT begins execution. Thus
+ * if we want to have a clean slate in the workspace each time we
+ * begin execution of OUR application, then we must zero the workspace.
+ */
+
+ Cpu_table.do_zero_of_workspace = TRUE;
+
+ /*
+ * This should be enough interrupt stack.
+ */
+
+ Cpu_table.interrupt_stack_size = (12 * 1024);
+
+ /*
+ * DMV170 does not support MP configurations so there is really no way
+ * to check this out.
+ */
+
+ Cpu_table.extra_mpci_receive_server_stack = 0;
+
+ /*
+ * Copy the table and allocate memory for the RTEMS Workspace
+ */
+
+ BSP_Configuration = Configuration;
+
+#if defined(RTEMS_POSIX_API)
+ BSP_Configuration.work_space_size *= 3;
+#endif
+
+ work_space_start =
+ (unsigned char *)&RAM_END - BSP_Configuration.work_space_size;
+
+ if ( work_space_start <= (unsigned char *)&end ) {
+ DEBUG_puts( "bspstart: Not enough RAM!!!\n" );
+ bsp_cleanup();
+ }
+
+ BSP_Configuration.work_space_start = work_space_start;
+
+ /*
+ * Add 1 region for RTEMS Malloc
+ */
+
+ BSP_Configuration.RTEMS_api_configuration->maximum_regions++;
+
+ /*
+ * Account for the console's resources
+ */
+
+ console_reserve_resources( &BSP_Configuration );
+
+#ifdef RTEMS_NEWLIB
+ /*
+ * Add 1 extension for newlib libc
+ */
+
+ BSP_Configuration.maximum_extensions++;
+#endif
+
+#ifdef STACK_CHECKER_ON
+ /*
+ * Add 1 extension for stack checker
+ */
+
+ BSP_Configuration.maximum_extensions++;
+#endif
+
+ /*
+ * Add 1 extension for MPCI_fatal
+ */
+
+ if (BSP_Configuration.User_multiprocessing_table)
+ BSP_Configuration.maximum_extensions++;
+
+ /*
+ * Initialize RTEMS. main() will finish it up and start multitasking.
+ */
+
+ rtems_libio_config( &BSP_Configuration, BSP_LIBIO_MAX_FDS );
+
+ bsp_isr_level = rtems_initialize_executive_early(
+ &BSP_Configuration,
+ &Cpu_table
+ );
+}
+
+
+
+
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
new file mode 100644
index 0000000000..98989c2401
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c
@@ -0,0 +1,184 @@
+/* genpvec.c
+ *
+ * These routines handle the external exception. Multiple ISRs occur off
+ * of this one interrupt. This method will allow multiple ISRs to be
+ * called using the same IRQ index. However, removing the ISR routines is
+ * presently not supported.
+ *
+ * The external exception vector numbers begin with DMV170_IRQ_FIRST.
+ * DMV170_IRQ_FIRST is defined to be one greater than the last processor
+ * interrupt.
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id:
+ */
+
+#include <bsp.h>
+#include "chain.h"
+#include <assert.h>
+
+#define NUM_LIRQ_HANDLERS 20
+#define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST )
+
+/*
+ * Structure to for one of possible multiple interrupt handlers for
+ * a given interrupt.
+ */
+typedef struct
+{
+ Chain_Node Node;
+ rtems_isr_entry handler; /* isr routine */
+ rtems_vector_number vector; /* vector number */
+} EE_ISR_Type;
+
+/*
+ * Note: The following will not work if we add a method to remove
+ * handlers at a later time.
+ */
+EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS];
+rtems_unsigned16 Nodes_Used;
+Chain_Control ISR_Array [NUM_LIRQ];
+
+
+/* PAGE
+ *
+ * initialize_external_exception_vector
+ *
+ * This routine initializes the external exception vector
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ */
+
+void initialize_external_exception_vector ()
+{
+ int i;
+ rtems_isr_entry previous_isr;
+ rtems_status_code status;
+
+ Nodes_Used = 0;
+
+ for (i=0; i <NUM_LIRQ; i++)
+ Chain_Initialize_empty( &ISR_Array[i] );
+
+ /*
+ * Install external_exception_ISR () as the handler for
+ * the General Purpose Interrupt.
+ */
+
+ status = rtems_interrupt_catch( external_exception_ISR,
+ PPC_IRQ_EXTERNAL , (rtems_isr_entry *) &previous_isr );
+}
+
+/* PAGE
+ *
+ * set_EE_vector
+ *
+ * This routine installs one of multiple ISRs for the general purpose
+ * inerrupt.
+ *
+ * Input parameters:
+ * handler - handler to call at exception
+ * vector - vector number associated with this handler.
+ *
+ * Output parameters: NONE
+ *
+ * Return values:
+ */
+rtems_isr_entry set_EE_vector(
+ rtems_isr_entry handler, /* isr routine */
+ rtems_vector_number vector /* vector number */
+)
+{
+ rtems_unsigned16 vec_idx = vector - DMV170_IRQ_FIRST;
+ rtems_unsigned32 index;
+
+ /*
+ * Verify that all of the nodes have not been used.
+ */
+ assert (Nodes_Used < NUM_LIRQ_HANDLERS);
+
+ /*
+ * If we have already installed this handler for this vector, then
+ * just reset it.
+ */
+
+ for ( index=0 ; index <= Nodes_Used ; index++ ) {
+ if ( ISR_Nodes[index].vector == vector &&
+ ISR_Nodes[index].handler == handler )
+ return 0;
+ }
+
+ /*
+ * Increment the number of nedes used and set the index for the node
+ * array.
+ */
+
+ Nodes_Used++;
+ index = Nodes_Used - 1;
+
+ /*
+ * Write the values of the handler and the vector to this node.
+ */
+ ISR_Nodes[index].handler = handler;
+ ISR_Nodes[index].vector = vector;
+
+ /*
+ * Connect this node to the chain at the location of the
+ * vector index.
+ */
+ Chain_Append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node );
+
+ /*
+ * No interrupt service routine was removed so return 0
+ */
+ return 0;
+}
+
+/* PAGE
+ *
+ * external_exception_ISR
+ *
+ * This interrupt service routine is called for an External Exception.
+ *
+ * Input parameters:
+ * vector - vector number representing the external exception vector.
+ *
+ * Output parameters: NONE
+ *
+ * Return values:
+ */
+
+rtems_isr external_exception_ISR (
+ rtems_vector_number vector /* IN */
+)
+{
+ rtems_unsigned16 index;
+ EE_ISR_Type *node;
+
+ /*
+ * Read vector.
+ */
+ index = 0;
+
+ node = ISR_Array[ index ].first;
+ while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) {
+ (*node->handler)( node->vector );
+ node = node->Node.next;
+ }
+
+ /*
+ * Clear the interrupt.
+ */
+}
+
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
new file mode 100644
index 0000000000..80b586dbad
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds
@@ -0,0 +1,173 @@
+OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
+ "elf32-powerpc")
+OUTPUT_ARCH(powerpc)
+ENTRY(_start)
+
+/*
+ * Number of Decrementer countdowns per millisecond
+ *
+ * Calculated by: (66.67 Mhz * 1000) / 4 cycles per click
+ */
+
+PROVIDE(CPU_PPC_CLICKS_PER_MS = 16667);
+
+MEMORY
+ {
+ RAM : ORIGIN = 0, LENGTH = 32M
+ EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000
+ }
+
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ /* . = 0x40000 + SIZEOF_HEADERS; */
+ /* . = 0x1000000;*/
+ . = 0x41000;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rela.text : { *(.rela.text) }
+ .rela.data : { *(.rela.data) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rela.got : { *(.rela.got) }
+ .rela.got1 : { *(.rela.got1) }
+ .rela.got2 : { *(.rela.got2) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rela.init : { *(.rela.init) }
+ .rela.fini : { *(.rela.fini) }
+ .rela.bss : { *(.rela.bss) }
+ .rela.plt : { *(.rela.plt) }
+ .rela.sdata : { *(.rela.sdata2) }
+ .rela.sbss : { *(.rela.sbss2) }
+ .rela.sdata2 : { *(.rela.sdata2) }
+ .rela.sbss2 : { *(.rela.sbss2) }
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text)
+ *(.descriptors)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .init : { *(.init) } =0
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) }
+ .rodata1 : { *(.rodata1) }
+ _etext = .;
+ PROVIDE (etext = .);
+ PROVIDE (__SDATA2_START__ = .);
+ .sdata2 : { *(.sdata2) }
+ .sbss2 : { *(.sbss2) }
+ PROVIDE (__SBSS2_END__ = .);
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. It would
+ be more correct to do this:
+ . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
+ The current expression does not correctly handle the case of a
+ text segment ending precisely at the end of a page; it causes the
+ data segment to skip a page. The above expression does not have
+ this problem, but it will currently (2/95) cause BFD to allocate
+ a single segment, combining both text and data, for this case.
+ This will prevent the text segment from being shared among
+ multiple executions of the program; I think that is more
+ important than losing a page of the virtual address space (note
+ that no actual memory is lost; the page which is skipped can not
+ be referenced). */
+ . = ALIGN(8) + 0x40000;
+ PROVIDE (sdata = .);
+ .data :
+ {
+ *(.data)
+ CONSTRUCTORS
+ }
+ PROVIDE (__EXCEPT_START__ = .);
+ .gcc_except_table : { *(.gcc_except_table) }
+ PROVIDE (__EXCEPT_END__ = .);
+
+ .data1 : { *(.data1) }
+ .got1 : { *(.got1) }
+ .dynamic : { *(.dynamic) }
+ /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+ get relocated with -mrelocatable. Also put in the .fixup pointers.
+ The current compiler no longer needs this, but keep it around for 2.7.2 */
+ PROVIDE (_GOT2_START_ = .);
+ .got2 : { *(.got2) }
+ PROVIDE (__GOT2_END__ = .);
+ PROVIDE (__CTOR_LIST__ = .);
+ .ctors : { *(.ctors) }
+ PROVIDE (__CTOR_END__ = .);
+ PROVIDE (__DTOR_LIST__ = .);
+ .dtors : { *(.dtors) }
+ PROVIDE (__DTOR_END__ = .);
+ PROVIDE (_FIXUP_START_ = .);
+ .fixup : { *(.fixup) }
+ PROVIDE (_FIXUP_END_ = .);
+ PROVIDE (__FIXUP_END__ = .);
+ PROVIDE (_GOT2_END_ = .);
+ PROVIDE (_GOT_START_ = .);
+ s.got = .;
+ .got : { *(.got) }
+ .got.plt : { *(.got.plt) }
+ PROVIDE (_GOT_END_ = .);
+ PROVIDE (__GOT_END__ = .);
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ PROVIDE (__SDATA_START__ = .);
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ PROVIDE (RAM_END = 4M);
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ *(.sbss)
+ *(.scommon)
+ PROVIDE (__sbss_end = .);
+ }
+ PROVIDE (__SBSS_END__ = .);
+ .bss :
+ {
+ PROVIDE (__bss_start = .);
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ . = ALIGN(8) + 0x8000;
+ PROVIDE (__stack = .);
+ _end = . ;
+ PROVIDE (end = .);
+
+ /* These are needed for ELF backends which have not yet been
+ converted to the new style linker. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ /* 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/powerpc/dmv177/startup/rtems-ctor.cc b/c/src/lib/libbsp/powerpc/dmv177/startup/rtems-ctor.cc
new file mode 100644
index 0000000000..0c7efef592
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/rtems-ctor.cc
@@ -0,0 +1,151 @@
+/*
+ * rtems-ctor.cc
+ *
+ * Description:
+ * This file exists solely to (try to) ensure RTEMS is initialized
+ * before any global constructors are run.
+ *
+ * The problem:
+ * Global constructors might reasonably expect that new() will
+ * work, but since new() uses malloc() which uses RTEMS regions,
+ * it can not be called until after initialize_executive().
+ *
+ * Global constructors are called in GNU systems one of 2 ways:
+ *
+ * an "invisible" call to __main() inserted by compiler
+ * This __main() calls __do_global_ctors() which
+ * walks thru the table and calls all global
+ * constructors.
+ *
+ * or -
+ * A special section is put into the linked binary. The
+ * system startup code knows to run the constructors in
+ * this special section before calling main().
+ *
+ * By making RTEMS initialization a constructor, we avoid having
+ * too much about all this. All we have to guarantee is that
+ * this constructor is the first one run.
+ *
+ *
+ * So for the first case above, this is what happens
+ *
+ * host crt0
+ * main()
+ * __main()
+ * __do_global_ctors()
+ * bsp_start()
+ * init_executive_early()
+ * <<any other constructors>>
+ *
+ * rtems_init_executive_late()
+ * bsp_cleanup()
+ *
+ * TODO:
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+
+/*
+ * RTEMS program name
+ * Probably not used by anyone, but it is nice to have it.
+ * Actually the UNIX version of CPU_INVOKE_DEBUGGER will probably
+ * need to use it
+ */
+
+char *rtems_progname;
+char **rtems_environp;
+
+#ifdef USE_CONSTRUCTORS_FOR_INIT_EXEC
+
+class RTEMS {
+ public:
+ RTEMS();
+ ~RTEMS();
+};
+
+RTEMS rtems_constructor;
+
+
+/* PAGE
+ *
+ * RTEMS::RTEMS
+ *
+ * RTEMS constructor routine
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ */
+
+RTEMS::RTEMS()
+{
+ bsp_start();
+}
+
+/* PAGE
+ *
+ * RTEMS::~RTEMS
+ *
+ * RTEMS distructor routine
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ */
+
+RTEMS::~RTEMS()
+{
+ bsp_cleanup();
+}
+#endif
+
+extern "C" {
+ int
+ main(int argc,
+ char **argv,
+ char **environp)
+ {
+
+#ifndef USE_CONSTRUCTORS_FOR_INIT_EXEC
+ bsp_start();
+#endif
+
+ if ((argc > 0) && argv && argv[0])
+ rtems_progname = argv[0];
+ else
+ rtems_progname = "RTEMS";
+
+ rtems_environp = environp;
+
+ /*
+ * Start multitasking
+ */
+
+ rtems_initialize_executive_late( bsp_isr_level );
+
+#ifndef USE_CONSTRUCTORS_FOR_INIT_EXEC
+ bsp_cleanup();
+#endif
+
+ /*
+ * Returns when multitasking is stopped
+ * This allows our destructors to get run normally
+ */
+
+ return 0;
+ }
+}
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/sbrk.c b/c/src/lib/libbsp/powerpc/dmv177/startup/sbrk.c
new file mode 100644
index 0000000000..c52224cc35
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/sbrk.c
@@ -0,0 +1,61 @@
+/*
+ * sbrk.c
+ *
+ * If the BSP wants to dynamically allocate the memory for the
+ * C Library heap (malloc) and/or be able to extend the heap,
+ * then this routine must be functional.
+ *
+ * Author: Andrew Bray <andy@i-cubed.co.uk>
+ *
+ * COPYRIGHT (c) 1995 by i-cubed ltd.
+ *
+ * To anyone who acknowledges that this file is provided "AS IS"
+ * without any express or implied warranty:
+ * permission to use, copy, modify, and distribute this file
+ * for any purpose is hereby granted without fee, provided that
+ * the above copyright notice and this notice appears in all
+ * copies, and that the name of i-cubed limited not be used in
+ * advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ * i-cubed limited makes no representations about the suitability
+ * of this software for any purpose.
+ *
+ * Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/sbrk.c:
+ *
+ * COPYRIGHT (c) 1989-1998.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+
+#include <signal.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/* PAGE
+ *
+ * sbrk
+ *
+ * Routine to allow dynamically allocated memory for the heap.
+ * Note the int may need to be a size_t on some hosts
+ *
+ * Input parameters:
+ * incr
+ * Output parameters: NONE
+ *
+ * Return values:
+ */
+void * sbrk(size_t incr)
+{
+ errno = EINVAL;
+ return (void *)-1;
+}
+
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
new file mode 100644
index 0000000000..4fb6333da8
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c
@@ -0,0 +1,71 @@
+/* set_vector
+ *
+ * This routine installs an interrupt vector on the target Board/CPU.
+ * This routine is allowed to be as board dependent as necessary.
+ *
+ * INPUT:
+ * handler - interrupt handler entry point
+ * vector - vector number
+ * type - 0 indicates raw hardware connect
+ * 1 indicates RTEMS interrupt connect
+ *
+ * RETURNS:
+ * address of previous interrupt handler
+ *
+ * Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id:
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+
+
+/* PAGE
+ *
+ * set_vector
+ *
+ * This routine installs vector number vector.
+ *
+ * Input parameters:
+ * handler - routine to call when the interupt occurs
+ * vector - vector id
+ * type - RAW or RTEMS vector
+ *
+ * Output parameters: NONE
+ *
+ * Return values: Removed interupt routine or 0 if none.
+ */
+
+rtems_isr_entry set_vector( /* returns old vector */
+ rtems_isr_entry handler, /* isr routine */
+ rtems_vector_number vector, /* vector number */
+ int type /* RTEMS or RAW intr */
+)
+{
+ rtems_isr_entry previous_isr;
+ rtems_status_code status;
+
+
+ /*
+ * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose
+ * interupt handler.
+ */
+ if ( vector > PPC_IRQ_LAST ) {
+ set_EE_vector ( handler, vector );
+ }
+ else {
+ status = rtems_interrupt_catch
+ ( handler, vector, (rtems_isr_entry *) &previous_isr );
+ }
+ return previous_isr;
+}
+
diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
new file mode 100644
index 0000000000..212d7eb938
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c
@@ -0,0 +1,84 @@
+/* vmeintr.c
+ *
+ * VMEbus support routines for the DMV170.
+ *
+ * COPYRIGHT (c) 1989-1997.
+ * On-Line Applications Research Corporation (OAR).
+ * Copyright assigned to U.S. Government, 1994.
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.OARcorp.com/rtems/license.html.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <vmeintr.h>
+
+/* PAGE
+ *
+ * VME_interrupt_Disable
+ *
+ * This routine disables vme interupts
+ *
+ * Input parameters:
+ * mask - interupt mask
+ *
+ * Output parameters: NONE
+ *
+ * Return values: NONE
+ */
+
+void VME_interrupt_Disable (
+ VME_interrupt_Mask mask /* IN */
+)
+{
+ volatile rtems_unsigned8 *VME_interrupt_enable;
+ rtems_unsigned8 value;
+
+#if 0
+ VME_interrupt_enable = ACC_VIE;
+#else
+ VME_interrupt_enable = 0;
+#endif
+ value = *VME_interrupt_enable;
+
+ value &= ~mask; /* turn off interrupts for all levels in mask */
+
+ *VME_interrupt_enable = value;
+}
+
+/* PAGE
+ *
+ * VME_interrupt_Enable
+ *
+ * This routine enables vme interupts
+ *
+ * Input parameters:
+ * mask - interupt mask
+ *
+ * Output parameters: NONE
+ *
+ * Return values:
+ */
+
+void VME_interrupt_Enable (
+ VME_interrupt_Mask mask /* IN */
+)
+{
+ volatile rtems_unsigned8 *VME_interrupt_enable;
+ rtems_unsigned8 value;
+
+#if 0
+ VME_interrupt_enable = ACC_VIE;
+#else
+ VME_interrupt_enable = 0;
+#endif
+ value = *VME_interrupt_enable;
+
+ value |= mask; /* turn on interrupts for all levels in mask */
+
+ *VME_interrupt_enable = value;
+}