Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/timetc.h
Show All 22 Lines | |||||
* A timecounter is a binary counter which has two properties: | * A timecounter is a binary counter which has two properties: | ||||
* * it runs at a fixed, known frequency. | * * it runs at a fixed, known frequency. | ||||
* * it has sufficient bits to not roll over in less than approximately | * * it has sufficient bits to not roll over in less than approximately | ||||
* max(2 msec, 2/HZ seconds). (The value 2 here is really 1 + delta, | * max(2 msec, 2/HZ seconds). (The value 2 here is really 1 + delta, | ||||
* for some indeterminate value of delta.) | * for some indeterminate value of delta.) | ||||
*/ | */ | ||||
struct timecounter; | struct timecounter; | ||||
struct vdso_timehands; | |||||
struct vdso_timehands32; | |||||
typedef u_int timecounter_get_t(struct timecounter *); | typedef u_int timecounter_get_t(struct timecounter *); | ||||
typedef void timecounter_pps_t(struct timecounter *); | typedef void timecounter_pps_t(struct timecounter *); | ||||
typedef uint32_t timecounter_fill_vdso_timehands_t(struct vdso_timehands *, | |||||
struct timecounter *); | |||||
typedef uint32_t timecounter_fill_vdso_timehands32_t(struct vdso_timehands32 *, | |||||
struct timecounter *); | |||||
struct timecounter { | struct timecounter { | ||||
timecounter_get_t *tc_get_timecount; | timecounter_get_t *tc_get_timecount; | ||||
/* | /* | ||||
* This function reads the counter. It is not required to | * This function reads the counter. It is not required to | ||||
* mask any unimplemented bits out, as long as they are | * mask any unimplemented bits out, as long as they are | ||||
* constant. | * constant. | ||||
*/ | */ | ||||
Show All 22 Lines | #define TC_FLAGS_SUSPEND_SAFE 2 /* | ||||
* Timer functional across | * Timer functional across | ||||
* suspend/resume. | * suspend/resume. | ||||
*/ | */ | ||||
void *tc_priv; | void *tc_priv; | ||||
/* Pointer to the timecounter's private parts. */ | /* Pointer to the timecounter's private parts. */ | ||||
struct timecounter *tc_next; | struct timecounter *tc_next; | ||||
/* Pointer to the next timecounter. */ | /* Pointer to the next timecounter. */ | ||||
timecounter_fill_vdso_timehands_t *tc_fill_vdso_timehands; | |||||
timecounter_fill_vdso_timehands32_t *tc_fill_vdso_timehands32; | |||||
}; | }; | ||||
extern struct timecounter *timecounter; | extern struct timecounter *timecounter; | ||||
extern int tc_min_ticktock_freq; /* | extern int tc_min_ticktock_freq; /* | ||||
* Minimal tc_ticktock() call frequency, | * Minimal tc_ticktock() call frequency, | ||||
* required to handle counter wraps. | * required to handle counter wraps. | ||||
*/ | */ | ||||
Show All 11 Lines |