kernel-posix-cpu-timers.h 677 B

123456789101112131415161718
  1. /* Parameters for the Linux kernel ABI for CPU clocks. */
  2. #define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3))
  3. #define CPUCLOCK_PERTHREAD(clock) \
  4. (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0)
  5. #define CPUCLOCK_PID_MASK 7
  6. #define CPUCLOCK_PERTHREAD_MASK 4
  7. #define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK)
  8. #define CPUCLOCK_CLOCK_MASK 3
  9. #define CPUCLOCK_PROF 0
  10. #define CPUCLOCK_VIRT 1
  11. #define CPUCLOCK_SCHED 2
  12. #define CPUCLOCK_MAX 3
  13. #define MAKE_PROCESS_CPUCLOCK(pid, clock) \
  14. ((~(clockid_t) (pid) << 3) | (clockid_t) (clock))
  15. #define MAKE_THREAD_CPUCLOCK(tid, clock) \
  16. MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK)