Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_tc.c
Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
static struct timehands *volatile timehands = &ths[0]; | static struct timehands *volatile timehands = &ths[0]; | ||||
struct timecounter *timecounter = &dummy_timecounter; | struct timecounter *timecounter = &dummy_timecounter; | ||||
static struct timecounter *timecounters = &dummy_timecounter; | static struct timecounter *timecounters = &dummy_timecounter; | ||||
/* Mutex to protect the timecounter list. */ | /* Mutex to protect the timecounter list. */ | ||||
static struct mtx tc_lock; | static struct mtx tc_lock; | ||||
MTX_SYSINIT(tc_lock, &tc_lock, "tc", MTX_DEF); | |||||
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; | ||||
/* | /* | ||||
* The system time is always computed by summing the estimated boot time and the | * The system time is always computed by summing the estimated boot time and the | ||||
▲ Show 20 Lines • Show All 1,873 Lines • ▼ Show 20 Lines | inittimehands(void *dummy) | ||||
if (timehands_count > nitems(ths)) | if (timehands_count > nitems(ths)) | ||||
timehands_count = nitems(ths); | timehands_count = nitems(ths); | ||||
for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) | for (i = 1, thp = &ths[0]; i < timehands_count; thp = &ths[i++]) | ||||
thp->th_next = &ths[i]; | thp->th_next = &ths[i]; | ||||
thp->th_next = &ths[0]; | thp->th_next = &ths[0]; | ||||
TUNABLE_STR_FETCH("kern.timecounter.hardware", tc_from_tunable, | TUNABLE_STR_FETCH("kern.timecounter.hardware", tc_from_tunable, | ||||
sizeof(tc_from_tunable)); | sizeof(tc_from_tunable)); | ||||
mtx_init(&tc_lock, "tc", NULL, MTX_DEF); | |||||
} | } | ||||
SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL); | SYSINIT(timehands, SI_SUB_TUNABLES, SI_ORDER_ANY, inittimehands, NULL); | ||||
static void | static void | ||||
inittimecounter(void *dummy) | inittimecounter(void *dummy) | ||||
{ | { | ||||
u_int p; | u_int p; | ||||
int tick_rate; | int tick_rate; | ||||
▲ Show 20 Lines • Show All 269 Lines • Show Last 20 Lines |