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

Function sysctl_kern_eventtimer_timer

freebsd/kern/kern_clocksource.c:888–924  ·  view source on GitHub ↗

* Report or change the active event timers hardware. */

Source from the content-addressed store, hash-verified

886 * Report or change the active event timers hardware.
887 */
888static int
889sysctl_kern_eventtimer_timer(SYSCTL_HANDLER_ARGS)
890{
891 char buf[32];
892 struct eventtimer *et;
893 int error;
894
895 ET_LOCK();
896 et = timer;
897 snprintf(buf, sizeof(buf), "%s", et->et_name);
898 ET_UNLOCK();
899 error = sysctl_handle_string(oidp, buf, sizeof(buf), req);
900 ET_LOCK();
901 et = timer;
902 if (error != 0 || req->newptr == NULL ||
903 strcasecmp(buf, et->et_name) == 0) {
904 ET_UNLOCK();
905 return (error);
906 }
907 et = et_find(buf, 0, 0);
908 if (et == NULL) {
909 ET_UNLOCK();
910 return (ENOENT);
911 }
912 configtimer(0);
913 et_free(timer);
914 if (et->et_flags & ET_FLAGS_C3STOP)
915 cpu_disable_c3_sleep++;
916 if (timer->et_flags & ET_FLAGS_C3STOP)
917 cpu_disable_c3_sleep--;
918 periodic = want_periodic;
919 timer = et;
920 et_init(timer, timercb, NULL, NULL);
921 configtimer(1);
922 ET_UNLOCK();
923 return (error);
924}
925SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer,
926 CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE,
927 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer");

Callers

nothing calls this directly

Calls 6

snprintfFunction · 0.85
sysctl_handle_stringFunction · 0.85
strcasecmpFunction · 0.85
et_findFunction · 0.85
et_freeFunction · 0.85
et_initFunction · 0.85

Tested by

no test coverage detected