Subversion Repositories HelenOS

Rev

Rev 3022 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3022 Rev 4055
Line 36... Line 36...
36
#include <arch/interrupt.h>
36
#include <arch/interrupt.h>
37
#include <arch/types.h>
37
#include <arch/types.h>
38
#include <arch.h>
38
#include <arch.h>
39
#include <arch/cp0.h>
39
#include <arch/cp0.h>
40
#include <time/clock.h>
40
#include <time/clock.h>
41
#include <arch/drivers/arc.h>
-
 
42
#include <ipc/sysipc.h>
41
#include <ipc/sysipc.h>
43
#include <ddi/device.h>
42
#include <ddi/device.h>
44
 
43
 
45
#define IRQ_COUNT 8
44
#define IRQ_COUNT   8
46
#define TIMER_IRQ 7
45
#define TIMER_IRQ   7
-
 
46
#define DORDER_IRQ  5
47
 
47
 
48
function virtual_timer_fnc = NULL;
48
function virtual_timer_fnc = NULL;
49
static irq_t timer_irq;
49
static irq_t timer_irq;
50
 
50
 
51
/** Disable interrupts.
51
/** Disable interrupts.
Line 99... Line 99...
99
    lastcount = cp0_count_read();
99
    lastcount = cp0_count_read();
100
    nextcount = cp0_compare_value + cp0_count_read();
100
    nextcount = cp0_compare_value + cp0_count_read();
101
    cp0_compare_write(nextcount);
101
    cp0_compare_write(nextcount);
102
}
102
}
103
 
103
 
104
static irq_ownership_t timer_claim(void)
104
static irq_ownership_t timer_claim(irq_t *irq)
105
{
105
{
106
    return IRQ_ACCEPT;
106
    return IRQ_ACCEPT;
107
}
107
}
108
 
108
 
109
static void timer_irq_handler(irq_t *irq, void *arg, ...)
109
static void timer_irq_handler(irq_t *irq)
110
{
110
{
111
    unsigned long drift;
111
    unsigned long drift;
112
   
112
   
113
    if (cp0_count_read() < lastcount)
113
    if (cp0_count_read() < lastcount)
114
        /* Count overflow detected */
114
        /* Count overflow detected */