summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_et.c
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-05-17 20:10:12 +0000
committerian <ian@FreeBSD.org>2014-05-17 20:10:12 +0000
commit9f4d42e0d5ac9fd53ce7499b7ba78d5c2f392dcf (patch)
tree66ee73217081a18f0aebac5e3c89d11ff179ea73 /sys/kern/kern_et.c
parentaa723a2c5a49290b58ee56c47638f702d3422410 (diff)
downloadFreeBSD-src-9f4d42e0d5ac9fd53ce7499b7ba78d5c2f392dcf.zip
FreeBSD-src-9f4d42e0d5ac9fd53ce7499b7ba78d5c2f392dcf.tar.gz
MFC 264019, 264041, 264048, 264049, 264050, 264051
Add support for event timers whose clock frequency can change while running. Apparently all ARM configs build kern_et.c, but only a few of them also build kern_clocksource.c, un-break the build by not referencing functions in kern_clocksource if NO_EVENTTIMERS is defined. Add variable-frequency support to the arm mpcore eventtimer driver. mpcore_timer: Disable the timer and clear any pending bit, then setup the new counter register values, then restart the timer. Also re-nest the parens properly for casting the result of converting time and frequency to a count.
Diffstat (limited to 'sys/kern/kern_et.c')
-rw-r--r--sys/kern/kern_et.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/kern/kern_et.c b/sys/kern/kern_et.c
index d07316c..544e6e4 100644
--- a/sys/kern/kern_et.c
+++ b/sys/kern/kern_et.c
@@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$");
#include <sys/queue.h>
#include <sys/timeet.h>
+#include "opt_timer.h"
+
SLIST_HEAD(et_eventtimers_list, eventtimer);
static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers);
@@ -113,6 +115,20 @@ et_deregister(struct eventtimer *et)
}
/*
+ * Change the frequency of the given timer. If it is the active timer,
+ * reconfigure it on all CPUs (reschedules all current events based on the new
+ * timer frequency).
+ */
+void
+et_change_frequency(struct eventtimer *et, uint64_t newfreq)
+{
+
+#ifndef NO_EVENTTIMERS
+ cpu_et_frequency(et, newfreq);
+#endif
+}
+
+/*
* Find free event timer hardware with specified parameters.
*/
struct eventtimer *
OpenPOWER on IntegriCloud