xref: /utopia/UTPA2-700.0.x/projects/tools/lint/aeon_include/time.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 /*
2  * time.h
3  *
4  * Struct and function declarations for dealing with time.
5  */
6 
7 #ifndef _TIME_H_
8 #define _TIME_H_
9 
10 #include "_ansi.h"
11 #include <sys/reent.h>
12 
13 #ifndef NULL
14 #define	NULL	0
15 #endif
16 
17 /* Get _CLOCKS_PER_SEC_ */
18 #include <machine/time.h>
19 
20 #ifndef _CLOCKS_PER_SEC_
21 #define _CLOCKS_PER_SEC_ 1000
22 #endif
23 
24 #define CLOCKS_PER_SEC _CLOCKS_PER_SEC_
25 #define CLK_TCK CLOCKS_PER_SEC
26 #define __need_size_t
27 #include <stddef.h>
28 
29 #include <sys/types.h>
30 
31 _BEGIN_STD_C
32 
33 struct tm
34 {
35   int	tm_sec;
36   int	tm_min;
37   int	tm_hour;
38   int	tm_mday;
39   int	tm_mon;
40   int	tm_year;
41   int	tm_wday;
42   int	tm_yday;
43   int	tm_isdst;
44 };
45 
46 clock_t	   _EXFUN(clock,    (void));
47 double	   _EXFUN(difftime, (time_t _time2, time_t _time1));
48 time_t	   _EXFUN(mktime,   (struct tm *_timeptr));
49 time_t	   _EXFUN(time,     (time_t *_timer));
50 #ifndef _REENT_ONLY
51 char	  *_EXFUN(asctime,  (const struct tm *_tblock));
52 char	  *_EXFUN(ctime,    (const time_t *_time));
53 struct tm *_EXFUN(gmtime,   (const time_t *_timer));
54 struct tm *_EXFUN(localtime,(const time_t *_timer));
55 #endif
56 size_t	   _EXFUN(strftime, (char *_s, size_t _maxsize, const char *_fmt, const struct tm *_t));
57 
58 char	  *_EXFUN(asctime_r,	(const struct tm *, char *));
59 char	  *_EXFUN(ctime_r,	(const time_t *, char *));
60 struct tm *_EXFUN(gmtime_r,	(const time_t *, struct tm *));
61 struct tm *_EXFUN(localtime_r,	(const time_t *, struct tm *));
62 
63 #if defined(AEONSIM) || defined(XGEN)
64 #include <sys/syscall.h>
65 
66 #define AEONSIM_MAX_TIMER   16
67 #define AEONSIM_ALL_TIMER   -1
68 #define XGEN_MAX_TIMER      AEONSIM_MAX_TIMER
69 #define XGEN_ALL_TIMER      AEONSIM_ALL_TIMER
70 #define AEONSIM_MAX_COUNTER   16
71 #define AEONSIM_ALL_COUNTER   -1
72 #define XGEN_MAX_COUNTER      AEONSIM_MAX_COUNTER
73 #define XGEN_ALL_COUNTER      AEONSIM_ALL_COUNTER
74 
75 void __timer_reset(int timer_id);
76 void __timer_start(int timer_id);
77 void __timer_stop(int timer_id);
78 void __timer_cancel(int timer_id);
79 void __timer_report(int timer_id);
80 int __timer_started(int timer_id);
81 int __timer_n_start(int timer_id);
82 
83 long long  __timer_last_cycles(int timer_id);       // number of cycles elapse
84 long long  __timer_last_cycles_due_to_i_miss(int timer_id);       // number of cycles elapse due to i-cache miss
85 long long  __timer_last_cycles_due_to_d_miss(int timer_id);       // number of cycles elapse due to i-cache miss
86 long long  __timer_last_instructions(int timer_id); // number of instruction executed
87 long long  __timer_last_data_prefetch(int timer_id);// data prefetch in byte
88 long long  __timer_last_data_read(int timer_id);    // data read in byte
89 long long  __timer_last_data_write(int timer_id);   // data write in byte
90 long long  __timer_last_instruction_fetch(int timer_id);   // instruction fetch in byte
91 long long  __timer_last_bus_prefetch(int timer_id);// data prefetch in byte which miss cache/scratch and involve memroy bus
92 long long  __timer_last_bus_read(int timer_id);    // data read in byte which miss cache/scratch and involve memroy bus
93 long long  __timer_last_bus_write(int timer_id);   // data write in byte which miss cache/scratch and involve memroy bus
94 long long  __timer_last_bus_fetch(int timer_id);   // instruction fetch in byte which miss cache/scratch and involve memroy bus
95 long long  __timer_last_qbus_read(int timer_id);   // data read in byte from QMEM
96 long long  __timer_last_qbus_write(int timer_id);  // data write in byte to QMEM
97 long long  __timer_last_qbus_fetch(int timer_id);  // instruction fetch in byte from QMEM
98 
99 long long  __timer_total_cycles(int timer_id);
100 long long  __timer_total_cycles_due_to_i_miss(int timer_id);
101 long long  __timer_total_cycles_due_to_d_miss(int timer_id);
102 long long  __timer_total_instructions(int timer_id);
103 long long  __timer_total_data_prefetch(int timer_id);
104 long long  __timer_total_data_read(int timer_id);
105 long long  __timer_total_data_write(int timer_id);
106 long long  __timer_total_instruction_fetch(int timer_id);
107 long long  __timer_total_bus_prefetch(int timer_id);
108 long long  __timer_total_bus_read(int timer_id);
109 long long  __timer_total_bus_write(int timer_id);
110 long long  __timer_total_bus_fetch(int timer_id);
111 long long  __timer_total_qbus_read(int timer_id);
112 long long  __timer_total_qbus_write(int timer_id);
113 long long  __timer_total_qbus_fetch(int timer_id);
114 
115 long long  __timer_total_microsecond(int timer_id);
116 void __timer_add_last(int dest_timer_id, int src_timer_id);
117 
118 void __counter_reset(int timer_id);
119 void __counter_increment(int timer_id, unsigned divisor);
120 void __counter_report(int timer_id);
121 long long __counter_value(int timer_id);
122 
123 // __timer_start/stop short-hand
124 #ifdef AEONSIM
125 #define __timer0_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer0_start()" : : "K"(NOP_AEONSIM_TIMER0_START+0));
126 #define __timer1_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer1_start()" : : "K"(NOP_AEONSIM_TIMER0_START+1));
127 #define __timer2_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer2_start()" : : "K"(NOP_AEONSIM_TIMER0_START+2));
128 #define __timer3_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer3_start()" : : "K"(NOP_AEONSIM_TIMER0_START+3));
129 #define __timer4_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer4_start()" : : "K"(NOP_AEONSIM_TIMER0_START+4));
130 #define __timer5_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer5_start()" : : "K"(NOP_AEONSIM_TIMER0_START+5));
131 #define __timer6_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer6_start()" : : "K"(NOP_AEONSIM_TIMER0_START+6));
132 #define __timer7_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer7_start()" : : "K"(NOP_AEONSIM_TIMER0_START+7));
133 #define __timer8_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer8_start()" : : "K"(NOP_AEONSIM_TIMER0_START+8));
134 #define __timer9_start()    __asm__ __volatile__ ("l.nop %0\t# void __timer9_start()" : : "K"(NOP_AEONSIM_TIMER0_START+9));
135 #define __timer10_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer10_start()" : : "K"(NOP_AEONSIM_TIMER0_START+10));
136 #define __timer11_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer11_start()" : : "K"(NOP_AEONSIM_TIMER0_START+11));
137 #define __timer12_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer12_start()" : : "K"(NOP_AEONSIM_TIMER0_START+12));
138 #define __timer13_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer13_start()" : : "K"(NOP_AEONSIM_TIMER0_START+13));
139 #define __timer14_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer14_start()" : : "K"(NOP_AEONSIM_TIMER0_START+14));
140 #define __timer15_start()   __asm__ __volatile__ ("l.nop %0\t# void __timer15_start()" : : "K"(NOP_AEONSIM_TIMER0_START+15));
141 
142 #define __timer0_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer0_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+0));
143 #define __timer1_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer1_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+1));
144 #define __timer2_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer2_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+2));
145 #define __timer3_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer3_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+3));
146 #define __timer4_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer4_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+4));
147 #define __timer5_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer5_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+5));
148 #define __timer6_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer6_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+6));
149 #define __timer7_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer7_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+7));
150 #define __timer8_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer8_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+8));
151 #define __timer9_stop()     __asm__ __volatile__ ("l.nop %0\t# void __timer9_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+9));
152 #define __timer10_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer10_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+10));
153 #define __timer11_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer11_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+11));
154 #define __timer12_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer12_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+12));
155 #define __timer13_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer13_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+13));
156 #define __timer14_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer14_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+14));
157 #define __timer15_stop()    __asm__ __volatile__ ("l.nop %0\t# void __timer15_stop()" : : "K"(NOP_AEONSIM_TIMER0_STOP+15));
158 
159 #define __timer0_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer0_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+0));
160 #define __timer1_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer1_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+1));
161 #define __timer2_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer2_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+2));
162 #define __timer3_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer3_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+3));
163 #define __timer4_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer4_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+4));
164 #define __timer5_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer5_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+5));
165 #define __timer6_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer6_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+6));
166 #define __timer7_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer7_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+7));
167 #define __timer8_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer8_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+8));
168 #define __timer9_cancel()     __asm__ __volatile__ ("l.nop %0\t# void __timer9_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+9));
169 #define __timer10_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer10_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+10));
170 #define __timer11_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer11_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+11));
171 #define __timer12_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer12_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+12));
172 #define __timer13_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer13_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+13));
173 #define __timer14_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer14_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+14));
174 #define __timer15_cancel()    __asm__ __volatile__ ("l.nop %0\t# void __timer15_cancel()" : : "K"(NOP_AEONSIM_TIMER0_CANCEL+15));
175 
176 // __counter_increment short-hand
177 #define __counter0_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter0_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+0));
178 #define __counter1_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter1_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+1));
179 #define __counter2_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter2_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+2));
180 #define __counter3_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter3_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+3));
181 #define __counter4_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter4_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+4));
182 #define __counter5_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter5_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+5));
183 #define __counter6_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter6_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+6));
184 #define __counter7_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter7_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+7));
185 #define __counter8_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter8_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+8));
186 #define __counter9_increment()     __asm__ __volatile__ ("l.nop %0\t# void __counter9_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+9));
187 #define __counter10_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter10_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+10));
188 #define __counter11_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter11_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+11));
189 #define __counter12_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter12_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+12));
190 #define __counter13_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter13_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+13));
191 #define __counter14_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter14_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+14));
192 #define __counter15_increment()    __asm__ __volatile__ ("l.nop %0\t# void __counter15_increment()" : : "K"(NOP_AEONSIM_COUNTER0_INCREMENT+15));
193 
194 #else
195 //!AEONSIM
196 void __timer0_start();
197 void __timer1_start();
198 void __timer2_start();
199 void __timer3_start();
200 void __timer4_start();
201 void __timer5_start();
202 void __timer6_start();
203 void __timer7_start();
204 void __timer8_start();
205 void __timer9_start();
206 void __timer10_start();
207 void __timer11_start();
208 void __timer12_start();
209 void __timer13_start();
210 void __timer14_start();
211 void __timer15_start();
212 
213 void __timer0_stop();
214 void __timer1_stop();
215 void __timer2_stop();
216 void __timer3_stop();
217 void __timer4_stop();
218 void __timer5_stop();
219 void __timer6_stop();
220 void __timer7_stop();
221 void __timer8_stop();
222 void __timer9_stop();
223 void __timer10_stop();
224 void __timer11_stop();
225 void __timer12_stop();
226 void __timer13_stop();
227 void __timer14_stop();
228 void __timer15_stop();
229 
230 void __timer0_cancel();
231 void __timer1_cancel();
232 void __timer2_cancel();
233 void __timer3_cancel();
234 void __timer4_cancel();
235 void __timer5_cancel();
236 void __timer6_cancel();
237 void __timer7_cancel();
238 void __timer8_cancel();
239 void __timer9_cancel();
240 void __timer10_cancel();
241 void __timer11_cancel();
242 void __timer12_cancel();
243 void __timer13_cancel();
244 void __timer14_cancel();
245 void __timer15_cancel();
246 
247 void __counter0_increment();
248 void __counter1_increment();
249 void __counter2_increment();
250 void __counter3_increment();
251 void __counter4_increment();
252 void __counter5_increment();
253 void __counter6_increment();
254 void __counter7_increment();
255 void __counter8_increment();
256 void __counter9_increment();
257 void __counter10_increment();
258 void __counter11_increment();
259 void __counter12_increment();
260 void __counter13_increment();
261 void __counter14_increment();
262 void __counter15_increment();
263 
264 #endif /* AEONSIM */
265 #endif /* AEONSIM || XGEN */
266 
267 _END_STD_C
268 
269 #ifdef __cplusplus
270 extern "C" {
271 #endif
272 
273 #ifndef __STRICT_ANSI__
274 char      *_EXFUN(strptime,     (const char *, const char *, struct tm *));
275 _VOID      _EXFUN(tzset,	(_VOID));
276 _VOID      _EXFUN(_tzset_r,	(struct _reent *));
277 
278 typedef struct __tzrule_struct
279 {
280   char ch;
281   int m;
282   int n;
283   int d;
284   int s;
285   time_t change;
286   long offset; /* Match type of _timezone. */
287 } __tzrule_type;
288 
289 typedef struct __tzinfo_struct
290 {
291   int __tznorth;
292   int __tzyear;
293   __tzrule_type __tzrule[2];
294 } __tzinfo_type;
295 
296 __tzinfo_type *_EXFUN (__gettzinfo, (_VOID));
297 
298 /* getdate functions */
299 
300 #ifdef HAVE_GETDATE
301 #ifndef _REENT_ONLY
302 #define getdate_err (*__getdate_err())
303 int *_EXFUN(__getdate_err,(_VOID));
304 
305 struct tm *	_EXFUN(getdate, (const char *));
306 /* getdate_err is set to one of the following values to indicate the error.
307      1  the DATEMSK environment variable is null or undefined,
308      2  the template file cannot be opened for reading,
309      3  failed to get file status information,
310      4  the template file is not a regular file,
311      5  an error is encountered while reading the template file,
312      6  memory allication failed (not enough memory available),
313      7  there is no line in the template that matches the input,
314      8  invalid input specification  */
315 #endif /* !_REENT_ONLY */
316 
317 /* getdate_r returns the error code as above */
318 int		_EXFUN(getdate_r, (const char *, struct tm *));
319 #endif /* HAVE_GETDATE */
320 
321 /* defines for the opengroup specifications Derived from Issue 1 of the SVID.  */
322 extern __IMPORT long _timezone;
323 extern __IMPORT int _daylight;
324 extern __IMPORT char *_tzname[2];
325 
326 /* POSIX defines the external tzname being defined in time.h */
327 #ifndef tzname
328 #define tzname _tzname
329 #endif
330 #endif /* !__STRICT_ANSI__ */
331 
332 #ifdef __cplusplus
333 }
334 #endif
335 
336 #include <sys/features.h>
337 
338 #ifdef __CYGWIN__
339 #include <cygwin/time.h>
340 #endif /*__CYGWIN__*/
341 
342 #if defined(_POSIX_TIMERS)
343 
344 #include <signal.h>
345 
346 #ifdef __cplusplus
347 extern "C" {
348 #endif
349 
350 /* Clocks, P1003.1b-1993, p. 263 */
351 
352 int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp));
353 int _EXFUN(clock_gettime, (clockid_t clock_id, struct timespec *tp));
354 int _EXFUN(clock_getres,  (clockid_t clock_id, struct timespec *res));
355 
356 /* Create a Per-Process Timer, P1003.1b-1993, p. 264 */
357 
358 int _EXFUN(timer_create,
359   (clockid_t clock_id, struct sigevent *evp, timer_t *timerid));
360 
361 /* Delete a Per_process Timer, P1003.1b-1993, p. 266 */
362 
363 int _EXFUN(timer_delete, (timer_t timerid));
364 
365 /* Per-Process Timers, P1003.1b-1993, p. 267 */
366 
367 int _EXFUN(timer_settime,
368   (timer_t timerid, int flags, const struct itimerspec *value,
369    struct itimerspec *ovalue));
370 int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value));
371 int _EXFUN(timer_getoverrun, (timer_t timerid));
372 
373 /* High Resolution Sleep, P1003.1b-1993, p. 269 */
374 
375 int _EXFUN(nanosleep, (const struct timespec  *rqtp, struct timespec *rmtp));
376 
377 #ifdef __cplusplus
378 }
379 #endif
380 #endif /* _POSIX_TIMERS */
381 
382 #ifdef __cplusplus
383 extern "C" {
384 #endif
385 
386 /* CPU-time Clock Attributes, P1003.4b/D8, p. 54 */
387 
388 /* values for the clock enable attribute */
389 
390 #define CLOCK_ENABLED  1  /* clock is enabled, i.e. counting execution time */
391 #define CLOCK_DISABLED 0  /* clock is disabled */
392 
393 /* values for the pthread cputime_clock_allowed attribute */
394 
395 #define CLOCK_ALLOWED    1 /* If a thread is created with this value a */
396                            /*   CPU-time clock attached to that thread */
397                            /*   shall be accessible. */
398 #define CLOCK_DISALLOWED 0 /* If a thread is created with this value, the */
399                            /*   thread shall not have a CPU-time clock */
400                            /*   accessible. */
401 
402 /* Manifest Constants, P1003.1b-1993, p. 262 */
403 
404 #define CLOCK_REALTIME (clockid_t)1
405 
406 /* Flag indicating time is "absolute" with respect to the clock
407    associated with a time.  */
408 
409 #define TIMER_ABSTIME	4
410 
411 /* Manifest Constants, P1003.4b/D8, p. 55 */
412 
413 #if defined(_POSIX_CPUTIME)
414 
415 /* When used in a clock or timer function call, this is interpreted as
416    the identifier of the CPU_time clock associated with the PROCESS
417    making the function call.  */
418 
419 #define CLOCK_PROCESS_CPUTIME (clockid_t)2
420 
421 #endif
422 
423 #if defined(_POSIX_THREAD_CPUTIME)
424 
425 /*  When used in a clock or timer function call, this is interpreted as
426     the identifier of the CPU_time clock associated with the THREAD
427     making the function call.  */
428 
429 #define CLOCK_THREAD_CPUTIME (clockid_t)3
430 
431 #endif
432 
433 #if defined(_POSIX_CPUTIME)
434 
435 /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */
436 
437 int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id));
438 
439 #endif /* _POSIX_CPUTIME */
440 
441 #if defined(_POSIX_CPUTIME) || defined(_POSIX_THREAD_CPUTIME)
442 
443 /* CPU-time Clock Attribute Access, P1003.4b/D8, p. 56 */
444 
445 int _EXFUN(clock_setenable_attr, (clockid_t clock_id, int attr));
446 int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr));
447 
448 #endif /* _POSIX_CPUTIME or _POSIX_THREAD_CPUTIME */
449 
450 #ifdef __cplusplus
451 }
452 #endif
453 
454 #endif /* _TIME_H_ */
455 
456