]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/sys/_clock_id.h
acpi: Only reserve resources enumerated via _CRS
[FreeBSD/FreeBSD.git] / sys / sys / _clock_id.h
1 /*-
2  * SPDX-License-Identifier: BSD-3-Clause
3  *
4  * Copyright (c) 1989, 1993
5  *      The Regents of the University of California.  All rights reserved.
6  * (c) UNIX System Laboratories, Inc.
7  * All or some portions of this file are derived from material licensed
8  * to the University of California by American Telephone and Telegraph
9  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10  * the permission of UNIX System Laboratories, Inc.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  * 3. Neither the name of the University nor the names of its contributors
21  *    may be used to endorse or promote products derived from this software
22  *    without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34  * SUCH DAMAGE.
35  *
36  *      @(#)time.h      8.3 (Berkeley) 1/21/94
37  */
38
39 #ifndef _SYS_SYS__CLOCK_ID_H
40 #define _SYS_SYS__CLOCK_ID_H
41
42 /*
43  * These macros are shared between time.h and sys/time.h.
44  */
45
46 /*
47  * Note: The values shown below as a comment for the __POSIX_VISIBLE values are
48  * the ones FreeBSD traditionally used based on our reading of the POSIX
49  * standards. However, glibc uses 199309 for all of them, even those many were
50  * not defined there. To remain bug compatible with glibc means more software
51  * that relied on the glibc behavior will compile easily on FreeBSD.
52  *
53  * Also, CLOCK_UPTIME_FAST is improperly visible temporarily for the lang/pocl
54  * port until it can be updated properly. It incorrectly assumes that this was a
55  * standard value. It will be moved back to the __BSD_VISIBLE section once the
56  * issue is corrected.
57  */
58
59 #if __POSIX_VISIBLE >= 199309           /* 199506 */
60 #define CLOCK_REALTIME          0
61 #endif /* __POSIX_VISIBLE >= 199309 */
62 #ifdef __BSD_VISIBLE
63 #define CLOCK_VIRTUAL           1
64 #define CLOCK_PROF              2
65 #endif /* __BSD_VISIBLE */
66 #if __POSIX_VISIBLE >= 199309           /* 200112 */
67 #define CLOCK_MONOTONIC         4
68 #define CLOCK_UPTIME_FAST       8
69 #endif /* __POSIX_VISIBLE >= 199309 */
70 #ifdef __BSD_VISIBLE
71 /*
72  * FreeBSD-specific clocks.
73  */
74 #define CLOCK_UPTIME            5
75 #define CLOCK_UPTIME_PRECISE    7
76 #define CLOCK_REALTIME_PRECISE  9
77 #define CLOCK_REALTIME_FAST     10
78 #define CLOCK_MONOTONIC_PRECISE 11
79 #define CLOCK_MONOTONIC_FAST    12
80 #define CLOCK_SECOND            13
81 #endif /* __BSD_VISIBLE */
82
83 #if __POSIX_VISIBLE >= 199309           /* 200112 */
84 #define CLOCK_THREAD_CPUTIME_ID 14
85 #define CLOCK_PROCESS_CPUTIME_ID 15
86 #endif /* __POSIX_VISIBLE >= 199309 */
87
88 /*
89  * Linux compatible names.
90  */
91 #if __BSD_VISIBLE
92 #define CLOCK_BOOTTIME          CLOCK_UPTIME
93 #define CLOCK_REALTIME_COARSE   CLOCK_REALTIME_FAST
94 #define CLOCK_MONOTONIC_COARSE  CLOCK_MONOTONIC_FAST
95 #endif
96
97 #if __BSD_VISIBLE
98 #define TIMER_RELTIME   0x0     /* relative timer */
99 #endif
100 #if __POSIX_VISIBLE >= 199309
101 #define TIMER_ABSTIME   0x1     /* absolute timer */
102 #endif /* __POSIX_VISIBLE >= 199309 */
103
104 #endif /* _SYS_SYS__CLOCK_ID_H */