MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hardclock_itimer

Function hardclock_itimer

freebsd/kern/kern_clock.c:425–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425static __noinline void
426hardclock_itimer(struct thread *td, struct pstats *pstats, int cnt, int usermode)
427{
428 struct proc *p;
429 int flags;
430
431 flags = 0;
432 p = td->td_proc;
433 if (usermode &&
434 timevalisset(&pstats->p_timer[ITIMER_VIRTUAL].it_value)) {
435 PROC_ITIMLOCK(p);
436 if (itimerdecr(&pstats->p_timer[ITIMER_VIRTUAL],
437 tick * cnt) == 0)
438 flags |= TDF_ALRMPEND | TDF_ASTPENDING;
439 PROC_ITIMUNLOCK(p);
440 }
441 if (timevalisset(&pstats->p_timer[ITIMER_PROF].it_value)) {
442 PROC_ITIMLOCK(p);
443 if (itimerdecr(&pstats->p_timer[ITIMER_PROF],
444 tick * cnt) == 0)
445 flags |= TDF_PROFPEND | TDF_ASTPENDING;
446 PROC_ITIMUNLOCK(p);
447 }
448 if (flags != 0) {
449 thread_lock(td);
450 td->td_flags |= flags;
451 thread_unlock(td);
452 }
453}
454
455void
456hardclock(int cnt, int usermode)

Callers 1

hardclockFunction · 0.85

Calls 1

itimerdecrFunction · 0.70

Tested by

no test coverage detected