aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/isa/clock.c
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>2008-05-24 06:27:54 +0000
committerJohn Birrell <jb@FreeBSD.org>2008-05-24 06:27:54 +0000
commitf1bd3c150c21a75b520a3fb25e23f47beb3224eb (patch)
tree79b46428e0d7daf270d5fbbb1cdbd0a13edd372c /sys/i386/isa/clock.c
parent15653bada1af513299ba17e0463fa7eaa99cfbff (diff)
downloadsrc-f1bd3c150c21a75b520a3fb25e23f47beb3224eb.tar.gz
src-f1bd3c150c21a75b520a3fb25e23f47beb3224eb.zip
Add a cyclic hook for DTrace.
Notes
Notes: svn path=/head/; revision=179278
Diffstat (limited to 'sys/i386/isa/clock.c')
-rw-r--r--sys/i386/isa/clock.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index 93a06a3b9a13..b908c3476045 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include "opt_apic.h"
#include "opt_clock.h"
+#include "opt_kdtrace.h"
#include "opt_isa.h"
#include "opt_mca.h"
#include "opt_xbox.h"
@@ -79,6 +80,10 @@ __FBSDID("$FreeBSD$");
#include <i386/bios/mca_machdep.h>
#endif
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+#endif
+
#define TIMER_DIV(x) ((i8254_freq + (x) / 2) / (x))
int clkintr_pending;
@@ -138,6 +143,18 @@ clkintr(struct trapframe *frame)
mtx_unlock_spin(&clock_lock);
}
KASSERT(!using_lapic_timer, ("clk interrupt enabled with lapic timer"));
+
+#ifdef KDTRACE_HOOKS
+ /*
+ * If the DTrace hooks are configured and a callback function
+ * has been registered, then call it to process the high speed
+ * timers.
+ */
+ int cpu = PCPU_GET(cpuid);
+ if (lapic_cyclic_clock_func[cpu] != NULL)
+ (*lapic_cyclic_clock_func[cpu])(frame);
+#endif
+
hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame));
#ifdef DEV_MCA
/* Reset clock interrupt by asserting bit 7 of port 0x61 */