5327588fb12be0df7822d7e250f520c33d70a7bd
[my-code/arm.git] / betty / interrupts.c
1 /*
2  * interrupts.c - arm exception handling
3  *
4  * author: hackbard@hackdaworld.org
5  *
6  */
7
8 #include "interrupts.h"
9
10 /*
11  * functions
12  */
13
14 void interrupt_set_default_callback(void *callback) {
15
16         VICDefVectAddr=(u32)callback;
17         
18 }
19
20 void interrupt_clear(u8 src_number) {
21
22         VICIntEnClear=(1<<src_number);
23
24 }
25
26 int interrupt_enable(u8 src_number,u8 mode,u8 priority,void *callback) {
27
28         /* check whether this ir source is allready assigned */
29         if(VICIntEnable&(1<<src_number))
30                 return INTERRUPT_EINUSE;
31
32         /* force interrupt */
33         VICIntEnable=(1<<src_number);
34
35         switch(mode) {
36                 case INTERRUPT_FIQ:
37                         VICIntSelect|=(1<<src_number);
38                         break;
39                 case INTERRUPT_VIRQ:
40                         
41                 case INTERRUPT_IRQ:
42                 case default:
43         }
44
45         return INTERRUPT_SET;
46 }
47
48 /*
49  * the actual exception handlers (as defined in startup.s)
50  */
51
52 // reset
53 void interrupt_handler_reset(void) {
54 }
55
56 // undefined instruction
57 void interrupt_handler_undef_instruction(void) {
58 }
59
60 // software interrupt
61 void interrupt_handler_soft_ir(void) {
62 }
63
64 // prefetch abort
65 void interrupt_handler_prefetch_abort(void) {
66 }
67
68 // data abort
69 void interrupt_handler_data_abort(void) {
70 }
71
72 // fiq
73 void interrupt_handler_fiq(void) {
74 }
75