aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/timetc.h
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-10-19 13:54:31 +0300
committerCem Keylan <cem@ckyln.com>2020-10-19 13:54:31 +0300
commit317043010879767bc6a3bef6cbec0c5f300d1ce0 (patch)
tree4bb7c8cd59acb28c4c21eea06cb653f7b82d5aeb /sys/sys/timetc.h
parent54d853eaccae1f4f2e04ae70d79e34cfef86bf67 (diff)
downloadotools-317043010879767bc6a3bef6cbec0c5f300d1ce0.tar.gz
sys: update to 6.8
Diffstat (limited to 'sys/sys/timetc.h')
-rw-r--r--sys/sys/timetc.h34
1 files changed, 29 insertions, 5 deletions
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 <phk@FreeBSD.org>
@@ -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 <machine/timetc.h>
#include <sys/queue.h>
/*-
@@ -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);