diff options
Diffstat (limited to 'include/linux/freezer.h')
-rw-r--r-- | include/linux/freezer.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 6e05e3e7ce39..5e75e26d4787 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* Freezer declarations */ | 1 | /* Freezer declarations */ |
2 | 2 | ||
3 | #include <linux/sched.h> | ||
4 | |||
3 | #ifdef CONFIG_PM | 5 | #ifdef CONFIG_PM |
4 | /* | 6 | /* |
5 | * Check if a process has been frozen | 7 | * Check if a process has been frozen |
@@ -14,16 +16,15 @@ static inline int frozen(struct task_struct *p) | |||
14 | */ | 16 | */ |
15 | static inline int freezing(struct task_struct *p) | 17 | static inline int freezing(struct task_struct *p) |
16 | { | 18 | { |
17 | return p->flags & PF_FREEZE; | 19 | return test_tsk_thread_flag(p, TIF_FREEZE); |
18 | } | 20 | } |
19 | 21 | ||
20 | /* | 22 | /* |
21 | * Request that a process be frozen | 23 | * Request that a process be frozen |
22 | * FIXME: SMP problem. We may not modify other process' flags! | ||
23 | */ | 24 | */ |
24 | static inline void freeze(struct task_struct *p) | 25 | static inline void freeze(struct task_struct *p) |
25 | { | 26 | { |
26 | p->flags |= PF_FREEZE; | 27 | set_tsk_thread_flag(p, TIF_FREEZE); |
27 | } | 28 | } |
28 | 29 | ||
29 | /* | 30 | /* |
@@ -31,7 +32,7 @@ static inline void freeze(struct task_struct *p) | |||
31 | */ | 32 | */ |
32 | static inline void do_not_freeze(struct task_struct *p) | 33 | static inline void do_not_freeze(struct task_struct *p) |
33 | { | 34 | { |
34 | p->flags &= ~PF_FREEZE; | 35 | clear_tsk_thread_flag(p, TIF_FREEZE); |
35 | } | 36 | } |
36 | 37 | ||
37 | /* | 38 | /* |
@@ -52,7 +53,9 @@ static inline int thaw_process(struct task_struct *p) | |||
52 | */ | 53 | */ |
53 | static inline void frozen_process(struct task_struct *p) | 54 | static inline void frozen_process(struct task_struct *p) |
54 | { | 55 | { |
55 | p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN; | 56 | p->flags |= PF_FROZEN; |
57 | wmb(); | ||
58 | clear_tsk_thread_flag(p, TIF_FREEZE); | ||
56 | } | 59 | } |
57 | 60 | ||
58 | extern void refrigerator(void); | 61 | extern void refrigerator(void); |