diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index cfca8e6..bee5a62 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,6 +69,7 @@ static void setuptimer(void); static void loadtimer(struct bintime *now, int first); static int doconfigtimer(void); static void configtimer(int start); +static void shutdown_stop_timer(void *junk, int howto); static int round_freq(struct eventtimer *et, int freq); static void getnextcpuevent(struct bintime *event, int idle); @@ -674,6 +676,17 @@ cpu_initclocks_bsp(void) ET_LOCK(); configtimer(1); ET_UNLOCK(); + + EVENTHANDLER_REGISTER(shutdown_final, shutdown_stop_timer, NULL, + SHUTDOWN_PRI_LAST + 150); +} + +static void +shutdown_stop_timer(void *unused __unused, int howto __unused) +{ + + printf("Stopping clock timers...\n"); + configtimer(0); } /*