kern_tc.c (215281) | kern_tc.c (215283) |
---|---|
1/*- 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 */ 9 10#include <sys/cdefs.h> | 1/*- 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 */ 9 10#include <sys/cdefs.h> |
11__FBSDID("$FreeBSD: head/sys/kern/kern_tc.c 215281 2010-11-14 06:09:50Z brucec $"); | 11__FBSDID("$FreeBSD: head/sys/kern/kern_tc.c 215283 2010-11-14 08:06:29Z brucec $"); |
12 13#include "opt_ntp.h" 14 15#include <sys/param.h> 16#include <sys/kernel.h> 17#include <sys/sysctl.h> 18#include <sys/syslog.h> 19#include <sys/systm.h> --- 535 unchanged lines hidden (view full) --- 555 556 timecounter = newtc; 557 return (0); 558 } 559 return (EINVAL); 560} 561 562SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RW, | 12 13#include "opt_ntp.h" 14 15#include <sys/param.h> 16#include <sys/kernel.h> 17#include <sys/sysctl.h> 18#include <sys/syslog.h> 19#include <sys/systm.h> --- 535 unchanged lines hidden (view full) --- 555 556 timecounter = newtc; 557 return (0); 558 } 559 return (EINVAL); 560} 561 562SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RW, |
563 0, 0, sysctl_kern_timecounter_hardware, "A", "Timecounter hardware selected"); | 563 0, 0, sysctl_kern_timecounter_hardware, "A", 564 "Timecounter hardware selected"); |
564 565 566/* Report or change the active timecounter hardware. */ 567static int 568sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) 569{ 570 char buf[32], *spc; 571 struct timecounter *tc; --- 191 unchanged lines hidden (view full) --- 763/* 764 * Timecounters need to be updated every so often to prevent the hardware 765 * counter from overflowing. Updating also recalculates the cached values 766 * used by the get*() family of functions, so their precision depends on 767 * the update frequency. 768 */ 769 770static int tc_tick; | 565 566 567/* Report or change the active timecounter hardware. */ 568static int 569sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) 570{ 571 char buf[32], *spc; 572 struct timecounter *tc; --- 191 unchanged lines hidden (view full) --- 764/* 765 * Timecounters need to be updated every so often to prevent the hardware 766 * counter from overflowing. Updating also recalculates the cached values 767 * used by the get*() family of functions, so their precision depends on 768 * the update frequency. 769 */ 770 771static int tc_tick; |
771SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, "Approximate number of hardclock ticks in a millisecond"); | 772SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, 773 "Approximate number of hardclock ticks in a millisecond"); |
772 773void 774tc_ticktock(int cnt) 775{ 776 static int count; 777 778 count += cnt; 779 if (count < tc_tick) --- 165 unchanged lines hidden --- | 774 775void 776tc_ticktock(int cnt) 777{ 778 static int count; 779 780 count += cnt; 781 if (count < tc_tick) --- 165 unchanged lines hidden --- |