summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 16:38:56 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-02-25 16:38:56 +0000
commitd14f20f10ceff77c48081349b827694c733aa06e (patch)
tree5378f3ae52b54bdcfb420b8b9aa02055f4e54397
parent8a8d4b95c50316e31c15b68ed349233d5db28292 (diff)
downloaduClibc-alpine-d14f20f10ceff77c48081349b827694c733aa06e.tar.bz2
uClibc-alpine-d14f20f10ceff77c48081349b827694c733aa06e.tar.xz
Grrr.
-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)