1 /* Freezer declarations */
3 #define FREEZER_KERNEL_THREADS 0
4 #define FREEZER_ALL_THREADS 1
8 * Check if a process has been frozen
10 static inline int frozen(struct task_struct *p)
12 return p->flags & PF_FROZEN;
16 * Check if there is a request to freeze a process
18 static inline int freezing(struct task_struct *p)
20 return p->flags & PF_FREEZE;
24 * Request that a process be frozen
25 * FIXME: SMP problem. We may not modify other process' flags!
27 static inline void freeze(struct task_struct *p)
29 p->flags |= PF_FREEZE;
33 * Sometimes we may need to cancel the previous 'freeze' request
35 static inline void do_not_freeze(struct task_struct *p)
37 p->flags &= ~PF_FREEZE;
41 * Wake up a frozen process
43 static inline int thaw_process(struct task_struct *p)
46 p->flags &= ~PF_FROZEN;
54 * freezing is complete, mark process as frozen
56 static inline void frozen_process(struct task_struct *p)
58 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
61 extern void refrigerator(void);
62 extern int freeze_processes(void);
63 #define thaw_processes() do { thaw_some_processes(FREEZER_ALL_THREADS); } while(0)
64 #define thaw_kernel_threads() do { thaw_some_processes(FREEZER_KERNEL_THREADS); } while(0)
66 static inline int try_to_freeze(void)
68 if (freezing(current)) {
75 extern void thaw_some_processes(int all);
78 static inline int frozen(struct task_struct *p) { return 0; }
79 static inline int freezing(struct task_struct *p) { return 0; }
80 static inline void freeze(struct task_struct *p) { BUG(); }
81 static inline int thaw_process(struct task_struct *p) { return 1; }
82 static inline void frozen_process(struct task_struct *p) { BUG(); }
84 static inline void refrigerator(void) {}
85 static inline int freeze_processes(void) { BUG(); return 0; }
86 static inline void thaw_processes(void) {}
88 static inline int try_to_freeze(void) { return 0; }