summaryrefslogtreecommitdiffstats
path: root/sys/mips
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-02-11 06:13:53 +0000
committeradrian <adrian@FreeBSD.org>2016-02-11 06:13:53 +0000
commit570389571c5f6857c10342bb7f19c3c5335c5fab (patch)
tree0bd9c3c673224fd2a642bcee65035ad831e626a1 /sys/mips
parentdd3b3e6ad6132826c9ed9aee3801196746a8a0c2 (diff)
downloadFreeBSD-src-570389571c5f6857c10342bb7f19c3c5335c5fab.zip
FreeBSD-src-570389571c5f6857c10342bb7f19c3c5335c5fab.tar.gz
Teach the MIPS ticker to attach itself properly when using INTRNG.
Submitted by: Stanislav Galabov <sgalabov@gmail.com> Reviewed by: kan Differential Revision: https://reviews.freebsd.org/D5183
Diffstat (limited to 'sys/mips')
-rw-r--r--sys/mips/mips/tick.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/mips/mips/tick.c b/sys/mips/mips/tick.c
index 501e5bb..b146ad7 100644
--- a/sys/mips/mips/tick.c
+++ b/sys/mips/mips/tick.c
@@ -51,6 +51,10 @@ __FBSDID("$FreeBSD$");
#include <machine/locore.h>
#include <machine/md_var.h>
+#ifdef MIPS_INTRNG
+#include <machine/intr.h>
+#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;
OpenPOWER on IntegriCloud