* Report or change the active event timers hardware. */
| 886 | * Report or change the active event timers hardware. |
| 887 | */ |
| 888 | static int |
| 889 | sysctl_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 | } |
| 925 | SYSCTL_PROC(_kern_eventtimer, OID_AUTO, timer, |
| 926 | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, |
| 927 | 0, 0, sysctl_kern_eventtimer_timer, "A", "Chosen event timer"); |
nothing calls this directly
no test coverage detected