diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-frv/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-i386/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-ia64/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-powerpc/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-sh/thread_info.h | 2 | ||||
| -rw-r--r-- | include/asm-x86_64/thread_info.h | 2 | ||||
| -rw-r--r-- | include/linux/freezer.h | 11 | ||||
| -rw-r--r-- | include/linux/sched.h | 1 |
9 files changed, 20 insertions, 6 deletions
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index d9b8bddc87..5014794f9e 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
| @@ -147,6 +147,7 @@ extern void iwmmxt_task_switch(struct thread_info *); | |||
| 147 | #define TIF_POLLING_NRFLAG 16 | 147 | #define TIF_POLLING_NRFLAG 16 |
| 148 | #define TIF_USING_IWMMXT 17 | 148 | #define TIF_USING_IWMMXT 17 |
| 149 | #define TIF_MEMDIE 18 | 149 | #define TIF_MEMDIE 18 |
| 150 | #define TIF_FREEZE 19 | ||
| 150 | 151 | ||
| 151 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 152 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
| 152 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 153 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
| @@ -154,6 +155,7 @@ extern void iwmmxt_task_switch(struct thread_info *); | |||
| 154 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 155 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
| 155 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 156 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
| 156 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) | 157 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) |
| 158 | #define _TIF_FREEZE (1 << TIF_FREEZE) | ||
| 157 | 159 | ||
| 158 | /* | 160 | /* |
| 159 | * Change these and you break ASM code in entry-common.S | 161 | * Change these and you break ASM code in entry-common.S |
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h index d66c48e6ef..d881f518e6 100644 --- a/include/asm-frv/thread_info.h +++ b/include/asm-frv/thread_info.h | |||
| @@ -116,6 +116,7 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
| 116 | #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ | 116 | #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */ |
| 117 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 117 | #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
| 118 | #define TIF_MEMDIE 17 /* OOM killer killed process */ | 118 | #define TIF_MEMDIE 17 /* OOM killer killed process */ |
| 119 | #define TIF_FREEZE 18 /* freezing for suspend */ | ||
| 119 | 120 | ||
| 120 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 121 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
| 121 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 122 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
| @@ -125,6 +126,7 @@ register struct thread_info *__current_thread_info asm("gr15"); | |||
| 125 | #define _TIF_IRET (1 << TIF_IRET) | 126 | #define _TIF_IRET (1 << TIF_IRET) |
| 126 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) | 127 | #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) |
| 127 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 128 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
| 129 | #define _TIF_FREEZE (1 << TIF_FREEZE) | ||
| 128 | 130 | ||
| 129 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ | 131 | #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ |
| 130 | #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ | 132 | #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ |
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 46d32ad920..4b187bb377 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h | |||
| @@ -134,6 +134,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 134 | #define TIF_MEMDIE 16 | 134 | #define TIF_MEMDIE 16 |
| 135 | #define TIF_DEBUG 17 /* uses debug registers */ | 135 | #define TIF_DEBUG 17 /* uses debug registers */ |
| 136 | #define TIF_IO_BITMAP 18 /* uses I/O bitmap */ | 136 | #define TIF_IO_BITMAP 18 /* uses I/O bitmap */ |
| 137 | #define TIF_FREEZE 19 /* is freezing for suspend */ | ||
| 137 | 138 | ||
| 138 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 139 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| 139 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 140 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
| @@ -147,6 +148,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 147 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 148 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
| 148 | #define _TIF_DEBUG (1<<TIF_DEBUG) | 149 | #define _TIF_DEBUG (1<<TIF_DEBUG) |
| 149 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) | 150 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) |
| 151 | #define _TIF_FREEZE (1<<TIF_FREEZE) | ||
| 150 | 152 | ||
| 151 | /* work to do on interrupt/exception return */ | 153 | /* work to do on interrupt/exception return */ |
| 152 | #define _TIF_WORK_MASK \ | 154 | #define _TIF_WORK_MASK \ |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 8adcde0934..9b505b2554 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
| @@ -88,6 +88,7 @@ struct thread_info { | |||
| 88 | #define TIF_MEMDIE 17 | 88 | #define TIF_MEMDIE 17 |
| 89 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ | 89 | #define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */ |
| 90 | #define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ | 90 | #define TIF_DB_DISABLED 19 /* debug trap disabled for fsyscall */ |
| 91 | #define TIF_FREEZE 20 /* is freezing for suspend */ | ||
| 91 | 92 | ||
| 92 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 93 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
| 93 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 94 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
| @@ -98,6 +99,7 @@ struct thread_info { | |||
| 98 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) | 99 | #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) |
| 99 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) | 100 | #define _TIF_MCA_INIT (1 << TIF_MCA_INIT) |
| 100 | #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) | 101 | #define _TIF_DB_DISABLED (1 << TIF_DB_DISABLED) |
| 102 | #define _TIF_FREEZE (1 << TIF_FREEZE) | ||
| 101 | 103 | ||
| 102 | /* "work to do on user-return" bits */ | 104 | /* "work to do on user-return" bits */ |
| 103 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) | 105 | #define TIF_ALLWORK_MASK (_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) |
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h index d339e2e88b..3f32ca8bfe 100644 --- a/include/asm-powerpc/thread_info.h +++ b/include/asm-powerpc/thread_info.h | |||
| @@ -122,6 +122,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 122 | #define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ | 122 | #define TIF_RESTOREALL 12 /* Restore all regs (implies NOERROR) */ |
| 123 | #define TIF_NOERROR 14 /* Force successful syscall return */ | 123 | #define TIF_NOERROR 14 /* Force successful syscall return */ |
| 124 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ | 124 | #define TIF_RESTORE_SIGMASK 15 /* Restore signal mask in do_signal */ |
| 125 | #define TIF_FREEZE 16 /* Freezing for suspend */ | ||
| 125 | 126 | ||
| 126 | /* as above, but as bit values */ | 127 | /* as above, but as bit values */ |
| 127 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 128 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| @@ -138,6 +139,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 138 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) | 139 | #define _TIF_RESTOREALL (1<<TIF_RESTOREALL) |
| 139 | #define _TIF_NOERROR (1<<TIF_NOERROR) | 140 | #define _TIF_NOERROR (1<<TIF_NOERROR) |
| 140 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 141 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
| 142 | #define _TIF_FREEZE (1<<TIF_FREEZE) | ||
| 141 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) | 143 | #define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) |
| 142 | 144 | ||
| 143 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ | 145 | #define _TIF_USER_WORK_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ |
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h index 0c01dc5508..879f741105 100644 --- a/include/asm-sh/thread_info.h +++ b/include/asm-sh/thread_info.h | |||
| @@ -106,6 +106,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 106 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ | 106 | #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ |
| 107 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 107 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
| 108 | #define TIF_MEMDIE 18 | 108 | #define TIF_MEMDIE 18 |
| 109 | #define TIF_FREEZE 19 | ||
| 109 | 110 | ||
| 110 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 111 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| 111 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 112 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
| @@ -114,6 +115,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 114 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) | 115 | #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) |
| 115 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) | 116 | #define _TIF_USEDFPU (1<<TIF_USEDFPU) |
| 116 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | 117 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) |
| 118 | #define _TIF_FREEZE (1<<TIF_FREEZE) | ||
| 117 | 119 | ||
| 118 | #define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ | 120 | #define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ |
| 119 | #define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ | 121 | #define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ |
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h index 787a08114b..74a6c74397 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86_64/thread_info.h | |||
| @@ -122,6 +122,7 @@ static inline struct thread_info *stack_thread_info(void) | |||
| 122 | #define TIF_MEMDIE 20 | 122 | #define TIF_MEMDIE 20 |
| 123 | #define TIF_DEBUG 21 /* uses debug registers */ | 123 | #define TIF_DEBUG 21 /* uses debug registers */ |
| 124 | #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ | 124 | #define TIF_IO_BITMAP 22 /* uses I/O bitmap */ |
| 125 | #define TIF_FREEZE 23 /* is freezing for suspend */ | ||
| 125 | 126 | ||
| 126 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 127 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
| 127 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 128 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
| @@ -137,6 +138,7 @@ static inline struct thread_info *stack_thread_info(void) | |||
| 137 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) | 138 | #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) |
| 138 | #define _TIF_DEBUG (1<<TIF_DEBUG) | 139 | #define _TIF_DEBUG (1<<TIF_DEBUG) |
| 139 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) | 140 | #define _TIF_IO_BITMAP (1<<TIF_IO_BITMAP) |
| 141 | #define _TIF_FREEZE (1<<TIF_FREEZE) | ||
| 140 | 142 | ||
| 141 | /* work to do on interrupt/exception return */ | 143 | /* work to do on interrupt/exception return */ |
| 142 | #define _TIF_WORK_MASK \ | 144 | #define _TIF_WORK_MASK \ |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 3930630961..5e75e26d47 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
| @@ -16,16 +16,15 @@ static inline int frozen(struct task_struct *p) | |||
| 16 | */ | 16 | */ |
| 17 | static inline int freezing(struct task_struct *p) | 17 | static inline int freezing(struct task_struct *p) |
| 18 | { | 18 | { |
| 19 | return p->flags & PF_FREEZE; | 19 | return test_tsk_thread_flag(p, TIF_FREEZE); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | /* | 22 | /* |
| 23 | * Request that a process be frozen | 23 | * Request that a process be frozen |
| 24 | * FIXME: SMP problem. We may not modify other process' flags! | ||
| 25 | */ | 24 | */ |
| 26 | static inline void freeze(struct task_struct *p) | 25 | static inline void freeze(struct task_struct *p) |
| 27 | { | 26 | { |
| 28 | p->flags |= PF_FREEZE; | 27 | set_tsk_thread_flag(p, TIF_FREEZE); |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | /* | 30 | /* |
| @@ -33,7 +32,7 @@ static inline void freeze(struct task_struct *p) | |||
| 33 | */ | 32 | */ |
| 34 | static inline void do_not_freeze(struct task_struct *p) | 33 | static inline void do_not_freeze(struct task_struct *p) |
| 35 | { | 34 | { |
| 36 | p->flags &= ~PF_FREEZE; | 35 | clear_tsk_thread_flag(p, TIF_FREEZE); |
| 37 | } | 36 | } |
| 38 | 37 | ||
| 39 | /* | 38 | /* |
| @@ -54,7 +53,9 @@ static inline int thaw_process(struct task_struct *p) | |||
| 54 | */ | 53 | */ |
| 55 | static inline void frozen_process(struct task_struct *p) | 54 | static inline void frozen_process(struct task_struct *p) |
| 56 | { | 55 | { |
| 57 | p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN; | 56 | p->flags |= PF_FROZEN; |
| 57 | wmb(); | ||
| 58 | clear_tsk_thread_flag(p, TIF_FREEZE); | ||
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | extern void refrigerator(void); | 61 | extern void refrigerator(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index ea92e5c890..4463735351 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1144,7 +1144,6 @@ static inline void put_task_struct(struct task_struct *t) | |||
| 1144 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1144 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
| 1145 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ | 1145 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ |
| 1146 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1146 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
| 1147 | #define PF_FREEZE 0x00004000 /* this task is being frozen for suspend now */ | ||
| 1148 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1147 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
| 1149 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1148 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
| 1150 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1149 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
