summaryrefslogtreecommitdiff
path: root/librt/kernel-posix-cpu-timers.h
diff options
context:
space:
mode:
authorAustin Foxley <austinf@cetoncorp.com>2009-10-17 14:42:01 -0700
committerAustin Foxley <austinf@cetoncorp.com>2009-10-17 14:42:01 -0700
commita202cf6f119f41532b60ad28bc48746b535fd34c (patch)
tree03e96b87732058543d681803a829ee02238e5ab9 /librt/kernel-posix-cpu-timers.h
parent93e6d12ea06dc489cde0d96f78d623410703d33e (diff)
librt additions that are now possible with nptl
* clock_getcpuclockid, clock_gettime, clock_nanosleep, mq_receive, mq_send, mq_timedreceive, mq_timedsend, _SC_MONOTONIC_CLOCK Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'librt/kernel-posix-cpu-timers.h')
-rw-r--r--librt/kernel-posix-cpu-timers.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/librt/kernel-posix-cpu-timers.h b/librt/kernel-posix-cpu-timers.h
new file mode 100644
index 000000000..164a90dde
--- /dev/null
+++ b/librt/kernel-posix-cpu-timers.h
@@ -0,0 +1,18 @@
+/* Parameters for the Linux kernel ABI for CPU clocks. */
+
+#define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3))
+#define CPUCLOCK_PERTHREAD(clock) \
+ (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0)
+#define CPUCLOCK_PID_MASK 7
+#define CPUCLOCK_PERTHREAD_MASK 4
+#define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
+#define CPUCLOCK_CLOCK_MASK 3
+#define CPUCLOCK_PROF 0
+#define CPUCLOCK_VIRT 1
+#define CPUCLOCK_SCHED 2
+#define CPUCLOCK_MAX 3
+
+#define MAKE_PROCESS_CPUCLOCK(pid, clock) \
+ ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
+#define MAKE_THREAD_CPUCLOCK(tid, clock) \
+ MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK)