lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* Parameters for the Linux kernel ABI for CPU clocks. */ |
| 2 | |
| 3 | #define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3)) |
| 4 | #define CPUCLOCK_PERTHREAD(clock) \ |
| 5 | (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0) |
| 6 | #define CPUCLOCK_PID_MASK 7 |
| 7 | #define CPUCLOCK_PERTHREAD_MASK 4 |
| 8 | #define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK) |
| 9 | #define CPUCLOCK_CLOCK_MASK 3 |
| 10 | #define CPUCLOCK_PROF 0 |
| 11 | #define CPUCLOCK_VIRT 1 |
| 12 | #define CPUCLOCK_SCHED 2 |
| 13 | #define CPUCLOCK_MAX 3 |
| 14 | |
| 15 | #define MAKE_PROCESS_CPUCLOCK(pid, clock) \ |
| 16 | ((~(clockid_t) (pid) << 3) | (clockid_t) (clock)) |
| 17 | #define MAKE_THREAD_CPUCLOCK(tid, clock) \ |
| 18 | MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK) |