summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/dev/agtimer.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-01-31 10:52:13 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-01-31 10:52:13 +0000
commitc776c8d520eaf8f69b7a9ecdaeb5cef377714c30 (patch)
tree92d77551e9940330ce0fd0dc82246993862c9d15 /sys/arch/arm64/dev/agtimer.c
parentb6527ed18bd1fbe0863f493c4f1ac8f0f4794f6f (diff)
Add MULTIPROCESSOR support to the interrupt controller drivers. This makes
the secondary CPUs receive clock interrupts. Based on diffs from drahn@. ok patrick@
Diffstat (limited to 'sys/arch/arm64/dev/agtimer.c')
-rw-r--r--sys/arch/arm64/dev/agtimer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/agtimer.c b/sys/arch/arm64/dev/agtimer.c
index ef8025444bb..0e6e6a3bc6e 100644
--- a/sys/arch/arm64/dev/agtimer.c
+++ b/sys/arch/arm64/dev/agtimer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agtimer.c,v 1.8 2017/03/26 18:27:55 drahn Exp $ */
+/* $OpenBSD: agtimer.c,v 1.9 2018/01/31 10:52:12 kettenis Exp $ */
/*
* Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2013 Patrick Wildt <patrick@blueri.se>
@@ -70,6 +70,7 @@ struct agtimer_softc {
struct evcount sc_clk_count;
struct evcount sc_stat_count;
#endif
+ void *sc_ih;
};
int agtimer_match(struct device *, void *, void *);
@@ -297,8 +298,8 @@ agtimer_cpu_initclocks()
pc->pc_ticks_err_sum = 0;
/* configure virtual timer interupt */
- arm_intr_establish_fdt_idx(sc->sc_node, 2, IPL_CLOCK,
- agtimer_intr, NULL, "tick");
+ sc->sc_ih = arm_intr_establish_fdt_idx(sc->sc_node, 2,
+ IPL_CLOCK|IPL_MPSAFE, agtimer_intr, NULL, "tick");
next = agtimer_readcnt64() + sc->sc_ticks_per_intr;
pc->pc_nexttickevent = pc->pc_nextstatevent = next;
@@ -378,6 +379,8 @@ agtimer_startclock(void)
nextevent = agtimer_readcnt64() + sc->sc_ticks_per_intr;
pc->pc_nexttickevent = pc->pc_nextstatevent = nextevent;
+ arm_intr_route(sc->sc_ih, 1, curcpu());
+
reg = agtimer_get_ctrl();
reg &= ~GTIMER_CNTV_CTL_IMASK;
reg |= GTIMER_CNTV_CTL_ENABLE;