]> git.saurik.com Git - apple/xnu.git/blame_incremental - osfmk/sys/time.h
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / sys / time.h
... / ...
CommitLineData
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25/*
26 * @OSF_COPYRIGHT@
27 */
28/*
29 * HISTORY
30 *
31 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
32 * Import of Mac OS X kernel (~semeria)
33 *
34 * Revision 1.1.1.1 1998/03/07 02:25:59 wsanchez
35 * Import of OSF Mach kernel (~mburg)
36 *
37 * Revision 1.2.6.1 1994/09/23 03:13:17 ezf
38 * change marker to not FREE
39 * [1994/09/22 21:58:56 ezf]
40 *
41 * Revision 1.2.2.2 1993/06/09 02:55:33 gm
42 * Added to OSF/1 R1.3 from NMK15.0.
43 * [1993/06/02 21:31:02 jeffc]
44 *
45 * Revision 1.2 1993/04/19 17:17:07 devrcs
46 * Fixes for ANSI C
47 * [1993/02/26 14:02:46 sp]
48 *
49 * Revision 1.1 1992/09/30 02:36:58 robert
50 * Initial revision
51 *
52 * $EndLog$
53 */
54/* CMU_HIST */
55/*
56 * Revision 2.3 91/05/14 17:40:25 mrt
57 * Correcting copyright
58 *
59 * Revision 2.2 91/02/05 17:56:58 mrt
60 * Changed to new Mach copyright
61 * [91/02/01 17:49:29 mrt]
62 *
63 */
64/* CMU_ENDHIST */
65/*
66 * Mach Operating System
67 * Copyright (c) 1991 Carnegie Mellon University
68 * All Rights Reserved.
69 *
70 * Permission to use, copy, modify and distribute this software and its
71 * documentation is hereby granted, provided that both the copyright
72 * notice and this permission notice appear in all copies of the
73 * software, derivative works or modified versions, and any portions
74 * thereof, and that both notices appear in supporting documentation.
75 *
76 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
77 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
78 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
79 *
80 * Carnegie Mellon requests users of this software to return to
81 *
82 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
83 * School of Computer Science
84 * Carnegie Mellon University
85 * Pittsburgh PA 15213-3890
86 *
87 * any improvements or extensions that they make and grant Carnegie Mellon rights
88 * to redistribute these changes.
89 */
90/*
91 */
92/*
93 * Time-keeper for kernel IO devices.
94 *
95 * May or may not have any relation to wall-clock time.
96 */
97
98#ifndef _SYS_TIME_H_
99#define _SYS_TIME_H_
100#include <mach/time_value.h>
101
102extern time_value_t time;
103
104/*
105 * Definitions to keep old code happy.
106 */
107#define timeval_t time_value_t
108#define timeval time_value
109#define tv_sec seconds
110#define tv_usec microseconds
111
112#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
113#define timercmp(tvp, uvp, cmp) \
114 ((tvp)->tv_sec cmp (uvp)->tv_sec || \
115 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
116#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
117#endif /* _SYS_TIME_H_ */