diff options
Diffstat (limited to 'arch/mips/kernel/irq-gic.c')
-rw-r--r-- | arch/mips/kernel/irq-gic.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c index eaf7c1eb873e..6a476e1d41eb 100644 --- a/arch/mips/kernel/irq-gic.c +++ b/arch/mips/kernel/irq-gic.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
12 | #include <linux/irq.h> | 12 | #include <linux/irq.h> |
13 | #include <linux/clocksource.h> | ||
13 | 14 | ||
14 | #include <asm/io.h> | 15 | #include <asm/io.h> |
15 | #include <asm/gic.h> | 16 | #include <asm/gic.h> |
@@ -32,6 +33,21 @@ static struct gic_pcpu_mask pcpu_masks[NR_CPUS]; | |||
32 | static struct gic_pending_regs pending_regs[NR_CPUS]; | 33 | static struct gic_pending_regs pending_regs[NR_CPUS]; |
33 | static struct gic_intrmask_regs intrmask_regs[NR_CPUS]; | 34 | static struct gic_intrmask_regs intrmask_regs[NR_CPUS]; |
34 | 35 | ||
36 | #ifdef CONFIG_CSRC_GIC | ||
37 | cycle_t gic_read_count(void) | ||
38 | { | ||
39 | unsigned int hi, hi2, lo; | ||
40 | |||
41 | do { | ||
42 | GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_63_32), hi); | ||
43 | GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_31_00), lo); | ||
44 | GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_63_32), hi2); | ||
45 | } while (hi2 != hi); | ||
46 | |||
47 | return (((cycle_t) hi) << 32) + lo; | ||
48 | } | ||
49 | #endif | ||
50 | |||
35 | unsigned int gic_get_timer_pending(void) | 51 | unsigned int gic_get_timer_pending(void) |
36 | { | 52 | { |
37 | unsigned int vpe_pending; | 53 | unsigned int vpe_pending; |