From 317043010879767bc6a3bef6cbec0c5f300d1ce0 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Mon, 19 Oct 2020 13:54:31 +0300 Subject: sys: update to 6.8 --- sys/sys/timetc.h | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'sys/sys/timetc.h') diff --git a/sys/sys/timetc.h b/sys/sys/timetc.h index ce81c34..dccee13 100644 --- a/sys/sys/timetc.h +++ b/sys/sys/timetc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: timetc.h,v 1.10 2019/10/26 21:16:38 cheloha Exp $ */ +/* $OpenBSD: timetc.h,v 1.12 2020/07/06 13:33:09 pirofti Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp @@ -24,10 +24,11 @@ #ifndef _SYS_TIMETC_H_ #define _SYS_TIMETC_H_ -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_LIBC) #error "no user-serviceable parts inside" #endif +#include #include /*- @@ -48,8 +49,8 @@ typedef void timecounter_pps_t(struct timecounter *); /* * Locks used to protect struct members in this file: * I immutable after initialization - * t tc_lock - * w windup_mtx + * T tc_lock + * W windup_mtx */ struct timecounter { @@ -80,19 +81,42 @@ struct timecounter { */ void *tc_priv; /* [I] */ /* Pointer to the timecounter's private parts. */ + int tc_user; /* [I] */ + /* Expose this timecounter to userland. */ SLIST_ENTRY(timecounter) tc_next; /* [I] */ /* Pointer to the next timecounter. */ - int64_t tc_freq_adj; /* [tw] */ + int64_t tc_freq_adj; /* [T,W] */ /* Current frequency adjustment. */ u_int64_t tc_precision; /* [I] */ /* Precision of the counter. Computed in tc_init(). */ }; +struct timekeep { + /* set at initialization */ + uint32_t tk_version; /* version number */ + + /* timehands members */ + uint64_t tk_scale; + u_int tk_offset_count; + struct bintime tk_offset; + struct bintime tk_naptime; + struct bintime tk_boottime; + volatile u_int tk_generation; + + /* timecounter members */ + int tk_user; + u_int tk_counter_mask; +}; +#define TK_VERSION 0 + struct rwlock; extern struct rwlock tc_lock; extern struct timecounter *timecounter; +extern struct uvm_object *timekeep_object; +extern struct timekeep *timekeep; + u_int64_t tc_getfrequency(void); u_int64_t tc_getprecision(void); void tc_init(struct timecounter *tc); -- cgit v1.2.3