| 423 | } |
| 424 | |
| 425 | static __noinline void |
| 426 | hardclock_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 | |
| 455 | void |
| 456 | hardclock(int cnt, int usermode) |
no test coverage detected