| 1684 | } |
| 1685 | |
| 1686 | static void |
| 1687 | itimers_alloc(struct proc *p) |
| 1688 | { |
| 1689 | struct itimers *its; |
| 1690 | int i; |
| 1691 | |
| 1692 | its = malloc(sizeof (struct itimers), M_SUBPROC, M_WAITOK | M_ZERO); |
| 1693 | LIST_INIT(&its->its_virtual); |
| 1694 | LIST_INIT(&its->its_prof); |
| 1695 | TAILQ_INIT(&its->its_worklist); |
| 1696 | for (i = 0; i < TIMER_MAX; i++) |
| 1697 | its->its_timers[i] = NULL; |
| 1698 | PROC_LOCK(p); |
| 1699 | if (p->p_itimers == NULL) { |
| 1700 | p->p_itimers = its; |
| 1701 | PROC_UNLOCK(p); |
| 1702 | } |
| 1703 | else { |
| 1704 | PROC_UNLOCK(p); |
| 1705 | free(its, M_SUBPROC); |
| 1706 | } |
| 1707 | } |
| 1708 | |
| 1709 | /* Clean up timers when some process events are being triggered. */ |
| 1710 | static void |
no test coverage detected