summaryrefslogtreecommitdiff
path: root/sys/kern/kern_clock.c
diff options
context:
space:
mode:
authorJohn Birrell <jb@FreeBSD.org>2006-10-26 21:42:22 +0000
committerJohn Birrell <jb@FreeBSD.org>2006-10-26 21:42:22 +0000
commit8460a577a4b4ec185bd813188a5b188893b8c140 (patch)
tree2136d90e7e60f4ef25fe147499787d0e6a155b82 /sys/kern/kern_clock.c
parent50159fa2161d549dbe2cb3ff9db1cc3816d48c37 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_clock.c')
-rw-r--r--sys/kern/kern_clock.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c
index ea1a6f1ca6ab2..cd98bdd26ee98 100644
--- a/sys/kern/kern_clock.c
+++ b/sys/kern/kern_clock.c
@@ -202,6 +202,7 @@ hardclock_cpu(int usermode)
*/
mtx_lock_spin_flags(&sched_lock, MTX_QUIET);
sched_tick();
+#ifdef KSE
if (p->p_flag & P_SA) {
/* XXXKSE What to do? */
} else {
@@ -218,6 +219,20 @@ hardclock_cpu(int usermode)
td->td_flags |= TDF_ASTPENDING;
}
}
+#else
+ pstats = p->p_stats;
+ if (usermode &&
+ timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value) &&
+ itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL], tick) == 0) {
+ p->p_sflag |= PS_ALRMPEND;
+ td->td_flags |= TDF_ASTPENDING;
+ }
+ if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value) &&
+ itimerdecr(&pstats->p_timer[ITIMER_PROF], tick) == 0) {
+ p->p_sflag |= PS_PROFPEND;
+ td->td_flags |= TDF_ASTPENDING;
+ }
+#endif
mtx_unlock_spin_flags(&sched_lock, MTX_QUIET);
#ifdef HWPMC_HOOKS
@@ -414,8 +429,10 @@ statclock(int usermode)
/*
* Charge the time as appropriate.
*/
+#ifdef KSE
if (p->p_flag & P_SA)
thread_statclock(1);
+#endif
td->td_uticks++;
if (p->p_nice > NZERO)
cp_time[CP_NICE]++;
@@ -439,8 +456,10 @@ statclock(int usermode)
td->td_iticks++;
cp_time[CP_INTR]++;
} else {
+#ifdef KSE
if (p->p_flag & P_SA)
thread_statclock(0);
+#endif
td->td_pticks++;
td->td_sticks++;
if (td != PCPU_GET(idlethread))