From 4d125f57e13d70b60b39ea32cff9e7a137a7b190 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 11 Feb 2016 06:13:53 +0000 Subject: [PATCH] Teach the MIPS ticker to attach itself properly when using INTRNG. Submitted by: Stanislav Galabov Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5183 --- sys/mips/mips/tick.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/mips/mips/tick.c b/sys/mips/mips/tick.c index 501e5bb7f3a0..b146ad7d3116 100644 --- a/sys/mips/mips/tick.c +++ b/sys/mips/mips/tick.c @@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MIPS_INTRNG +#include +#endif + uint64_t counter_freq; struct timecounter *platform_timecounter; @@ -324,12 +328,18 @@ static int clock_attach(device_t dev) { struct clock_softc *sc; +#ifndef MIPS_INTRNG int error; +#endif if (device_get_unit(dev) != 0) panic("can't attach more clocks"); softc = sc = device_get_softc(dev); +#ifdef MIPS_INTRNG + cpu_establish_hardintr("clock", clock_intr, NULL, sc, 5, INTR_TYPE_CLK, + NULL); +#else sc->intr_rid = 0; sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 5, 5, 1, RF_ACTIVE); @@ -343,6 +353,7 @@ clock_attach(device_t dev) device_printf(dev, "bus_setup_intr returned %d\n", error); return (error); } +#endif sc->tc.tc_get_timecount = counter_get_timecount; sc->tc.tc_counter_mask = 0xffffffff;