Print this page
re #13613 rb4516 Tunables needs volatile keyword
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/timer.h
+++ new/usr/src/uts/common/sys/timer.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
|
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 +/*
27 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
28 + */
26 29
27 30 /*
28 31 * Copyright (c) 2015, Joyent, Inc. All rights reserved.
29 32 */
30 33
31 34 #ifndef _SYS_TIMER_H
32 35 #define _SYS_TIMER_H
33 36
34 37 #include <sys/types.h>
35 38 #include <sys/proc.h>
36 39 #include <sys/thread.h>
37 40
38 41 #ifdef __cplusplus
39 42 extern "C" {
40 43 #endif
41 44
42 45 #ifdef _KERNEL
43 46
44 47 #define _TIMER_MAX 32
45 -extern int timer_max; /* patchable via /etc/system */
48 +extern volatile int timer_max; /* patchable via /etc/system */
46 49
47 50 /*
48 51 * Bit values for the it_lock field.
49 52 */
50 53 #define ITLK_LOCKED 0x01
51 54 #define ITLK_WANTED 0x02
52 55 #define ITLK_REMOVE 0x04
53 56
54 57 /*
55 58 * Bit values for the it_flags field.
56 59 */
57 60 #define IT_SIGNAL 0x01
58 61 #define IT_PORT 0x02 /* use event port notification */
59 62
60 63 struct clock_backend;
61 64
62 65 struct itimer;
63 66 typedef struct itimer itimer_t;
64 67
65 68 struct itimer {
66 69 itimerspec_t it_itime;
67 70 hrtime_t it_hrtime;
68 71 ushort_t it_flags;
69 72 ushort_t it_lock;
70 73 void *it_arg; /* clock backend-specific data */
71 74 struct proc *it_proc;
72 75 union {
73 76 struct {
74 77 sigqueue_t *__it_sigq;
75 78 klwp_t *__it_lwp;
76 79 } __proc;
77 80 void *__it_frontend;
78 81 } __data; /* timer frontend-specific data */
79 82 kcondvar_t it_cv;
80 83 int it_blockers;
81 84 int it_pending;
82 85 int it_overrun;
83 86 struct clock_backend *it_backend;
84 87 void (*it_fire)(itimer_t *);
85 88 kmutex_t it_mutex;
86 89 void *it_portev; /* port_kevent_t pointer */
87 90 void *it_portsrc; /* port_source_t pointer */
88 91 int it_portfd; /* port file descriptor */
89 92 };
90 93
91 94 #define it_sigq __data.__proc.__it_sigq
92 95 #define it_lwp __data.__proc.__it_lwp
93 96 #define it_frontend __data.__it_frontend
94 97
95 98 typedef struct clock_backend {
96 99 struct sigevent clk_default;
97 100 int (*clk_clock_settime)(timespec_t *);
98 101 int (*clk_clock_gettime)(timespec_t *);
99 102 int (*clk_clock_getres)(timespec_t *);
100 103 int (*clk_timer_create)(itimer_t *, void (*)(itimer_t *));
101 104 int (*clk_timer_settime)(itimer_t *, int, const struct itimerspec *);
102 105 int (*clk_timer_gettime)(itimer_t *, struct itimerspec *);
103 106 int (*clk_timer_delete)(itimer_t *);
104 107 void (*clk_timer_lwpbind)(itimer_t *);
105 108 } clock_backend_t;
106 109
107 110 extern void clock_add_backend(clockid_t clock, clock_backend_t *backend);
108 111 extern clock_backend_t *clock_get_backend(clockid_t clock);
109 112
110 113 extern void timer_lwpbind();
111 114
112 115 extern void timer_func(sigqueue_t *);
113 116 extern void timer_exit(void);
114 117 extern void timer_lwpexit(void);
115 118 extern clock_t hzto(struct timeval *);
116 119 extern clock_t timespectohz(timespec_t *, timespec_t);
117 120 extern int64_t timespectohz64(timespec_t *);
118 121 extern int itimerspecfix(timespec_t *);
119 122 extern void timespecadd(timespec_t *, timespec_t *);
120 123 extern void timespecsub(timespec_t *, timespec_t *);
121 124 extern void timespecfix(timespec_t *);
122 125 extern int xgetitimer(uint_t, struct itimerval *, int);
123 126 extern int xsetitimer(uint_t, struct itimerval *, int);
124 127 extern void delete_itimer_realprof(void);
125 128
126 129 #define timerspecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec)
127 130 #define timerspeccmp(tvp, uvp) (((tvp)->tv_sec - (uvp)->tv_sec) ? \
128 131 ((tvp)->tv_sec - (uvp)->tv_sec):((tvp)->tv_nsec - (uvp)->tv_nsec))
129 132 #define timerspecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0)
130 133
131 134 struct oldsigevent {
132 135 /* structure definition prior to notification attributes member */
133 136 int _notify;
134 137 union {
135 138 int _signo;
136 139 void (*_notify_function)(union sigval);
137 140 } _un;
138 141 union sigval _value;
139 142 };
140 143
141 144 #if defined(_SYSCALL32)
142 145
143 146 struct oldsigevent32 {
144 147 int32_t _notify;
145 148 union {
146 149 int32_t _signo;
147 150 caddr32_t _notify_function;
148 151 } _un;
149 152 union sigval32 _value;
150 153 };
151 154
152 155 #endif /* _SYSCALL32 */
153 156 #endif /* _KERNEL */
154 157
155 158 #ifdef __cplusplus
156 159 }
157 160 #endif
158 161
159 162 #endif /* _SYS_TIMER_H */
|
↓ open down ↓ |
104 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX