source: rtems/c/src/lib/libcpu/arm/mc9328mxl/irq/bsp_irq_asm.S @ 9832a22c

4.104.115
Last change on this file since 9832a22c was 9832a22c, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/17/09 at 13:52:16

exception handling maintenance

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 * MC9328MXL Intererrupt handler
3 *
4 * Copyright (c) 2002 by Jay Monkman <jtm@lopingdog.com>
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *
12 *  $Id$
13 */
14#define __asm__
15       
16/*
17 * BSP specific interrupt handler for INT or FIQ. In here
18 * you do determine which interrupt happened and call its
19 * handler.
20 */
21        .globl bsp_interrupt_dispatch
22bsp_interrupt_dispatch :
23/*
24 * Look at interrupt status register to determine source.
25 * From source, determine offset into expanded vector table
26 * and load handler address into r0.
27 */
28  ldr   r0, =0x00223040  /* Read the vector number */
29  ldr   r1, [r0]
30  mov   r1, r1, LSR #16         /* get the NIVECTOR into 16 LSbits */
31
32  /* find the ISR's address based on the vector */     
33  ldr   r0, =bsp_vector_table
34  mov   r1, r1, LSL #3          /* Shift vector to get offset into table */
35  add   r1, r0, r1              /* r1 has address of vector entry */
36  ldr   r0, [r1, #4]            /* Get the data pointer */
37  ldr   r1, [r1]                /* Get the vector */
38
39  stmdb   sp!,{lr}
40  ldr     lr, =IRQ_return         /* prepare the return from handler  */
41
42  mov     pc, r1                /* EXECUTE INT HANDLER */
43
44IRQ_return:
45  ldmia sp!,{lr}
46
47  mov pc, lr
Note: See TracBrowser for help on using the repository browser.