Xenomai  3.0.8
time.h
1 /*
2  * Copyright (C) 2013 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #ifndef _COBALT_UAPI_TIME_H
19 #define _COBALT_UAPI_TIME_H
20 
21 #ifndef CLOCK_MONOTONIC_RAW
22 #define CLOCK_MONOTONIC_RAW 4
23 #endif
24 
25 /*
26  * Additional clock ids we manage are supposed not to collide with any
27  * of the POSIX and Linux kernel definitions so that no ambiguities
28  * arise when porting applications in both directions.
29  *
30  * 0 .. 31 regular POSIX/linux clock ids.
31  * 32 .. 63 statically reserved Cobalt clocks
32  * 64 .. 127 dynamically registered Cobalt clocks (external)
33  *
34  * CAUTION: clock ids must fit within a 7bit value, see
35  * include/cobalt/uapi/thread.h (e.g. cobalt_condattr).
36  */
37 #define __COBALT_CLOCK_STATIC(nr) ((clockid_t)(nr + 32))
38 
39 #define CLOCK_HOST_REALTIME __COBALT_CLOCK_STATIC(0)
40 
41 #define COBALT_MAX_EXTCLOCKS 64
42 
43 #define __COBALT_CLOCK_EXT(nr) ((clockid_t)(nr) | (1 << 6))
44 #define __COBALT_CLOCK_EXT_P(id) ((int)(id) >= 64 && (int)(id) < 128)
45 #define __COBALT_CLOCK_EXT_INDEX(id) ((int)(id) & ~(1 << 6))
46 
47 /*
48  * Additional timerfd defines
49  *
50  * when passing TFD_WAKEUP to timer_settime, any timer expiration
51  * unblocks the thread having issued timer_settime.
52  */
53 #define TFD_WAKEUP (1 << 2)
54 
55 #endif /* !_COBALT_UAPI_TIME_H */