diff options
-rw-r--r-- | sys/kern/kern_exec.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_exit.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_time.c | 11 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 7c7a783..488fc59 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysent.h> #include <sys/shm.h> #include <sys/sysctl.h> -#include <sys/timers.h> #include <sys/vnode.h> #ifdef KTRACE #include <sys/ktrace.h> @@ -481,9 +480,6 @@ interpret: */ fdunshare(p, td); - /* Clear POSIX timers */ - itimers_event_hook(p, ITIMER_EV_EXEC); - /* * Malloc things before we need locks. */ diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 6be9c07..024a1f7 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include <sys/mac.h> #include <sys/shm.h> #include <sys/sem.h> -#include <sys/timers.h> #ifdef KTRACE #include <sys/ktrace.h> #endif @@ -232,8 +231,6 @@ retry: sigqueue_flush(&td->td_sigqueue); PROC_UNLOCK(p); - itimers_event_hook(p, ITIMER_EV_EXIT); - /* * Reset any sigio structures pointing to us as a result of * F_SETOWN with our pid. diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 4cba08f..5bbd2f0 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sysproto.h> +#include <sys/eventhandler.h> #include <sys/resourcevar.h> #include <sys/signalvar.h> #include <sys/kernel.h> @@ -86,6 +87,7 @@ static void itimer_enter(struct itimer *); static void itimer_leave(struct itimer *); static struct itimer *itimer_find(struct proc *, timer_t, int); static void itimers_alloc(struct proc *); +static void itimers_event_hook(void *arg, struct proc *p); static int realtimer_create(struct itimer *); static int realtimer_gettime(struct itimer *, struct itimerspec *); static int realtimer_settime(struct itimer *, int, @@ -889,6 +891,10 @@ itimer_start(void) p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX); p31b_setcfg(CTL_P1003_1B_TIMER_MAX, TIMER_MAX); + EVENTHANDLER_REGISTER(process_exit, itimers_event_hook, + (void *)ITIMER_EV_EXIT, EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(process_exec, itimers_event_hook, + (void *)ITIMER_EV_EXEC, EVENTHANDLER_PRI_ANY); } int @@ -1504,11 +1510,12 @@ itimers_alloc(struct proc *p) } /* Clean up timers when some process events are being triggered. */ -void -itimers_event_hook(struct proc *p, int event) +static void +itimers_event_hook(void *arg, struct proc *p) { struct itimers *its; struct itimer *it; + int event = (int)arg; int i; if (p->p_itimers != NULL) { |