source: rtems/c/src/lib/libbsp/sh/shared/setvec.c @ 4a238002

4.104.114.84.95
Last change on this file since 4a238002 was 21bfd93, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/98 at 12:40:33

Patch from Ralf Corsepius <corsepiu@…>:

Please find enclosed a patch which enables me to build the bare-bsp for
sh-rtems.

Changes:

  1. Add preinstall to libbsp/bare/include/Makefile.in
  2. Removed FORCEIT, add preinstall to libbsp/sh/gensh1/include/Makefile.in
  3. Disabled support of set_vector from sh code (shared/setvec.c is still present but isn't used anymore), set_vector replaced with standard rtems functions.

Problems still present:

  1. Support of spin-delays in bare bsp
  2. Proper support of cpu frequency

To configure I used:

<srcdir>/configure \
--target=sh-rtems \
--prefix=<instdir>/sh-bare \
--enable-bare-cpu-model=sh7032 \
--enable-bare-cpu-cflags='-Wall -m1 -DMHZ=20
-DCPU_CONSOLE_DEVNAME="\"/dev/null\""'
--enable-rtemsbsp=bare \
--disable-networking \
--disable-cxx \
--disable-posix \
--disable-tests

IMO, if there are no objections to this patch, a similar approach should
be applied to all CPUs/BSPs (esp. hppa1.1, mips64orion, ppc403, because
they apply set_vector inside of libcpu).

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*  set_vector
2 *
3 *  NOTE: This function is considered OBSOLETE and may vanish soon.
4 *      Calls to set_vector should be replaced by calls to
5 *      rtems_interrupt_catch or _CPU_ISR_install_raw_handler.
6 *
7 *  This routine installs an interrupt vector on the target Board/CPU.
8 *  This routine is allowed to be as board dependent as necessary.
9 *
10 *  INPUT:
11 *    handler - interrupt handler entry point
12 *    vector  - vector number
13 *    type    - 0 indicates raw hardware connect
14 *              1 indicates RTEMS interrupt connect
15 *
16 *  RETURNS:
17 *    address of previous interrupt handler
18 *
19 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
20 *           Bernd Becker (becker@faw.uni-ulm.de)
21 *
22 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
23 *
24 *  This program is distributed in the hope that it will be useful,
25 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
26 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 *
29 *  COPYRIGHT (c) 1998.
30 *  On-Line Applications Research Corporation (OAR).
31 *  Copyright assigned to U.S. Government, 1994.
32 *
33 *  The license and distribution terms for this file may be
34 *  found in the file LICENSE in this distribution or at
35 *  http://www.OARcorp.com/rtems/license.html.
36 *
37 *  $Id$
38 */
39
40#include <rtems.h>
41#include <bsp.h>
42
43sh_isr_entry set_vector(                /* returns old vector */
44  rtems_isr_entry     handler,          /* isr routine        */
45  rtems_vector_number vector,           /* vector number      */
46  int                 type              /* RTEMS or RAW intr  */
47)
48{
49  sh_isr_entry previous_isr;
50
51  if ( type )
52    rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
53  else {
54    _CPU_ISR_install_raw_handler( vector, handler, (proc_ptr*) &previous_isr );
55  }
56
57  return previous_isr;
58}
Note: See TracBrowser for help on using the repository browser.