]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/freezer.h
[PATCH] Fix gate_vma.vm_flags
[karo-tx-linux.git] / include / linux / freezer.h
index 266373f74445af8c4d5d112bd9492bc36e244039..5e75e26d4787248caf175063afad75010824672a 100644 (file)
@@ -1,5 +1,7 @@
 /* Freezer declarations */
 
+#include <linux/sched.h>
+
 #ifdef CONFIG_PM
 /*
  * Check if a process has been frozen
@@ -14,16 +16,15 @@ static inline int frozen(struct task_struct *p)
  */
 static inline int freezing(struct task_struct *p)
 {
-       return p->flags & PF_FREEZE;
+       return test_tsk_thread_flag(p, TIF_FREEZE);
 }
 
 /*
  * Request that a process be frozen
- * FIXME: SMP problem. We may not modify other process' flags!
  */
 static inline void freeze(struct task_struct *p)
 {
-       p->flags |= PF_FREEZE;
+       set_tsk_thread_flag(p, TIF_FREEZE);
 }
 
 /*
@@ -31,7 +32,7 @@ static inline void freeze(struct task_struct *p)
  */
 static inline void do_not_freeze(struct task_struct *p)
 {
-       p->flags &= ~PF_FREEZE;
+       clear_tsk_thread_flag(p, TIF_FREEZE);
 }
 
 /*
@@ -52,7 +53,9 @@ static inline int thaw_process(struct task_struct *p)
  */
 static inline void frozen_process(struct task_struct *p)
 {
-       p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
+       p->flags |= PF_FROZEN;
+       wmb();
+       clear_tsk_thread_flag(p, TIF_FREEZE);
 }
 
 extern void refrigerator(void);
@@ -67,6 +70,9 @@ static inline int try_to_freeze(void)
        } else
                return 0;
 }
+
+extern void thaw_some_processes(int all);
+
 #else
 static inline int frozen(struct task_struct *p) { return 0; }
 static inline int freezing(struct task_struct *p) { return 0; }