summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/nios2/nios2_iss/startup
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-08-09 20:57:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-08-09 20:57:11 +0000
commit783669fcb3d0196034df104ca172bbb215a60237 (patch)
treebbfbed63163fe3657cfbce2a31df4a2816436d02 /c/src/lib/libbsp/nios2/nios2_iss/startup
parent * libnetworking/rtems/rtems_mii_ioctl_kern.c: (diff)
downloadrtems-783669fcb3d0196034df104ca172bbb215a60237.tar.bz2
2006-08-09 Kolja Waschk <waschk@telos.de>
* ChangeLog, Makefile.am, README, acinclude.m4, configure.ac, nios2_iss/ChangeLog, nios2_iss/Makefile.am, nios2_iss/bsp_specs, nios2_iss/configure.ac, nios2_iss/nios2_iss.ptf, nios2_iss/nios2_iss.sh, nios2_iss/times, nios2_iss/console/console.c, nios2_iss/include/bsp.h, nios2_iss/include/bspopts.h.in, nios2_iss/include/coverhd.h, nios2_iss/include/tm27.h, nios2_iss/shmsupp/addrconv.c, nios2_iss/shmsupp/getcfg.c, nios2_iss/shmsupp/lock.c, nios2_iss/shmsupp/mpisr.c, nios2_iss/start/crtnn.s, nios2_iss/start/start.S, nios2_iss/startup/bspclean.c, nios2_iss/startup/bspstart.c, nios2_iss/startup/linkcmds, nios2_iss/startup/main.c, nios2_iss/startup/setvec.c, nios2_iss/timer/timer.c: New files.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/nios2/nios2_iss/startup/bspclean.c31
-rw-r--r--c/src/lib/libbsp/nios2/nios2_iss/startup/bspstart.c143
-rw-r--r--c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds331
-rw-r--r--c/src/lib/libbsp/nios2/nios2_iss/startup/main.c39
-rw-r--r--c/src/lib/libbsp/nios2/nios2_iss/startup/setvec.c44
5 files changed, 588 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/bspclean.c b/c/src/lib/libbsp/nios2/nios2_iss/startup/bspclean.c
new file mode 100644
index 0000000000..b38f0e1d57
--- /dev/null
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/bspclean.c
@@ -0,0 +1,31 @@
+/* bsp_cleanup()
+ *
+ * This routine normally is part of start.s and usually returns
+ * control to a monitor.
+ *
+ * INPUT: NONE
+ *
+ * OUTPUT: NONE
+ *
+ * COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de
+ * Derived from no_cpu/no_bsp/startup/bspclean.c 1.7.
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+#include <rtems/score/cpu.h>
+
+void bsp_cleanup( void )
+{
+ int level;
+ _CPU_ISR_Disable(level);
+ for(;;);
+}
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/bspstart.c b/c/src/lib/libbsp/nios2/nios2_iss/startup/bspstart.c
new file mode 100644
index 0000000000..8317b59516
--- /dev/null
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/bspstart.c
@@ -0,0 +1,143 @@
+/*
+ * This routine starts the application. It includes application,
+ * board, and monitor specific initialization and configuration.
+ * The generic CPU dependent initialization has been performed
+ * before this routine is invoked.
+ *
+ * COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de
+ * Derived from no_cpu/no_bsp/startup/bspstart.c 1.23.
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <string.h>
+
+#include <bsp.h>
+#include <rtems/libio.h>
+#include <rtems/libcsupport.h>
+
+/*
+ * 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;
+
+/*
+ * Use the shared implementations of the following routines
+ */
+
+extern void bsp_postdriver_hook(void);
+extern void bsp_libc_init( void *, uint32_t, int );
+extern rtems_configuration_table BSP_Configuration;
+
+#if 0
+extern char _RAMBase[];
+extern char _RAMSize[];
+extern char _WorkspaceBase[];
+extern char _HeapSize[];
+#else
+extern char __alt_heap_start[];
+#endif
+
+/*
+ * 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)
+{
+ unsigned long heapStart;
+#if 0
+ unsigned long heapSize = (unsigned long)_HeapSize;
+#endif
+ unsigned long ramSpace;
+
+ heapStart = (unsigned long)BSP_Configuration.work_space_start
+ + BSP_Configuration.work_space_size;
+
+ if (heapStart & (CPU_ALIGNMENT-1))
+ heapStart = (heapStart + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
+
+#if 0
+ ramSpace = (unsigned long)_RAMBase + (unsigned long)_RAMSize - heapStart;
+#else
+#if 0
+ ramSpace = SRAM_0_BASE
+ + (SRAM_0_SRAM_MEMORY_SIZE * SRAM_0_SRAM_MEMORY_UNITS)
+ - heapStart;
+#else
+ ramSpace = RAM_BASE + RAM_BYTES - heapStart;
+#endif
+#endif
+
+ /* TODO */
+ ramSpace -= 16384; /* Space for initial stack, not to be zeroed */
+
+#if 0
+ if (heapSize < 10)
+ heapSize = ramSpace;
+ else if (heapSize > ramSpace)
+ rtems_fatal_error_occurred (('H'<<24) | ('E'<<16) | ('A'<<8) | 'P');
+
+ bsp_libc_init((void *)heapStart, heapSize, 0);
+#else
+ bsp_libc_init((void *)heapStart, ramSpace, 0);
+#endif
+
+#ifdef RTEMS_DEBUG
+ rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
+#endif
+}
+
+/*
+ * bsp_start
+ *
+ * This routine does the bulk of the system initialization.
+ */
+
+void bsp_start( void )
+{
+ /* Fixed */
+
+ BSP_Configuration.microseconds_per_tick = 1000;
+
+ /*
+ * Need to "allocate" the memory for the RTEMS Workspace and
+ * tell the RTEMS configuration where it is. This memory is
+ * not malloc'ed. It is just "pulled from the air".
+ */
+
+#if 0
+ BSP_Configuration.work_space_start = (void *)_WorkspaceBase;
+#else
+ BSP_Configuration.work_space_start = (void *)__alt_heap_start;
+#endif
+
+ /*
+ * initialize the CPU table for this BSP
+ */
+
+ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
+ Cpu_table.postdriver_hook = bsp_postdriver_hook;
+ Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
+}
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
new file mode 100644
index 0000000000..7128baf9c2
--- /dev/null
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
@@ -0,0 +1,331 @@
+/* generated.x
+ *
+ * Machine generated for a CPU named "cpu_0" as defined in:
+ * D:\eb2_nios2\kawkos.ptf
+ *
+ * Generated: 2005-07-10 11:52:46.899
+ *
+ */
+
+/*
+
+DO NOT MODIFY THIS FILE
+
+ Changing this file will have subtle consequences
+ which will almost certainly lead to a nonfunctioning
+ system. If you do modify this file, be aware that your
+ changes will be overwritten and lost when this file
+ is generated again.
+
+DO NOT MODIFY THIS FILE
+
+*/
+
+MEMORY
+{
+ reset : ORIGIN = 0x00000000, LENGTH = 0x00000600
+ exceptions : ORIGIN = 0x00000600, LENGTH = 0x00000A00
+ onchip_memory_0 : ORIGIN = 0x00001000, LENGTH = 0x007FF000
+}
+
+ /* Define symbols for each memory base-address */
+ __alt_mem_onchip_memory_0 = 0x00000000 ;
+
+ __nios2_icache_size = 4096 ;
+ __nios2_icache_line_size = 32 ;
+ __nios2_dcache_size = 0 ;
+ __nios2_dcache_line_size = 4 ;
+
+OUTPUT_FORMAT( "elf32-littlenios2",
+ "elf32-littlenios2",
+ "elf32-littlenios2" )
+OUTPUT_ARCH( nios2 )
+ENTRY( _start )
+
+/* Do we need any of these for elf?
+ __DYNAMIC = 0;
+ */
+
+SECTIONS
+{
+ .entry :
+ {
+ KEEP (*(.entry))
+ } > reset
+
+ .exceptions :
+ {
+ PROVIDE (__ram_exceptions_start = ABSOLUTE(.));
+ . = ALIGN(0x20);
+ *(.irq)
+ KEEP (*(.exceptions.entry.label));
+ KEEP (*(.exceptions.entry.user));
+ KEEP (*(.exceptions.entry));
+ KEEP (*(.exceptions.irqtest.user));
+ KEEP (*(.exceptions.irqtest));
+ KEEP (*(.exceptions.irqhandler.user));
+ KEEP (*(.exceptions.irqhandler));
+ KEEP (*(.exceptions.irqreturn.user));
+ KEEP (*(.exceptions.irqreturn));
+ KEEP (*(.exceptions.notirq.label));
+ KEEP (*(.exceptions.notirq.user));
+ KEEP (*(.exceptions.notirq));
+ KEEP (*(.exceptions.soft.user));
+ KEEP (*(.exceptions.soft));
+ KEEP (*(.exceptions.unknown.user));
+ KEEP (*(.exceptions.unknown));
+ KEEP (*(.exceptions.exit.label));
+ KEEP (*(.exceptions.exit.user));
+ KEEP (*(.exceptions.exit));
+ KEEP (*(.exceptions));
+ PROVIDE (__ram_exceptions_end = ABSOLUTE(.));
+ } > exceptions
+
+ PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions));
+
+ .text :
+ {
+ /*
+ * All code sections are merged into the text output section, along with
+ * the read only data sections.
+ *
+ */
+
+ PROVIDE (stext = ABSOLUTE(.));
+
+ *(.interp)
+ *(.hash)
+ *(.dynsym)
+ *(.dynstr)
+ *(.gnu.version)
+ *(.gnu.version_d)
+ *(.gnu.version_r)
+ *(.rel.init)
+ *(.rela.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rela.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rela.ctors)
+ *(.rel.dtors)
+ *(.rela.dtors)
+ *(.rel.got)
+ *(.rela.got)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ *(.rel.plt)
+ *(.rela.plt)
+
+ KEEP (*(.init))
+ *(.plt)
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+
+ /* Special FreeBSD sysctl sections. */
+ . = ALIGN (16);
+ __start_set_sysctl_set = .;
+ *(set_sysctl_*);
+ __stop_set_sysctl_set = ABSOLUTE(.);
+ *(set_domain_*);
+ *(set_pseudo_*);
+
+/* .gnu.warning sections are handled specially by elf32.em. */
+
+ *(.gnu.warning.*)
+ KEEP (*(.fini))
+ PROVIDE (__etext = ABSOLUTE(.));
+ PROVIDE (_etext = ABSOLUTE(.));
+ PROVIDE (etext = ABSOLUTE(.));
+
+ *(.eh_frame_hdr)
+ /* Ensure the __preinit_array_start label is properly aligned. We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty. */
+ . = ALIGN(32 / 8);
+ PROVIDE (__preinit_array_start = ABSOLUTE(.));
+ *(.preinit_array)
+ PROVIDE (__preinit_array_end = ABSOLUTE(.));
+ PROVIDE (__init_array_start = ABSOLUTE(.));
+ *(.init_array)
+ PROVIDE (__init_array_end = ABSOLUTE(.));
+ PROVIDE (__fini_array_start = ABSOLUTE(.));
+ *(.fini_array)
+ PROVIDE (__fini_array_end = ABSOLUTE(.));
+ SORT(CONSTRUCTORS)
+ KEEP (*(.eh_frame))
+ *(.gcc_except_table)
+ *(.dynamic)
+ PROVIDE (__CTOR_LIST__ = ABSOLUTE(.));
+ KEEP (*(.ctors))
+ KEEP (*(SORT(.ctors.*)))
+ PROVIDE (__CTOR_END__ = ABSOLUTE(.));
+ PROVIDE (__DTOR_LIST__ = ABSOLUTE(.));
+ KEEP (*(.dtors))
+ KEEP (*(SORT(.dtors.*)))
+ PROVIDE (__DTOR_END__ = ABSOLUTE(.));
+ KEEP (*(.jcr))
+ . = ALIGN(32 / 8);
+ } > onchip_memory_0 = 0x3a880100 /* NOP on Nios2 (big endian) */
+
+ .rodata :
+ {
+ PROVIDE (__ram_rodata_start = ABSOLUTE(.));
+ . = ALIGN(32 / 8);
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
+ *(.rodata1)
+ . = ALIGN(32 / 8);
+ PROVIDE (__ram_rodata_end = ABSOLUTE(.));
+ } > onchip_memory_0
+
+ PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
+
+ .rwdata :
+ {
+ PROVIDE (__ram_rwdata_start = ABSOLUTE(.));
+ . = ALIGN(32 / 8);
+ *(.got.plt) *(.got)
+ *(.data1)
+ *(.data .data.* .gnu.linkonce.d.*)
+
+ _gp = ABSOLUTE(. + 0x8000);
+ PROVIDE(gp = _gp);
+
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
+
+ . = ALIGN(32 / 8);
+ _edata = ABSOLUTE(.);
+ PROVIDE (edata = ABSOLUTE(.));
+ PROVIDE (__ram_rwdata_end = ABSOLUTE(.));
+ } > onchip_memory_0
+
+ PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata));
+
+ .bss :
+ {
+ __bss_start = ABSOLUTE(.);
+ PROVIDE (__sbss_start = ABSOLUTE(.));
+ PROVIDE (___sbss_start = ABSOLUTE(.));
+
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
+ *(.scommon)
+
+ PROVIDE (__sbss_end = ABSOLUTE(.));
+ PROVIDE (___sbss_end = ABSOLUTE(.));
+
+ *(.dynbss)
+ *(.bss .bss.* .gnu.linkonce.b.*)
+ *(COMMON)
+
+ . = ALIGN(32 / 8);
+ __bss_end = ABSOLUTE(.);
+ } > onchip_memory_0
+
+ /*
+ * One output section for each of the available partitions. These are not
+ * used by default, but can be used by users applications using the .section
+ * directive.
+ *
+ * The memory partition used for the heap is treated in special way, i.e. a
+ * symbol is added to point to the heap start.
+ *
+ * Note that when running from flash, these sections are not loaded by the
+ * HAL.
+ *
+ */
+
+ .onchip_memory_0 :
+ {
+ PROVIDE (_alt_partition_onchip_memory_0_start = ABSOLUTE(.));
+ *(.onchip_memory_0 .onchip_memory_0.*)
+ . = ALIGN(32 / 8);
+ PROVIDE (_alt_partition_onchip_memory_0_end = ABSOLUTE(.));
+ _end = ABSOLUTE(.);
+ end = ABSOLUTE(.);
+
+ } > onchip_memory_0
+
+ PROVIDE (_alt_partition_onchip_memory_0_load_addr = LOADADDR(.onchip_memory_0));
+
+ /*
+ * 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 .gnu.linkonce.wi.*) }
+ .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) }
+
+ /* Altera debug extensions */
+ .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) }
+}
+/* provide a pointer for the stack */
+
+/*
+ * Don't override this, override the __alt_stack_* symbols instead.
+ */
+__alt_data_end = 0x00800000;
+
+/*
+ * The next two symbols define the location of the default stack. You can
+ * override them to move the stack to a different memory.
+ */
+PROVIDE( __alt_stack_pointer = __alt_data_end );
+PROVIDE( __alt_stack_limit = _end );
+
+/*
+ * This symbol controls where the start of the heap is. If the stack is
+ * contiguous with the heap then the stack will contract as memory is
+ * allocated to the heap.
+ * Override this symbol to put the heap in a different memory.
+ */
+PROVIDE( __alt_heap_start = end );
+
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/main.c b/c/src/lib/libbsp/nios2/nios2_iss/startup/main.c
new file mode 100644
index 0000000000..4e28f28fe2
--- /dev/null
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/main.c
@@ -0,0 +1,39 @@
+/* main()
+ *
+ * This is the entry point for the application. It calls
+ * the bsp_start routine to the actual dirty work.
+ *
+ * COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de
+ * Derived from no_cpu/no_bsp/startup/main.c 1.9,
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+
+int main(
+ int argc,
+ char **argv,
+ char **environp
+)
+{
+ extern void bsp_start( int, char**, char ** );
+
+ bsp_start( argc, argv, environp );
+
+ /*
+ * May be able to return to the "crt/start.s" code but also
+ * may not be able to. Do something here which is board dependent.
+ */
+
+ rtems_fatal_error_occurred( 0 );
+
+ return 0; /* just to satisfy the native compiler */
+}
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/setvec.c b/c/src/lib/libbsp/nios2/nios2_iss/startup/setvec.c
new file mode 100644
index 0000000000..a35618a8c5
--- /dev/null
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/setvec.c
@@ -0,0 +1,44 @@
+/* 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
+ *
+ * COPYRIGHT (c) 2005-2006 Kolja Waschk rtemsdev/ixo.de
+ * Derived from no_cpu/no_bsp/startup/setvec.c 1.8,
+ * COPYRIGHT (c) 1989-1999.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <bsp.h>
+
+nios2_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 */
+)
+{
+ nios2_isr_entry previous_isr;
+
+ if ( type )
+ rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
+ else {
+ /* XXX: install non-RTEMS ISR as "raw" interupt */
+ }
+ return previous_isr;
+}