1 /* Freezer declarations */
3 #include <linux/sched.h>
7 * Check if a process has been frozen
9 static inline int frozen(struct task_struct
*p
)
11 return p
->flags
& PF_FROZEN
;
15 * Check if there is a request to freeze a process
17 static inline int freezing(struct task_struct
*p
)
19 return p
->flags
& PF_FREEZE
;
23 * Request that a process be frozen
24 * FIXME: SMP problem. We may not modify other process' flags!
26 static inline void freeze(struct task_struct
*p
)
28 p
->flags
|= PF_FREEZE
;
32 * Sometimes we may need to cancel the previous 'freeze' request
34 static inline void do_not_freeze(struct task_struct
*p
)
36 p
->flags
&= ~PF_FREEZE
;
40 * Wake up a frozen process
42 static inline int thaw_process(struct task_struct
*p
)
45 p
->flags
&= ~PF_FROZEN
;
53 * freezing is complete, mark process as frozen
55 static inline void frozen_process(struct task_struct
*p
)
57 p
->flags
= (p
->flags
& ~PF_FREEZE
) | PF_FROZEN
;
60 extern void refrigerator(void);
61 extern int freeze_processes(void);
62 extern void thaw_processes(void);
64 static inline int try_to_freeze(void)
66 if (freezing(current
)) {
73 extern void thaw_some_processes(int all
);
76 static inline int frozen(struct task_struct
*p
) { return 0; }
77 static inline int freezing(struct task_struct
*p
) { return 0; }
78 static inline void freeze(struct task_struct
*p
) { BUG(); }
79 static inline int thaw_process(struct task_struct
*p
) { return 1; }
80 static inline void frozen_process(struct task_struct
*p
) { BUG(); }
82 static inline void refrigerator(void) {}
83 static inline int freeze_processes(void) { BUG(); return 0; }
84 static inline void thaw_processes(void) {}
86 static inline int try_to_freeze(void) { return 0; }
This page took 0.033038 seconds and 6 git commands to generate.