OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [dmv177/] [startup/] [setvec.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  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
 *  COPYRIGHT (c) 1989-1997.
16
 *  On-Line Applications Research Corporation (OAR).
17
 *
18
 *  The license and distribution terms for this file may in
19
 *  the file LICENSE in this distribution or at
20
 *  http://www.OARcorp.com/rtems/license.html.
21
 *
22
 *  setvec.c,v 1.4 2001/10/12 21:07:26 joel Exp
23
 */
24
 
25
#include <rtems.h>
26
#include <bsp.h>
27
 
28
/*PAGE
29
 *
30
 *  set_vector
31
 *
32
 *  This routine installs an interrupt handler for vector.
33
 */
34
 
35
rtems_isr_entry set_vector(                    /* returns old vector */
36
  rtems_isr_entry     handler,                  /* isr routine        */
37
  rtems_vector_number vector,                   /* vector number      */
38
  int                 type                      /* RTEMS or RAW intr  */
39
)
40
{
41
  rtems_isr_entry previous_isr;
42
  rtems_status_code status;
43
 
44
  /*
45
   * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose
46
   * interupt handler.
47
   */
48
  if ( vector > PPC_IRQ_LAST )  {
49
    set_EE_vector ( handler, vector );
50
  }
51
  else  {
52
    status = rtems_interrupt_catch(
53
       handler, vector, (rtems_isr_entry *) &previous_isr );
54
  }
55
  return previous_isr;
56
}
57
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.