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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [m68k/] [efi68k/] [startup/] [setvec.c] - Blame information for rev 562

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  set_vector
2
 *
3
 *  This routine installs an interrupt vector on the efi68k.
4
 *
5
 *  INPUT:
6
 *    handler - interrupt handler entry point
7
 *    vector  - vector number
8
 *    type    - 0 indicates raw hardware connect
9
 *              1 indicates RTEMS interrupt connect
10
 *
11
 *  RETURNS:
12
 *    address of previous interrupt handler
13
 *
14
 *  COPYRIGHT (c) 1989-1999.
15
 *  On-Line Applications Research Corporation (OAR).
16
 *
17
 *  The license and distribution terms for this file may be
18
 *  found in the file LICENSE in this distribution or at
19
 *  http://www.OARcorp.com/rtems/license.html.
20
 *
21
 *  $Id: setvec.c,v 1.2 2001-09-27 12:00:03 chris Exp $
22
 */
23
 
24
#include <bsp.h>
25
 
26
m68k_isr_entry set_vector(                      /* returns old vector */
27
  rtems_isr_entry     handler,                  /* isr routine        */
28
  rtems_vector_number vector,                   /* vector number      */
29
  int                 type                      /* RTEMS or RAW intr  */
30
)
31
{
32
  int *p;
33
  m68k_isr_entry  previous_isr;
34
 
35
  if ( type )
36
    rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
37
  else {
38
    p = (int *)(vector*6-12+2+(int)_VBR);
39
    previous_isr  =  (m68k_isr_entry) *p;       /* return old ISR  */
40
    *p = (int) handler;    /* install new ISR */
41
  }
42
  return previous_isr;
43
}
44
 

powered by: WebSVN 2.1.0

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