aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-10 18:22:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:39 -0500
commit8313809ef3bfa8fa366d416add2150787235f192 (patch)
tree78bf6cc8e85ec8a4f173d32962c7c8379cc1b773
parent6d75ca10225be4c7509026f9b61c740b22e734e4 (diff)
cris arch-v10: use generic ptrace_resume code
Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT and PTRACE_KILL. This also makes PTRACE_SINGLESTEP return -EIO while it previously succeeded despite not actually causing any kind of single stepping. Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which it previously wasn't which is consistent with all architectures using the modern ptrace code. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Roland McGrath <roland@redhat.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index ee505b2eb4db..e70c804e9377 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -127,57 +127,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
127 ret = 0; 127 ret = 0;
128 break; 128 break;
129 129
130 case PTRACE_SYSCALL:
131 case PTRACE_CONT:
132 ret = -EIO;
133
134 if (!valid_signal(data))
135 break;
136
137 if (request == PTRACE_SYSCALL) {
138 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
139 }
140 else {
141 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
142 }
143
144 child->exit_code = data;
145
146 /* TODO: make sure any pending breakpoint is killed */
147 wake_up_process(child);
148 ret = 0;
149
150 break;
151
152 /* Make the child exit by sending it a sigkill. */
153 case PTRACE_KILL:
154 ret = 0;
155
156 if (child->exit_state == EXIT_ZOMBIE)
157 break;
158
159 child->exit_code = SIGKILL;
160
161 /* TODO: make sure any pending breakpoint is killed */
162 wake_up_process(child);
163 break;
164
165 /* Set the trap flag. */
166 case PTRACE_SINGLESTEP:
167 ret = -EIO;
168
169 if (!valid_signal(data))
170 break;
171
172 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
173
174 /* TODO: set some clever breakpoint mechanism... */
175
176 child->exit_code = data;
177 wake_up_process(child);
178 ret = 0;
179 break;
180
181 /* Get all GP registers from the child. */ 130 /* Get all GP registers from the child. */
182 case PTRACE_GETREGS: { 131 case PTRACE_GETREGS: {
183 int i; 132 int i;