Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_tc.c
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
static struct timecounter *timecounters = &dummy_timecounter; | static struct timecounter *timecounters = &dummy_timecounter; | ||||
int tc_min_ticktock_freq = 1; | int tc_min_ticktock_freq = 1; | ||||
volatile time_t time_second = 1; | volatile time_t time_second = 1; | ||||
volatile time_t time_uptime = 1; | volatile time_t time_uptime = 1; | ||||
static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); | static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); | ||||
SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, | SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, | ||||
NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime"); | CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, | ||||
NULL, 0, sysctl_kern_boottime, "S,timeval", | |||||
"System boottime"); | |||||
SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, ""); | SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, ""); | ||||
static SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, CTLFLAG_RW, 0, ""); | static SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, CTLFLAG_RW, 0, ""); | ||||
static int timestepwarnings; | static int timestepwarnings; | ||||
SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, | SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, | ||||
×tepwarnings, 0, "Log time steps"); | ×tepwarnings, 0, "Log time steps"); | ||||
▲ Show 20 Lines • Show All 1,416 Lines • ▼ Show 20 Lines | for (newtc = timecounters; newtc != NULL; newtc = newtc->tc_next) { | ||||
* use any locking and that it can be called in hard interrupt | * use any locking and that it can be called in hard interrupt | ||||
* context via 'tc_windup()'. | * context via 'tc_windup()'. | ||||
*/ | */ | ||||
return (0); | return (0); | ||||
} | } | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RW, | SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, | ||||
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | |||||
0, 0, sysctl_kern_timecounter_hardware, "A", | 0, 0, sysctl_kern_timecounter_hardware, "A", | ||||
"Timecounter hardware selected"); | "Timecounter hardware selected"); | ||||
/* Report the available timecounter hardware. */ | /* Report the available timecounter hardware. */ | ||||
static int | static int | ||||
sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) | sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) | ||||
{ | { | ||||
struct sbuf sb; | struct sbuf sb; | ||||
struct timecounter *tc; | struct timecounter *tc; | ||||
int error; | int error; | ||||
sbuf_new_for_sysctl(&sb, NULL, 0, req); | sbuf_new_for_sysctl(&sb, NULL, 0, req); | ||||
for (tc = timecounters; tc != NULL; tc = tc->tc_next) { | for (tc = timecounters; tc != NULL; tc = tc->tc_next) { | ||||
if (tc != timecounters) | if (tc != timecounters) | ||||
sbuf_putc(&sb, ' '); | sbuf_putc(&sb, ' '); | ||||
sbuf_printf(&sb, "%s(%d)", tc->tc_name, tc->tc_quality); | sbuf_printf(&sb, "%s(%d)", tc->tc_name, tc->tc_quality); | ||||
} | } | ||||
error = sbuf_finish(&sb); | error = sbuf_finish(&sb); | ||||
sbuf_delete(&sb); | sbuf_delete(&sb); | ||||
return (error); | return (error); | ||||
} | } | ||||
SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD, | SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, | ||||
0, 0, sysctl_kern_timecounter_choice, "A", "Timecounter hardware detected"); | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, | ||||
0, 0, sysctl_kern_timecounter_choice, "A", | |||||
"Timecounter hardware detected"); | |||||
/* | /* | ||||
* RFC 2783 PPS-API implementation. | * RFC 2783 PPS-API implementation. | ||||
*/ | */ | ||||
/* | /* | ||||
* Return true if the driver is aware of the abi version extensions in the | * Return true if the driver is aware of the abi version extensions in the | ||||
* pps_state structure, and it supports at least the given abi version number. | * pps_state structure, and it supports at least the given abi version number. | ||||
▲ Show 20 Lines • Show All 653 Lines • Show Last 20 Lines |