source: rtems/c/src/lib/libbsp/powerpc/helas403/startup/setvec.c @ be4284d0
Last change on this file since be4284d0 was be4284d0, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 30, 1998 at 9:50:42 PM

BSP submitted by Thomas Doerfler <td@…>:

Finally I am through: I have found the last bugs that made RTEMS-
4.0-beta3 start on my ppc403 board from ROM. So now the '403
support is up to date again.

Roughly I have added the following features:

  • support for the on-chip interrupt controller (in a separate module)
  • interrupt support for the console device
  • termios support for the console device

Since the BSP behaivour changed in some details (console no
longer is polling, other memory layout etc) I have created a new
BSP "helas403" rather than changing the "papyrus" BSP. The old
"polled" console driver still sticks around in "console.c.polled"
To get the BSP up and running, I had to create the new BSP files
(derived from papyrus). Besides that, the following source areas
have been changed:

  • c/src/lib/libcpu/powerpc/ppc403: changes to console driver, small changes to clock driver, new "ictrl" interrupt controller driver
  • c/src/exec/score/cpu/powerpc/ppc.h: some small changes (added ppc403 characteristics like a exception vector prefix register, some special register definitions). I am quite sure, they are compatible with the existing sources, although I did not check
  • c/src/exec/score/cpu/powerpc/cpu.c: There is one severe limitation in the exception entries: Due to the current code arrangement, the "branch absolute" to the ISR handler may only jump to the first 128MByte or the last 128MByte of the 4GByte address range. When the ppc403 is running out of ROM, the ROM functions are located in the last 128MByte (0xFFF00000 and up). These addresses were not handled correctly (sign reduced) in "install_raw_handler". The change I added should work on existing ppc BSPs aswell...
  • c/src/lib/libc/termios.c: During my tests, I added one change you sent me, so this patch will already be incorporated in the current source tree.

There are some smaller changes, see the attached diff file.

Concerning the GNU toolchain:

I tried several tool chains. Finally I almost succeeded with

egcs-1.0.3a with patch egcs-1.0.3-rtems-diff-19980527

I had to add the following lines to the egcs files. Without them
configure complaint that the cross compiler could not generate
executable output.

  • additional lines needed in egcs distribution in file gcc/config/rs6000/rtems.h:

+++ lines start
#define STARTFILE_DEFAULT_SPEC "ecrti.o%s"

#define ENDFILE_DEFAULT_SPEC "ecrtn.o%s"
++++ lines end

As far as I have seen in the Changelog of egcs, you have recently
sent two patches affecting the powerpc support, but they were
added in the wrong order.... :-(

egcs-19980628 with patch egcs-19980628-rtems-diff-19980707 does
not work!

I used binutils 2.9.1 with patch binutils-2.9.1-rtems-diff-19980515

(binutils 2.8.1 does not work, internal error in gas)

and newlib-1.8.0 with patch newlib-1.8.0-rtems-diff-19980707

Finally I had to poke a line in the "bit" script, since, on my LINUX
machine, the GNU make is only available as "make", not as

For all the tools and newlib I selected configuration "powerpc-

IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler Herbststrasse 8
D-82178 Puchheim Germany
email: td@…

  • Property mode set to 100644
File size: 1.9 KB
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on the target Board/CPU.
4 *  This routine is allowed to be as board dependent as necessary.
5 *
6 *  INPUT:
7 *    handler - interrupt handler entry point
8 *    vector  - vector number
9 *    type    - 0 indicates raw hardware connect
10 *              1 indicates RTEMS interrupt connect
11 *
12 *  RETURNS:
13 *    address of previous interrupt handler
14 *
15 *  Author:     Andrew Bray <>
16 *
17 *  COPYRIGHT (c) 1995 by i-cubed ltd.
18 *
19 *  To anyone who acknowledges that this file is provided "AS IS"
20 *  without any express or implied warranty:
21 *      permission to use, copy, modify, and distribute this file
22 *      for any purpose is hereby granted without fee, provided that
23 *      the above copyright notice and this notice appears in all
24 *      copies, and that the name of i-cubed limited not be used in
25 *      advertising or publicity pertaining to distribution of the
26 *      software without specific, written prior permission.
27 *      i-cubed limited makes no representations about the suitability
28 *      of this software for any purpose.
29 *
30 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/startup/setvec.c:
31 *
32 *  COPYRIGHT (c) 1989-1998.
33 *  On-Line Applications Research Corporation (OAR).
34 *  Copyright assigned to U.S. Government, 1994.
35 *
36 *  The license and distribution terms for this file may be
37 *  found in the file LICENSE in this distribution or at
38 *
39 *
40 *  $Id$
41 */
43#include <rtems.h>
44#include <bsp.h>
46rtems_isr_entry set_vector(                    /* returns old vector */
47  rtems_isr_entry     handler,                  /* isr routine        */
48  rtems_vector_number vector,                   /* vector number      */
49  int                 type                      /* RTEMS or RAW intr  */
52  rtems_isr_entry previous_isr;
54  rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
56  return previous_isr;
Note: See TracBrowser for help on using the repository browser.