]> bbs.cooldavid.org Git - net-next-2.6.git/blame - arch/m32r/kernel/ptrace.c
PTRACE_PEEKDATA consolidation
[net-next-2.6.git] / arch / m32r / kernel / ptrace.c
CommitLineData
1da177e4
LT
1/*
2 * linux/arch/m32r/kernel/ptrace.c
3 *
4 * Copyright (C) 2002 Hirokazu Takata, Takeo Takahashi
5 * Copyright (C) 2004 Hirokazu Takata, Kei Sakamoto
6 *
7 * Original x86 implementation:
8 * By Ross Biro 1/23/92
9 * edited by Linus Torvalds
10 *
11 * Some code taken from sh version:
12 * Copyright (C) 1999, 2000 Kaz Kojima & Niibe Yutaka
13 * Some code taken from arm version:
14 * Copyright (C) 2000 Russell King
15 */
16
1da177e4
LT
17#include <linux/kernel.h>
18#include <linux/sched.h>
19#include <linux/mm.h>
20#include <linux/smp.h>
21#include <linux/smp_lock.h>
22#include <linux/errno.h>
23#include <linux/ptrace.h>
24#include <linux/user.h>
25#include <linux/string.h>
7ed20e1a 26#include <linux/signal.h>
1da177e4
LT
27
28#include <asm/cacheflush.h>
29#include <asm/io.h>
30#include <asm/uaccess.h>
31#include <asm/pgtable.h>
32#include <asm/system.h>
33#include <asm/processor.h>
34#include <asm/mmu_context.h>
35
1da177e4
LT
36/*
37 * This routine will get a word off of the process kernel stack.
38 */
39static inline unsigned long int
40get_stack_long(struct task_struct *task, int offset)
41{
42 unsigned long *stack;
43
6c3559fc 44 stack = (unsigned long *)task_pt_regs(task);
1da177e4
LT
45
46 return stack[offset];
47}
48
49/*
50 * This routine will put a word on the process kernel stack.
51 */
52static inline int
53put_stack_long(struct task_struct *task, int offset, unsigned long data)
54{
55 unsigned long *stack;
56
6c3559fc 57 stack = (unsigned long *)task_pt_regs(task);
1da177e4
LT
58 stack[offset] = data;
59
60 return 0;
61}
62
63static int reg_offset[] = {
64 PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
65 PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU,
66};
67
68/*
69 * Read the word at offset "off" into the "struct user". We
70 * actually access the pt_regs stored on the kernel stack.
71 */
72static int ptrace_read_user(struct task_struct *tsk, unsigned long off,
73 unsigned long __user *data)
74{
75 unsigned long tmp;
76#ifndef NO_FPU
77 struct user * dummy = NULL;
78#endif
79
80 if ((off & 3) || (off < 0) || (off > sizeof(struct user) - 3))
81 return -EIO;
82
83 off >>= 2;
84 switch (off) {
85 case PT_EVB:
86 __asm__ __volatile__ (
87 "mvfc %0, cr5 \n\t"
88 : "=r" (tmp)
89 );
90 break;
91 case PT_CBR: {
92 unsigned long psw;
93 psw = get_stack_long(tsk, PT_PSW);
94 tmp = ((psw >> 8) & 1);
95 }
96 break;
97 case PT_PSW: {
98 unsigned long psw, bbpsw;
99 psw = get_stack_long(tsk, PT_PSW);
100 bbpsw = get_stack_long(tsk, PT_BBPSW);
101 tmp = ((psw >> 8) & 0xff) | ((bbpsw & 0xff) << 8);
102 }
103 break;
104 case PT_PC:
105 tmp = get_stack_long(tsk, PT_BPC);
106 break;
107 case PT_BPC:
108 off = PT_BBPC;
109 /* fall through */
110 default:
111 if (off < (sizeof(struct pt_regs) >> 2))
112 tmp = get_stack_long(tsk, off);
113#ifndef NO_FPU
114 else if (off >= (long)(&dummy->fpu >> 2) &&
115 off < (long)(&dummy->u_fpvalid >> 2)) {
116 if (!tsk_used_math(tsk)) {
117 if (off == (long)(&dummy->fpu.fpscr >> 2))
118 tmp = FPSCR_INIT;
119 else
120 tmp = 0;
121 } else
122 tmp = ((long *)(&tsk->thread.fpu >> 2))
123 [off - (long)&dummy->fpu];
124 } else if (off == (long)(&dummy->u_fpvalid >> 2))
125 tmp = !!tsk_used_math(tsk);
126#endif /* not NO_FPU */
127 else
128 tmp = 0;
129 }
130
131 return put_user(tmp, data);
132}
133
134static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
135 unsigned long data)
136{
137 int ret = -EIO;
138#ifndef NO_FPU
139 struct user * dummy = NULL;
140#endif
141
142 if ((off & 3) || off < 0 ||
143 off > sizeof(struct user) - 3)
144 return -EIO;
145
146 off >>= 2;
147 switch (off) {
148 case PT_EVB:
149 case PT_BPC:
150 case PT_SPI:
151 /* We don't allow to modify evb. */
152 ret = 0;
153 break;
154 case PT_PSW:
155 case PT_CBR: {
156 /* We allow to modify only cbr in psw */
157 unsigned long psw;
158 psw = get_stack_long(tsk, PT_PSW);
159 psw = (psw & ~0x100) | ((data & 1) << 8);
160 ret = put_stack_long(tsk, PT_PSW, psw);
161 }
162 break;
163 case PT_PC:
164 off = PT_BPC;
165 data &= ~1;
166 /* fall through */
167 default:
168 if (off < (sizeof(struct pt_regs) >> 2))
169 ret = put_stack_long(tsk, off, data);
170#ifndef NO_FPU
171 else if (off >= (long)(&dummy->fpu >> 2) &&
172 off < (long)(&dummy->u_fpvalid >> 2)) {
173 set_stopped_child_used_math(tsk);
174 ((long *)&tsk->thread.fpu)
175 [off - (long)&dummy->fpu] = data;
176 ret = 0;
177 } else if (off == (long)(&dummy->u_fpvalid >> 2)) {
178 conditional_stopped_child_used_math(data, tsk);
179 ret = 0;
180 }
181#endif /* not NO_FPU */
182 break;
183 }
184
185 return ret;
186}
187
188/*
189 * Get all user integer registers.
190 */
191static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
192{
6c3559fc 193 struct pt_regs *regs = task_pt_regs(tsk);
1da177e4
LT
194
195 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
196}
197
198/*
199 * Set all user integer registers.
200 */
201static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)
202{
203 struct pt_regs newregs;
204 int ret;
205
206 ret = -EFAULT;
207 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
6c3559fc 208 struct pt_regs *regs = task_pt_regs(tsk);
1da177e4
LT
209 *regs = newregs;
210 ret = 0;
211 }
212
213 return ret;
214}
215
216
217static inline int
218check_condition_bit(struct task_struct *child)
219{
220 return (int)((get_stack_long(child, PT_PSW) >> 8) & 1);
221}
222
223static int
224check_condition_src(unsigned long op, unsigned long regno1,
225 unsigned long regno2, struct task_struct *child)
226{
227 unsigned long reg1, reg2;
228
229 reg2 = get_stack_long(child, reg_offset[regno2]);
230
231 switch (op) {
232 case 0x0: /* BEQ */
233 reg1 = get_stack_long(child, reg_offset[regno1]);
234 return reg1 == reg2;
235 case 0x1: /* BNE */
236 reg1 = get_stack_long(child, reg_offset[regno1]);
237 return reg1 != reg2;
238 case 0x8: /* BEQZ */
239 return reg2 == 0;
240 case 0x9: /* BNEZ */
241 return reg2 != 0;
242 case 0xa: /* BLTZ */
243 return (int)reg2 < 0;
244 case 0xb: /* BGEZ */
245 return (int)reg2 >= 0;
246 case 0xc: /* BLEZ */
247 return (int)reg2 <= 0;
248 case 0xd: /* BGTZ */
249 return (int)reg2 > 0;
250 default:
251 /* never reached */
252 return 0;
253 }
254}
255
256static void
257compute_next_pc_for_16bit_insn(unsigned long insn, unsigned long pc,
258 unsigned long *next_pc,
259 struct task_struct *child)
260{
261 unsigned long op, op2, op3;
262 unsigned long disp;
263 unsigned long regno;
264 int parallel = 0;
265
266 if (insn & 0x00008000)
267 parallel = 1;
268 if (pc & 3)
269 insn &= 0x7fff; /* right slot */
270 else
271 insn >>= 16; /* left slot */
272
273 op = (insn >> 12) & 0xf;
274 op2 = (insn >> 8) & 0xf;
275 op3 = (insn >> 4) & 0xf;
276
277 if (op == 0x7) {
278 switch (op2) {
279 case 0xd: /* BNC */
280 case 0x9: /* BNCL */
281 if (!check_condition_bit(child)) {
282 disp = (long)(insn << 24) >> 22;
283 *next_pc = (pc & ~0x3) + disp;
284 return;
285 }
286 break;
287 case 0x8: /* BCL */
288 case 0xc: /* BC */
289 if (check_condition_bit(child)) {
290 disp = (long)(insn << 24) >> 22;
291 *next_pc = (pc & ~0x3) + disp;
292 return;
293 }
294 break;
295 case 0xe: /* BL */
296 case 0xf: /* BRA */
297 disp = (long)(insn << 24) >> 22;
298 *next_pc = (pc & ~0x3) + disp;
299 return;
300 break;
301 }
302 } else if (op == 0x1) {
303 switch (op2) {
304 case 0x0:
305 if (op3 == 0xf) { /* TRAP */
306#if 1
307 /* pass through */
308#else
309 /* kernel space is not allowed as next_pc */
310 unsigned long evb;
311 unsigned long trapno;
312 trapno = insn & 0xf;
313 __asm__ __volatile__ (
314 "mvfc %0, cr5\n"
315 :"=r"(evb)
316 :
317 );
318 *next_pc = evb + (trapno << 2);
319 return;
320#endif
321 } else if (op3 == 0xd) { /* RTE */
322 *next_pc = get_stack_long(child, PT_BPC);
323 return;
324 }
325 break;
326 case 0xc: /* JC */
327 if (op3 == 0xc && check_condition_bit(child)) {
328 regno = insn & 0xf;
329 *next_pc = get_stack_long(child,
330 reg_offset[regno]);
331 return;
332 }
333 break;
334 case 0xd: /* JNC */
335 if (op3 == 0xc && !check_condition_bit(child)) {
336 regno = insn & 0xf;
337 *next_pc = get_stack_long(child,
338 reg_offset[regno]);
339 return;
340 }
341 break;
342 case 0xe: /* JL */
343 case 0xf: /* JMP */
344 if (op3 == 0xc) { /* JMP */
345 regno = insn & 0xf;
346 *next_pc = get_stack_long(child,
347 reg_offset[regno]);
348 return;
349 }
350 break;
351 }
352 }
353 if (parallel)
354 *next_pc = pc + 4;
355 else
356 *next_pc = pc + 2;
357}
358
359static void
360compute_next_pc_for_32bit_insn(unsigned long insn, unsigned long pc,
361 unsigned long *next_pc,
362 struct task_struct *child)
363{
364 unsigned long op;
365 unsigned long op2;
366 unsigned long disp;
367 unsigned long regno1, regno2;
368
369 op = (insn >> 28) & 0xf;
370 if (op == 0xf) { /* branch 24-bit relative */
371 op2 = (insn >> 24) & 0xf;
372 switch (op2) {
373 case 0xd: /* BNC */
374 case 0x9: /* BNCL */
375 if (!check_condition_bit(child)) {
376 disp = (long)(insn << 8) >> 6;
377 *next_pc = (pc & ~0x3) + disp;
378 return;
379 }
380 break;
381 case 0x8: /* BCL */
382 case 0xc: /* BC */
383 if (check_condition_bit(child)) {
384 disp = (long)(insn << 8) >> 6;
385 *next_pc = (pc & ~0x3) + disp;
386 return;
387 }
388 break;
389 case 0xe: /* BL */
390 case 0xf: /* BRA */
391 disp = (long)(insn << 8) >> 6;
392 *next_pc = (pc & ~0x3) + disp;
393 return;
394 }
395 } else if (op == 0xb) { /* branch 16-bit relative */
396 op2 = (insn >> 20) & 0xf;
397 switch (op2) {
398 case 0x0: /* BEQ */
399 case 0x1: /* BNE */
400 case 0x8: /* BEQZ */
401 case 0x9: /* BNEZ */
402 case 0xa: /* BLTZ */
403 case 0xb: /* BGEZ */
404 case 0xc: /* BLEZ */
405 case 0xd: /* BGTZ */
406 regno1 = ((insn >> 24) & 0xf);
407 regno2 = ((insn >> 16) & 0xf);
408 if (check_condition_src(op2, regno1, regno2, child)) {
409 disp = (long)(insn << 16) >> 14;
410 *next_pc = (pc & ~0x3) + disp;
411 return;
412 }
413 break;
414 }
415 }
416 *next_pc = pc + 4;
417}
418
419static inline void
420compute_next_pc(unsigned long insn, unsigned long pc,
421 unsigned long *next_pc, struct task_struct *child)
422{
423 if (insn & 0x80000000)
424 compute_next_pc_for_32bit_insn(insn, pc, next_pc, child);
425 else
426 compute_next_pc_for_16bit_insn(insn, pc, next_pc, child);
427}
428
429static int
430register_debug_trap(struct task_struct *child, unsigned long next_pc,
431 unsigned long next_insn, unsigned long *code)
432{
433 struct debug_trap *p = &child->thread.debug_trap;
434 unsigned long addr = next_pc & ~3;
435
436 if (p->nr_trap == MAX_TRAPS) {
437 printk("kernel BUG at %s %d: p->nr_trap = %d\n",
438 __FILE__, __LINE__, p->nr_trap);
439 return -1;
440 }
441 p->addr[p->nr_trap] = addr;
442 p->insn[p->nr_trap] = next_insn;
443 p->nr_trap++;
444 if (next_pc & 3) {
445 *code = (next_insn & 0xffff0000) | 0x10f1;
446 /* xxx --> TRAP1 */
447 } else {
448 if ((next_insn & 0x80000000) || (next_insn & 0x8000)) {
449 *code = 0x10f17000;
450 /* TRAP1 --> NOP */
451 } else {
452 *code = (next_insn & 0xffff) | 0x10f10000;
453 /* TRAP1 --> xxx */
454 }
455 }
456 return 0;
457}
458
459static int
460unregister_debug_trap(struct task_struct *child, unsigned long addr,
461 unsigned long *code)
462{
463 struct debug_trap *p = &child->thread.debug_trap;
464 int i;
465
466 /* Search debug trap entry. */
467 for (i = 0; i < p->nr_trap; i++) {
468 if (p->addr[i] == addr)
469 break;
470 }
471 if (i >= p->nr_trap) {
472 /* The trap may be requested from debugger.
473 * ptrace should do nothing in this case.
474 */
475 return 0;
476 }
477
478 /* Recover orignal instruction code. */
479 *code = p->insn[i];
480
481 /* Shift debug trap entries. */
482 while (i < p->nr_trap - 1) {
483 p->insn[i] = p->insn[i + 1];
484 p->addr[i] = p->addr[i + 1];
485 i++;
486 }
487 p->nr_trap--;
488 return 1;
489}
490
491static void
492unregister_all_debug_traps(struct task_struct *child)
493{
494 struct debug_trap *p = &child->thread.debug_trap;
495 int i;
496
497 for (i = 0; i < p->nr_trap; i++)
498 access_process_vm(child, p->addr[i], &p->insn[i], sizeof(p->insn[i]), 1);
499 p->nr_trap = 0;
500}
501
502static inline void
503invalidate_cache(void)
504{
505#if defined(CONFIG_CHIP_M32700) || defined(CONFIG_CHIP_OPSP)
506
507 _flush_cache_copyback_all();
508
509#else /* ! CONFIG_CHIP_M32700 */
510
511 /* Invalidate cache */
512 __asm__ __volatile__ (
513 "ldi r0, #-1 \n\t"
514 "ldi r1, #0 \n\t"
515 "stb r1, @r0 ; cache off \n\t"
516 "; \n\t"
517 "ldi r0, #-2 \n\t"
518 "ldi r1, #1 \n\t"
519 "stb r1, @r0 ; cache invalidate \n\t"
520 ".fillinsn \n"
521 "0: \n\t"
522 "ldb r1, @r0 ; invalidate check \n\t"
523 "bnez r1, 0b \n\t"
524 "; \n\t"
525 "ldi r0, #-1 \n\t"
526 "ldi r1, #1 \n\t"
527 "stb r1, @r0 ; cache on \n\t"
528 : : : "r0", "r1", "memory"
529 );
530 /* FIXME: copying-back d-cache and invalidating i-cache are needed.
531 */
532#endif /* CONFIG_CHIP_M32700 */
533}
534
535/* Embed a debug trap (TRAP1) code */
536static int
537embed_debug_trap(struct task_struct *child, unsigned long next_pc)
538{
539 unsigned long next_insn, code;
540 unsigned long addr = next_pc & ~3;
541
542 if (access_process_vm(child, addr, &next_insn, sizeof(next_insn), 0)
543 != sizeof(next_insn)) {
544 return -1; /* error */
545 }
546
547 /* Set a trap code. */
548 if (register_debug_trap(child, next_pc, next_insn, &code)) {
549 return -1; /* error */
550 }
551 if (access_process_vm(child, addr, &code, sizeof(code), 1)
552 != sizeof(code)) {
553 return -1; /* error */
554 }
555 return 0; /* success */
556}
557
558void
559withdraw_debug_trap(struct pt_regs *regs)
560{
561 unsigned long addr;
562 unsigned long code;
563
564 addr = (regs->bpc - 2) & ~3;
565 regs->bpc -= 2;
566 if (unregister_debug_trap(current, addr, &code)) {
567 access_process_vm(current, addr, &code, sizeof(code), 1);
568 invalidate_cache();
569 }
570}
571
572static void
573init_debug_traps(struct task_struct *child)
574{
575 struct debug_trap *p = &child->thread.debug_trap;
576 int i;
577 p->nr_trap = 0;
578 for (i = 0; i < MAX_TRAPS; i++) {
579 p->addr[i] = 0;
580 p->insn[i] = 0;
581 }
582}
583
584
585/*
586 * Called by kernel/ptrace.c when detaching..
587 *
588 * Make sure single step bits etc are not set.
589 */
590void ptrace_disable(struct task_struct *child)
591{
592 /* nothing to do.. */
593}
594
595static int
596do_ptrace(long request, struct task_struct *child, long addr, long data)
597{
1da177e4
LT
598 int ret;
599
600 switch (request) {
601 /*
602 * read word at location "addr" in the child process.
603 */
604 case PTRACE_PEEKTEXT:
605 case PTRACE_PEEKDATA:
76647323 606 ret = generic_ptrace_peekdata(child, addr, data);
1da177e4
LT
607 break;
608
609 /*
610 * read the word at location addr in the USER area.
611 */
612 case PTRACE_PEEKUSR:
613 ret = ptrace_read_user(child, addr,
614 (unsigned long __user *)data);
615 break;
616
617 /*
618 * write the word at location addr.
619 */
620 case PTRACE_POKETEXT:
621 case PTRACE_POKEDATA:
622 ret = access_process_vm(child, addr, &data, sizeof(data), 1);
623 if (ret == sizeof(data)) {
624 ret = 0;
625 if (request == PTRACE_POKETEXT) {
626 invalidate_cache();
627 }
628 } else {
629 ret = -EIO;
630 }
631 break;
632
633 /*
634 * write the word at location addr in the USER area.
635 */
636 case PTRACE_POKEUSR:
637 ret = ptrace_write_user(child, addr, data);
638 break;
639
640 /*
641 * continue/restart and stop at next (return from) syscall
642 */
643 case PTRACE_SYSCALL:
644 case PTRACE_CONT:
645 ret = -EIO;
7ed20e1a 646 if (!valid_signal(data))
1da177e4
LT
647 break;
648 if (request == PTRACE_SYSCALL)
649 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
650 else
651 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
652 child->exit_code = data;
653 wake_up_process(child);
654 ret = 0;
655 break;
656
657 /*
658 * make the child exit. Best I can do is send it a sigkill.
659 * perhaps it should be put in the status that it wants to
660 * exit.
661 */
662 case PTRACE_KILL: {
663 ret = 0;
664 unregister_all_debug_traps(child);
665 invalidate_cache();
666 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
667 break;
668 child->exit_code = SIGKILL;
669 wake_up_process(child);
670 break;
671 }
672
673 /*
674 * execute single instruction.
675 */
676 case PTRACE_SINGLESTEP: {
677 unsigned long next_pc;
678 unsigned long pc, insn;
679
680 ret = -EIO;
7ed20e1a 681 if (!valid_signal(data))
1da177e4
LT
682 break;
683 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
684 if ((child->ptrace & PT_DTRACE) == 0) {
685 /* Spurious delayed TF traps may occur */
686 child->ptrace |= PT_DTRACE;
687 }
688
689 /* Compute next pc. */
690 pc = get_stack_long(child, PT_BPC);
691
692 if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
693 != sizeof(insn))
694 break;
695
696 compute_next_pc(insn, pc, &next_pc, child);
697 if (next_pc & 0x80000000)
698 break;
699
700 if (embed_debug_trap(child, next_pc))
701 break;
702
703 invalidate_cache();
704 child->exit_code = data;
705
706 /* give it a chance to run. */
707 wake_up_process(child);
708 ret = 0;
709 break;
710 }
711
712 /*
713 * detach a process that was attached.
714 */
715 case PTRACE_DETACH:
716 ret = 0;
717 ret = ptrace_detach(child, data);
718 break;
719
720 case PTRACE_GETREGS:
721 ret = ptrace_getregs(child, (void __user *)data);
722 break;
723
724 case PTRACE_SETREGS:
725 ret = ptrace_setregs(child, (void __user *)data);
726 break;
727
728 default:
729 ret = ptrace_request(child, request, addr, data);
730 break;
731 }
732
733 return ret;
734}
735
dfb7dac3 736asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
1da177e4
LT
737{
738 struct task_struct *child;
739 int ret;
740
741 lock_kernel();
1da177e4 742 if (request == PTRACE_TRACEME) {
6b9c7ed8 743 ret = ptrace_traceme();
1da177e4
LT
744 goto out;
745 }
1da177e4 746
6b9c7ed8
CH
747 child = ptrace_get_task_struct(pid);
748 if (IS_ERR(child)) {
749 ret = PTR_ERR(child);
1da177e4 750 goto out;
6b9c7ed8 751 }
1da177e4
LT
752
753 if (request == PTRACE_ATTACH) {
754 ret = ptrace_attach(child);
755 if (ret == 0)
756 init_debug_traps(child);
757 goto out_tsk;
758 }
759
760 ret = ptrace_check_attach(child, request == PTRACE_KILL);
761 if (ret == 0)
762 ret = do_ptrace(request, child, addr, data);
763
764out_tsk:
765 put_task_struct(child);
766out:
767 unlock_kernel();
768
769 return ret;
770}
771
772/* notification of system call entry/exit
773 * - triggered by current->work.syscall_trace
774 */
775void do_syscall_trace(void)
776{
777 if (!test_thread_flag(TIF_SYSCALL_TRACE))
778 return;
779 if (!(current->ptrace & PT_PTRACED))
780 return;
781 /* the 0x80 provides a way for the tracing parent to distinguish
782 between a syscall stop and SIGTRAP delivery */
783 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
784 ? 0x80 : 0));
785
786 /*
787 * this isn't the same as continuing with a signal, but it will do
788 * for normal use. strace only continues with a signal if the
789 * stopping signal is not SIGTRAP. -brl
790 */
791 if (current->exit_code) {
792 send_sig(current->exit_code, current, 1);
793 current->exit_code = 0;
794 }
795}