|
2 | 2 | #ifndef _linux_POSIX_TIMERS_H
|
3 | 3 | #define _linux_POSIX_TIMERS_H
|
4 | 4 |
|
5 |
| -#include <linux/spinlock.h> |
| 5 | +#include <linux/alarmtimer.h> |
6 | 6 | #include <linux/list.h>
|
7 | 7 | #include <linux/mutex.h>
|
8 |
| -#include <linux/alarmtimer.h> |
| 8 | +#include <linux/posix-timers_types.h> |
| 9 | +#include <linux/spinlock.h> |
9 | 10 | #include <linux/timerqueue.h>
|
10 | 11 |
|
11 | 12 | struct kernel_siginfo;
|
12 | 13 | struct task_struct;
|
13 | 14 |
|
14 |
| -/* |
15 |
| - * Bit fields within a clockid: |
16 |
| - * |
17 |
| - * The most significant 29 bits hold either a pid or a file descriptor. |
18 |
| - * |
19 |
| - * Bit 2 indicates whether a cpu clock refers to a thread or a process. |
20 |
| - * |
21 |
| - * Bits 1 and 0 give the type: PROF=0, VIRT=1, SCHED=2, or FD=3. |
22 |
| - * |
23 |
| - * A clockid is invalid if bits 2, 1, and 0 are all set. |
24 |
| - */ |
25 |
| -#define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3)) |
26 |
| -#define CPUCLOCK_PERTHREAD(clock) \ |
27 |
| - (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0) |
28 |
| - |
29 |
| -#define CPUCLOCK_PERTHREAD_MASK 4 |
30 |
| -#define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK) |
31 |
| -#define CPUCLOCK_CLOCK_MASK 3 |
32 |
| -#define CPUCLOCK_PROF 0 |
33 |
| -#define CPUCLOCK_VIRT 1 |
34 |
| -#define CPUCLOCK_SCHED 2 |
35 |
| -#define CPUCLOCK_MAX 3 |
36 |
| -#define CLOCKFD CPUCLOCK_MAX |
37 |
| -#define CLOCKFD_MASK (CPUCLOCK_PERTHREAD_MASK|CPUCLOCK_CLOCK_MASK) |
38 |
| - |
39 | 15 | static inline clockid_t make_process_cpuclock(const unsigned int pid,
|
40 | 16 | const clockid_t clock)
|
41 | 17 | {
|
@@ -109,44 +85,6 @@ static inline void cpu_timer_setexpires(struct cpu_timer *ctmr, u64 exp)
|
109 | 85 | ctmr->node.expires = exp;
|
110 | 86 | }
|
111 | 87 |
|
112 |
| -/** |
113 |
| - * posix_cputimer_base - Container per posix CPU clock |
114 |
| - * @nextevt: Earliest-expiration cache |
115 |
| - * @tqhead: timerqueue head for cpu_timers |
116 |
| - */ |
117 |
| -struct posix_cputimer_base { |
118 |
| - u64 nextevt; |
119 |
| - struct timerqueue_head tqhead; |
120 |
| -}; |
121 |
| - |
122 |
| -/** |
123 |
| - * posix_cputimers - Container for posix CPU timer related data |
124 |
| - * @bases: Base container for posix CPU clocks |
125 |
| - * @timers_active: Timers are queued. |
126 |
| - * @expiry_active: Timer expiry is active. Used for |
127 |
| - * process wide timers to avoid multiple |
128 |
| - * task trying to handle expiry concurrently |
129 |
| - * |
130 |
| - * Used in task_struct and signal_struct |
131 |
| - */ |
132 |
| -struct posix_cputimers { |
133 |
| - struct posix_cputimer_base bases[CPUCLOCK_MAX]; |
134 |
| - unsigned int timers_active; |
135 |
| - unsigned int expiry_active; |
136 |
| -}; |
137 |
| - |
138 |
| -/** |
139 |
| - * posix_cputimers_work - Container for task work based posix CPU timer expiry |
140 |
| - * @work: The task work to be scheduled |
141 |
| - * @mutex: Mutex held around expiry in context of this task work |
142 |
| - * @scheduled: @work has been scheduled already, no further processing |
143 |
| - */ |
144 |
| -struct posix_cputimers_work { |
145 |
| - struct callback_head work; |
146 |
| - struct mutex mutex; |
147 |
| - unsigned int scheduled; |
148 |
| -}; |
149 |
| - |
150 | 88 | static inline void posix_cputimers_init(struct posix_cputimers *pct)
|
151 | 89 | {
|
152 | 90 | memset(pct, 0, sizeof(*pct));
|
@@ -179,7 +117,6 @@ static inline void posix_cputimers_rt_watchdog(struct posix_cputimers *pct,
|
179 | 117 | .bases = INIT_CPU_TIMERBASES(s.posix_cputimers.bases), \
|
180 | 118 | },
|
181 | 119 | #else
|
182 |
| -struct posix_cputimers { }; |
183 | 120 | struct cpu_timer { };
|
184 | 121 | #define INIT_CPU_TIMERS(s)
|
185 | 122 | static inline void posix_cputimers_init(struct posix_cputimers *pct) { }
|
|
0 commit comments