1 /* Freezer declarations */
5 * Check if a process has been frozen
7 static inline int frozen(struct task_struct *p)
9 return p->flags & PF_FROZEN;
13 * Check if there is a request to freeze a process
15 static inline int freezing(struct task_struct *p)
17 return p->flags & PF_FREEZE;
21 * Request that a process be frozen
22 * FIXME: SMP problem. We may not modify other process' flags!
24 static inline void freeze(struct task_struct *p)
26 p->flags |= PF_FREEZE;
30 * Sometimes we may need to cancel the previous 'freeze' request
32 static inline void do_not_freeze(struct task_struct *p)
34 p->flags &= ~PF_FREEZE;
38 * Wake up a frozen process
40 static inline int thaw_process(struct task_struct *p)
43 p->flags &= ~PF_FROZEN;
51 * freezing is complete, mark process as frozen
53 static inline void frozen_process(struct task_struct *p)
55 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
58 extern void refrigerator(void);
59 extern int freeze_processes(void);
60 extern void thaw_processes(void);
62 static inline int try_to_freeze(void)
64 if (freezing(current)) {
71 extern void thaw_some_processes(int all);
74 static inline int frozen(struct task_struct *p) { return 0; }
75 static inline int freezing(struct task_struct *p) { return 0; }
76 static inline void freeze(struct task_struct *p) { BUG(); }
77 static inline int thaw_process(struct task_struct *p) { return 1; }
78 static inline void frozen_process(struct task_struct *p) { BUG(); }
80 static inline void refrigerator(void) {}
81 static inline int freeze_processes(void) { BUG(); return 0; }
82 static inline void thaw_processes(void) {}
84 static inline int try_to_freeze(void) { return 0; }