Tue Jul 20 08:37:20 2021 UTC ()
no need for extern kmutex_t itimer_mutex or #include <sys/mutex.h> here.


(skrll)
diff -r1.47 -r1.48 src/sys/sys/timevar.h

cvs diff -r1.47 -r1.48 src/sys/sys/timevar.h (expand / switch to unified diff)

--- src/sys/sys/timevar.h 2021/07/20 08:36:11 1.47
+++ src/sys/sys/timevar.h 2021/07/20 08:37:20 1.48
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: timevar.h,v 1.47 2021/07/20 08:36:11 skrll Exp $ */ 1/* $NetBSD: timevar.h,v 1.48 2021/07/20 08:37:20 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005, 2008, 2020 The NetBSD Foundation, Inc. 4 * Copyright (c) 2005, 2008, 2020 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -54,27 +54,26 @@ @@ -54,27 +54,26 @@
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE. 55 * SUCH DAMAGE.
56 * 56 *
57 * @(#)time.h 8.5 (Berkeley) 5/4/95 57 * @(#)time.h 8.5 (Berkeley) 5/4/95
58 */ 58 */
59 59
60#ifndef _SYS_TIMEVAR_H_ 60#ifndef _SYS_TIMEVAR_H_
61#define _SYS_TIMEVAR_H_ 61#define _SYS_TIMEVAR_H_
62 62
63#include <sys/callout.h> 63#include <sys/callout.h>
64#include <sys/queue.h> 64#include <sys/queue.h>
65#include <sys/signal.h> 65#include <sys/signal.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67#include <sys/mutex.h> 
68 67
69struct itimer; 68struct itimer;
70LIST_HEAD(itlist, itimer); 69LIST_HEAD(itlist, itimer);
71 70
72/* 71/*
73 * Interval timer operations vector. 72 * Interval timer operations vector.
74 * 73 *
75 * Required fields: 74 * Required fields:
76 * 75 *
77 * - ito_fire: A function to be called when the itimer fires. 76 * - ito_fire: A function to be called when the itimer fires.
78 * The timer implementation should perform whatever processing 77 * The timer implementation should perform whatever processing
79 * is necessary for that timer type. 78 * is necessary for that timer type.
80 * 79 *
@@ -133,28 +132,26 @@ struct ptimer { @@ -133,28 +132,26 @@ struct ptimer {
133 132
134#define TIMER_MIN 4 /* [0..3] are reserved for setitimer(2) */ 133#define TIMER_MIN 4 /* [0..3] are reserved for setitimer(2) */
135 /* REAL=0,VIRTUAL=1,PROF=2,MONOTONIC=3 */ 134 /* REAL=0,VIRTUAL=1,PROF=2,MONOTONIC=3 */
136#define TIMER_MAX 36 /* 32 is minimum user timers per POSIX */ 135#define TIMER_MAX 36 /* 32 is minimum user timers per POSIX */
137#define TIMERS_ALL 0 136#define TIMERS_ALL 0
138#define TIMERS_POSIX 1 137#define TIMERS_POSIX 1
139 138
140struct ptimers { 139struct ptimers {
141 struct itlist pts_virtual; 140 struct itlist pts_virtual;
142 struct itlist pts_prof; 141 struct itlist pts_prof;
143 struct itimer *pts_timers[TIMER_MAX]; 142 struct itimer *pts_timers[TIMER_MAX];
144}; 143};
145 144
146extern kmutex_t itimer_mutex; /* XXX */ 
147 
148/* 145/*
149 * Functions for looking at our clock: [get]{bin,nano,micro}[up]time() 146 * Functions for looking at our clock: [get]{bin,nano,micro}[up]time()
150 * 147 *
151 * Functions without the "get" prefix returns the best timestamp 148 * Functions without the "get" prefix returns the best timestamp
152 * we can produce in the given format. 149 * we can produce in the given format.
153 * 150 *
154 * "bin" == struct bintime == seconds + 64 bit fraction of seconds. 151 * "bin" == struct bintime == seconds + 64 bit fraction of seconds.
155 * "nano" == struct timespec == seconds + nanoseconds. 152 * "nano" == struct timespec == seconds + nanoseconds.
156 * "micro" == struct timeval == seconds + microseconds. 153 * "micro" == struct timeval == seconds + microseconds.
157 * 154 *
158 * Functions containing "up" returns time relative to boot and 155 * Functions containing "up" returns time relative to boot and
159 * should be used for calculating time intervals. 156 * should be used for calculating time intervals.
160 * 157 *