Subversion Repositories HelenOS-historic

Rev

Rev 68 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68 Rev 124
Line 59... Line 59...
59
 
59
 
60
 
60
 
61
void interrupt(void)
61
void interrupt(void)
62
{
62
{
63
    __u32 cause;
63
    __u32 cause;
64
        int i;
64
    int i;
65
 
65
   
66
    /* decode interrupt number and process the interrupt */
66
    /* decode interrupt number and process the interrupt */
67
        cause = (cp0_cause_read()>>8)&0xff;
67
    cause = (cp0_cause_read() >> 8) &0xff;
68
 
68
   
69
        for (i=0; i<8; i++) {
69
    for (i = 0; i < 8; i++) {
70
                if (cause & (1<<i)) {
70
        if (cause & (1 << i)) {
-
 
71
            switch (i) {
71
                        switch (i) {
72
                case 0: /* SW0 - Software interrupt 0 */
-
 
73
                    cp0_cause_write(cause & ~(1 << 8)); /* clear SW0 interrupt */
72
                case 0x0:
74
                    break;
-
 
75
                case 1: /* SW1 - Software interrupt 1 */
-
 
76
                    cp0_cause_write(cause & ~(1 << 9)); /* clear SW1 interrupt */
73
                case 0x1:
77
                    break;
74
                case 0x2:
78
                case 2: /* IRQ0 */
-
 
79
                case 3: /* IRQ1 */
75
                case 0x3:
80
                case 4: /* IRQ2 */
76
                case 0x4:
81
                case 5: /* IRQ3 */
77
                case 0x5:
82
                case 6: /* IRQ4 */
78
                            case 0x6: panic("unhandled interrupt %d\n", i); break;
83
                    panic("unhandled interrupt %d\n", i);
-
 
84
                    break;
79
                            case 0x7:
85
                case 7: /* Timer Interrupt */
80
                                    /* clear timer interrupt */
86
                    cp0_compare_write(cp0_compare_value); /* clear timer interrupt */
81
                                    cp0_compare_write(cp0_compare_value);
-
 
82
                    /* start counting over again */
87
                    /* start counting over again */
83
                    cp0_count_write(0);                
88
                    cp0_count_write(0);                
84
                                    clock();
89
                    clock();
85
                                    break;
90
                    break;
86
                        }
91
            }
87
                }
92
        }
88
        }
93
    }
89
 
94
 
90
}
95
}