diff options
Diffstat (limited to 'include/linux/freezer.h')
-rw-r--r-- | include/linux/freezer.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index deddeedf3257..17e3bb42dd3c 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | #ifdef CONFIG_PM_SLEEP | 9 | #ifdef CONFIG_FREEZER |
10 | /* | 10 | /* |
11 | * Check if a process has been frozen | 11 | * Check if a process has been frozen |
12 | */ | 12 | */ |
@@ -39,6 +39,11 @@ static inline void clear_freeze_flag(struct task_struct *p) | |||
39 | clear_tsk_thread_flag(p, TIF_FREEZE); | 39 | clear_tsk_thread_flag(p, TIF_FREEZE); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline bool should_send_signal(struct task_struct *p) | ||
43 | { | ||
44 | return !(p->flags & PF_FREEZER_NOSIG); | ||
45 | } | ||
46 | |||
42 | /* | 47 | /* |
43 | * Wake up a frozen process | 48 | * Wake up a frozen process |
44 | * | 49 | * |
@@ -75,6 +80,9 @@ static inline int try_to_freeze(void) | |||
75 | return 0; | 80 | return 0; |
76 | } | 81 | } |
77 | 82 | ||
83 | extern bool freeze_task(struct task_struct *p, bool sig_only); | ||
84 | extern void cancel_freezing(struct task_struct *p); | ||
85 | |||
78 | /* | 86 | /* |
79 | * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it | 87 | * The PF_FREEZER_SKIP flag should be set by a vfork parent right before it |
80 | * calls wait_for_completion(&vfork) and reset right after it returns from this | 88 | * calls wait_for_completion(&vfork) and reset right after it returns from this |
@@ -166,7 +174,7 @@ static inline void set_freezable_with_signal(void) | |||
166 | } while (try_to_freeze()); \ | 174 | } while (try_to_freeze()); \ |
167 | __retval; \ | 175 | __retval; \ |
168 | }) | 176 | }) |
169 | #else /* !CONFIG_PM_SLEEP */ | 177 | #else /* !CONFIG_FREEZER */ |
170 | static inline int frozen(struct task_struct *p) { return 0; } | 178 | static inline int frozen(struct task_struct *p) { return 0; } |
171 | static inline int freezing(struct task_struct *p) { return 0; } | 179 | static inline int freezing(struct task_struct *p) { return 0; } |
172 | static inline void set_freeze_flag(struct task_struct *p) {} | 180 | static inline void set_freeze_flag(struct task_struct *p) {} |
@@ -191,6 +199,6 @@ static inline void set_freezable_with_signal(void) {} | |||
191 | #define wait_event_freezable_timeout(wq, condition, timeout) \ | 199 | #define wait_event_freezable_timeout(wq, condition, timeout) \ |
192 | wait_event_interruptible_timeout(wq, condition, timeout) | 200 | wait_event_interruptible_timeout(wq, condition, timeout) |
193 | 201 | ||
194 | #endif /* !CONFIG_PM_SLEEP */ | 202 | #endif /* !CONFIG_FREEZER */ |
195 | 203 | ||
196 | #endif /* FREEZER_H_INCLUDED */ | 204 | #endif /* FREEZER_H_INCLUDED */ |