some interrupt stuff, now basketball ...
[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 }
23
24 int interrupt_set(u8 src_number,u8 mode,u8 priority,void *callback) {
25
26         /* check whether this ir source is allready assigned */
27         if(VICSoftInt&(1<<src_number))
28                 return INTERRUPT_EINUSE;
29         
30         /* force interrupt */
31         VICSoftInt|=(1<<src_number);
32         VICIntEnable|=(1<<src_number);
33
34         switch(mode) {
35                 case INTERRUPT_FIQ:
36                         VICIntSelect|=(1<<src_number);
37                         break;
38                 case INTERRUPT_VIRQ:
39                 case INTERRUPT_IRQ:
40                 case default:
41         }
42
43         return INTERRUPT_SET;
44 }
45
46 /*
47  * the actual exception handlers (as defined in startup.s)
48  */
49
50 // reset
51 void interrupt_handler_reset(void) {
52 }
53
54 // undefined instruction
55 void interrupt_handler_undef_instruction(void) {
56 }
57
58 // software interrupt
59 void interrupt_handler_soft_ir(void) {
60 }
61
62 // prefetch abort
63 void interrupt_handler_prefetch_abort(void) {
64 }
65
66 // data abort
67 void interrupt_handler_data_abort(void) {
68 }
69
70 // fiq
71 void interrupt_handler_fiq(void) {
72 }
73