aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-20 16:33:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-20 16:33:21 -0400
commit3ed4c0583daa34dedb568b26ff99e5a7b58db612 (patch)
treea531d4cc94acaa58fe0600cf83da9fb8b77f6e50 /include
parentad9471752ebae25daa133b4e5d9299809c35e155 (diff)
parentbd715d9a4f13f87bad5526c2cd41370949473b16 (diff)
Merge branch 'ptrace' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc
* 'ptrace' of git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc: (41 commits) signal: trivial, fix the "timespec declared inside parameter list" warning job control: reorganize wait_task_stopped() ptrace: fix signal->wait_chldexit usage in task_clear_group_stop_trapping() signal: sys_sigprocmask() needs retarget_shared_pending() signal: cleanup sys_sigprocmask() signal: rename signandsets() to sigandnsets() signal: do_sigtimedwait() needs retarget_shared_pending() signal: introduce do_sigtimedwait() to factor out compat/native code signal: sys_rt_sigtimedwait: simplify the timeout logic signal: cleanup sys_rt_sigprocmask() x86: signal: sys_rt_sigreturn() should use set_current_blocked() x86: signal: handle_signal() should use set_current_blocked() signal: sigprocmask() should do retarget_shared_pending() signal: sigprocmask: narrow the scope of ->siglock signal: retarget_shared_pending: optimize while_each_thread() loop signal: retarget_shared_pending: consider shared/unblocked signals only signal: introduce retarget_shared_pending() ptrace: ptrace_check_attach() should not do s/STOPPED/TRACED/ signal: Turn SIGNAL_STOP_DEQUEUED into GROUP_STOP_DEQUEUED signal: do_signal_stop: Remove the unneeded task_clear_group_stop_pending() ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h17
-rw-r--r--include/linux/signal.h13
-rw-r--r--include/linux/tracehook.h27
3 files changed, 23 insertions, 34 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 12211e1666e2..885c4f242ad7 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -653,9 +653,8 @@ struct signal_struct {
653 * Bits in flags field of signal_struct. 653 * Bits in flags field of signal_struct.
654 */ 654 */
655#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */ 655#define SIGNAL_STOP_STOPPED 0x00000001 /* job control stop in effect */
656#define SIGNAL_STOP_DEQUEUED 0x00000002 /* stop signal dequeued */ 656#define SIGNAL_STOP_CONTINUED 0x00000002 /* SIGCONT since WCONTINUED reap */
657#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ 657#define SIGNAL_GROUP_EXIT 0x00000004 /* group exit in progress */
658#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */
659/* 658/*
660 * Pending notifications to parent. 659 * Pending notifications to parent.
661 */ 660 */
@@ -1251,6 +1250,7 @@ struct task_struct {
1251 int exit_state; 1250 int exit_state;
1252 int exit_code, exit_signal; 1251 int exit_code, exit_signal;
1253 int pdeath_signal; /* The signal sent when the parent dies */ 1252 int pdeath_signal; /* The signal sent when the parent dies */
1253 unsigned int group_stop; /* GROUP_STOP_*, siglock protected */
1254 /* ??? */ 1254 /* ??? */
1255 unsigned int personality; 1255 unsigned int personality;
1256 unsigned did_exec:1; 1256 unsigned did_exec:1;
@@ -1771,6 +1771,17 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1771#define tsk_used_math(p) ((p)->flags & PF_USED_MATH) 1771#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
1772#define used_math() tsk_used_math(current) 1772#define used_math() tsk_used_math(current)
1773 1773
1774/*
1775 * task->group_stop flags
1776 */
1777#define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */
1778#define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */
1779#define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */
1780#define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */
1781#define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */
1782
1783extern void task_clear_group_stop_pending(struct task_struct *task);
1784
1774#ifdef CONFIG_PREEMPT_RCU 1785#ifdef CONFIG_PREEMPT_RCU
1775 1786
1776#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ 1787#define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 29a68ac7af83..a822300a253b 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -125,13 +125,13 @@ _SIG_SET_BINOP(sigorsets, _sig_or)
125#define _sig_and(x,y) ((x) & (y)) 125#define _sig_and(x,y) ((x) & (y))
126_SIG_SET_BINOP(sigandsets, _sig_and) 126_SIG_SET_BINOP(sigandsets, _sig_and)
127 127
128#define _sig_nand(x,y) ((x) & ~(y)) 128#define _sig_andn(x,y) ((x) & ~(y))
129_SIG_SET_BINOP(signandsets, _sig_nand) 129_SIG_SET_BINOP(sigandnsets, _sig_andn)
130 130
131#undef _SIG_SET_BINOP 131#undef _SIG_SET_BINOP
132#undef _sig_or 132#undef _sig_or
133#undef _sig_and 133#undef _sig_and
134#undef _sig_nand 134#undef _sig_andn
135 135
136#define _SIG_SET_OP(name, op) \ 136#define _SIG_SET_OP(name, op) \
137static inline void name(sigset_t *set) \ 137static inline void name(sigset_t *set) \
@@ -236,6 +236,9 @@ static inline int valid_signal(unsigned long sig)
236 return sig <= _NSIG ? 1 : 0; 236 return sig <= _NSIG ? 1 : 0;
237} 237}
238 238
239struct timespec;
240struct pt_regs;
241
239extern int next_signal(struct sigpending *pending, sigset_t *mask); 242extern int next_signal(struct sigpending *pending, sigset_t *mask);
240extern int do_send_sig_info(int sig, struct siginfo *info, 243extern int do_send_sig_info(int sig, struct siginfo *info,
241 struct task_struct *p, bool group); 244 struct task_struct *p, bool group);
@@ -244,10 +247,12 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
244extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, 247extern long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig,
245 siginfo_t *info); 248 siginfo_t *info);
246extern long do_sigpending(void __user *, unsigned long); 249extern long do_sigpending(void __user *, unsigned long);
250extern int do_sigtimedwait(const sigset_t *, siginfo_t *,
251 const struct timespec *);
247extern int sigprocmask(int, sigset_t *, sigset_t *); 252extern int sigprocmask(int, sigset_t *, sigset_t *);
253extern void set_current_blocked(const sigset_t *);
248extern int show_unhandled_signals; 254extern int show_unhandled_signals;
249 255
250struct pt_regs;
251extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 256extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
252extern void exit_signals(struct task_struct *tsk); 257extern void exit_signals(struct task_struct *tsk);
253 258
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index ebcfa4ebdbf8..e95f5236611f 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -469,33 +469,6 @@ static inline int tracehook_get_signal(struct task_struct *task,
469} 469}
470 470
471/** 471/**
472 * tracehook_notify_jctl - report about job control stop/continue
473 * @notify: zero, %CLD_STOPPED or %CLD_CONTINUED
474 * @why: %CLD_STOPPED or %CLD_CONTINUED
475 *
476 * This is called when we might call do_notify_parent_cldstop().
477 *
478 * @notify is zero if we would not ordinarily send a %SIGCHLD,
479 * or is the %CLD_STOPPED or %CLD_CONTINUED .si_code for %SIGCHLD.
480 *
481 * @why is %CLD_STOPPED when about to stop for job control;
482 * we are already in %TASK_STOPPED state, about to call schedule().
483 * It might also be that we have just exited (check %PF_EXITING),
484 * but need to report that a group-wide stop is complete.
485 *
486 * @why is %CLD_CONTINUED when waking up after job control stop and
487 * ready to make a delayed @notify report.
488 *
489 * Return the %CLD_* value for %SIGCHLD, or zero to generate no signal.
490 *
491 * Called with the siglock held.
492 */
493static inline int tracehook_notify_jctl(int notify, int why)
494{
495 return notify ?: (current->ptrace & PT_PTRACED) ? why : 0;
496}
497
498/**
499 * tracehook_finish_jctl - report about return from job control stop 472 * tracehook_finish_jctl - report about return from job control stop
500 * 473 *
501 * This is called by do_signal_stop() after wakeup. 474 * This is called by do_signal_stop() after wakeup.