Subversion Repositories HelenOS

Rev

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

Rev 958 Rev 1258
Line 32... Line 32...
32
#include <arch.h>
32
#include <arch.h>
33
#include <arch/cp0.h>
33
#include <arch/cp0.h>
34
#include <time/clock.h>
34
#include <time/clock.h>
35
#include <arch/drivers/arc.h>
35
#include <arch/drivers/arc.h>
36
 
36
 
-
 
37
#include <ipc/sysipc.h>
-
 
38
 
37
/** Disable interrupts.
39
/** Disable interrupts.
38
 *
40
 *
39
 * @return Old interrupt priority level.
41
 * @return Old interrupt priority level.
40
 */
42
 */
41
ipl_t interrupts_disable(void)
43
ipl_t interrupts_disable(void)
Line 81... Line 83...
81
}
83
}
82
 
84
 
83
static void swint0(int n, istate_t *istate)
85
static void swint0(int n, istate_t *istate)
84
{
86
{
85
    cp0_cause_write(cp0_cause_read() & ~(1 << 8)); /* clear SW0 interrupt */
87
    cp0_cause_write(cp0_cause_read() & ~(1 << 8)); /* clear SW0 interrupt */
-
 
88
    ipc_irq_send_notif(0);
86
}
89
}
87
 
90
 
88
static void swint1(int n, istate_t *istate)
91
static void swint1(int n, istate_t *istate)
89
{
92
{
90
    cp0_cause_write(cp0_cause_read() & ~(1 << 9)); /* clear SW1 interrupt */
93
    cp0_cause_write(cp0_cause_read() & ~(1 << 9)); /* clear SW1 interrupt */
-
 
94
    ipc_irq_send_notif(1);
91
}
95
}
92
 
96
 
93
/* Initialize basic tables for exception dispatching */
97
/* Initialize basic tables for exception dispatching */
94
void interrupt_init(void)
98
void interrupt_init(void)
95
{
99
{
96
    int_register(TIMER_IRQ, "timer", timer_exception);
100
    int_register(TIMER_IRQ, "timer", timer_exception);
97
    int_register(0, "swint0", swint0);
101
    int_register(0, "swint0", swint0);
98
    int_register(1, "swint1", swint1);
102
    int_register(1, "swint1", swint1);
99
}
103
}
-
 
104
 
-
 
105
#include <print.h>
-
 
106
static void ipc_int(int n, istate_t *istate)
-
 
107
{
-
 
108
    ipc_irq_send_notif(n-INT_OFFSET);
-
 
109
}
-
 
110
 
-
 
111
/* Reregister irq to be IPC-ready */
-
 
112
void irq_ipc_bind_arch(__native irq)
-
 
113
{
-
 
114
    /* Do not allow to redefine timer */
-
 
115
    /* Swint0, Swint1 are already handled */
-
 
116
    if (irq == TIMER_IRQ || irq < 2)
-
 
117
        return;
-
 
118
    int_register(irq, "ipc_int", ipc_int);
-
 
119
}