source: rtems/c/src/lib/libbsp/i386/ts_386ex/startup/setvec.c @ 3299388d

4.104.114.84.95
Last change on this file since 3299388d was e61df10, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:51:28

2003-09-04 Joel Sherrill <joel@…>

  • clock/ckinit.c, clock/rtc.c, console/console.c, include/bsp.h, include/coverhd.h, network/ne2000.c, start/80386ex.h, start/80386ex.inc, start/macros.inc, start/start.S, startup/bspstart.c, startup/linkcmds, startup/setvec.c, timer/timer.c, timer/timerisr.S, tools/debug_ada/init.c, tools/debug_c/init.c, tools/debug_c/serial_gdb.c, tools/debug_c/system.h, tools/network_ada/listener/init.c, tools/network_ada/tcprelay/init.c, tools/ts_1325_ada/init.c: URL for license changed.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  set_vector
2 *
3 *  This routine installs an interrupt vector on the Force CPU-386.
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.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#include <rtems.h>
25#include <bsp.h>
26
27i386_isr_entry set_vector(                      /* returns old vector */
28  rtems_isr_entry     handler,                  /* isr routine        */
29  rtems_vector_number vector,                   /* vector number      */
30  int                 type                      /* RTEMS or RAW intr  */
31)
32{
33  i386_isr_entry previous_isr;
34  interrupt_gate_descriptor  idt;
35
36  if ( type )
37    rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr );
38  else {
39    /* get the address of the old handler */
40
41    idt = Interrupt_descriptor_table[ vector ];
42
43    previous_isr = (i386_isr_entry)
44                      ((idt.offset_16_31 << 16) | idt.offset_0_15);
45
46    /* build the IDT entry */
47    create_interrupt_gate_descriptor( &idt, handler );
48
49    /* install the IDT entry */
50    Interrupt_descriptor_table[ vector ] = idt;
51  }
52  return previous_isr;
53}
54
Note: See TracBrowser for help on using the repository browser.