4.104.114.84.95
Line | |
---|
1 | /* bsp_irq_asm.S |
---|
2 | * |
---|
3 | * This file contains the implementation of the IRQ handler |
---|
4 | * for a specific BSP |
---|
5 | * |
---|
6 | * CopyRight (C) 2000 Canon Research France SA. |
---|
7 | * Emmanuel Raguet, mailto:raguet@crf.canon.fr |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.com/license/LICENSE. |
---|
12 | * |
---|
13 | */ |
---|
14 | |
---|
15 | #define __asm__ |
---|
16 | #include <registers.h> |
---|
17 | |
---|
18 | /* |
---|
19 | * Function to obtain, execute an IT handler and acknowledge the IT |
---|
20 | */ |
---|
21 | |
---|
22 | .globl ExecuteITHandler |
---|
23 | |
---|
24 | ExecuteITHandler : |
---|
25 | ldr r0, =INTPHAI3 /* read the vector number */ |
---|
26 | ldr r0, [r0] |
---|
27 | ldr r0, [r0] /* extract the IT handler @ */ |
---|
28 | |
---|
29 | /* |
---|
30 | * re-enable interrupts at processor level as the current |
---|
31 | * interrupt source is now masked via VEGA logic |
---|
32 | */ |
---|
33 | mrs r1, cpsr |
---|
34 | and r1, r1, #0xFFFFFF3F |
---|
35 | msr cpsr, r1 |
---|
36 | |
---|
37 | stmdb sp!,{lr} |
---|
38 | ldr lr, =IRQ_return /* prepare the return from handler */ |
---|
39 | mov pc, r0 /* EXECUTE INT HANDLER */ |
---|
40 | |
---|
41 | IRQ_return: |
---|
42 | ldmia sp!,{lr} |
---|
43 | ldr r2, =INTSTAT3 /* Ack the interrupt */ |
---|
44 | ldr r2, [r2] |
---|
45 | ldr r1, =INTACK3 |
---|
46 | str r2, [r1] |
---|
47 | /* |
---|
48 | * disable interrupts_again and switch back to SVC mode |
---|
49 | */ |
---|
50 | mrs r0, cpsr |
---|
51 | orr r0, r0, #0xc3 |
---|
52 | msr cpsr, r0 |
---|
53 | |
---|
54 | mov pc, lr |
---|
55 | |
---|
56 | /* |
---|
57 | * Function to acknowledge the IT controller |
---|
58 | */ |
---|
59 | .globl AckControler |
---|
60 | |
---|
61 | #if 0 |
---|
62 | AckControler: |
---|
63 | ldr r0, =INTEOI3 |
---|
64 | mov r1, #EOI |
---|
65 | str r1, [r0] |
---|
66 | |
---|
67 | b ReturnFromAck /* return to ISR handler */ |
---|
68 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.