#include <asm/leds.h>
#include <asm/mach/time.h>
+#include "common.h"
+
static struct amba_device rtc_device = {
.dev = {
.bus_id = "mb:15",
#define CM_CTRL IO_ADDRESS(INTEGRATOR_HDR_BASE) + INTEGRATOR_HDR_CTRL_OFFSET
-static spinlock_t cm_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(cm_lock);
/**
* cm_control - update the CM_CTRL register.
unsigned long TimerClear;
} TimerStruct_t;
-extern unsigned long (*gettimeoffset)(void);
-
static unsigned long timer_reload;
/*
* Returns number of ms since last clock interrupt. Note that interrupts
* will have been disabled by do_gettimeoffset()
*/
-static unsigned long integrator_gettimeoffset(void)
+unsigned long integrator_gettimeoffset(void)
{
volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE;
unsigned long ticks1, ticks2, status;
{
volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
+ write_seqlock(&xtime_lock);
+
// ...clear the interrupt
timer1->TimerClear = 1;
timer_tick(regs);
+ write_sequnlock(&xtime_lock);
+
return IRQ_HANDLED;
}
* Make irqs happen for the system timer
*/
setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
- gettimeoffset = integrator_gettimeoffset;
}