3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
5 * Derived from "arch/m68k/kernel/ptrace.c"
6 * Copyright (C) 1994 by Hamish Macdonald
7 * Taken from linux/kernel/ptrace.c and modified for M680x0.
8 * linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds
10 * Modified by Cort Dougan (cort@hq.fsmlabs.com)
11 * and Paul Mackerras (paulus@samba.org).
13 * This file is subject to the terms and conditions of the GNU General
14 * Public License. See the file README.legal in the main directory of
15 * this archive for more details.
18 #include <linux/kernel.h>
19 #include <linux/sched.h>
21 #include <linux/smp.h>
22 #include <linux/errno.h>
23 #include <linux/ptrace.h>
24 #include <linux/regset.h>
25 #include <linux/elf.h>
26 #include <linux/user.h>
27 #include <linux/security.h>
28 #include <linux/signal.h>
29 #include <linux/seccomp.h>
30 #include <linux/audit.h>
32 #include <linux/module.h>
35 #include <asm/uaccess.h>
37 #include <asm/pgtable.h>
38 #include <asm/system.h>
41 * does not yet catch signals sent when the child dies.
42 * in exit.c or in signal.c.
46 * Set of msr bits that gdb can change on behalf of a process.
48 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
49 #define MSR_DEBUGCHANGE 0
51 #define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
55 * Max register writeable via put_reg
58 #define PT_MAX_PUT_REG PT_MQ
60 #define PT_MAX_PUT_REG PT_CCR
63 static unsigned long get_user_msr(struct task_struct *task)
65 return task->thread.regs->msr | task->thread.fpexc_mode;
68 static int set_user_msr(struct task_struct *task, unsigned long msr)
70 task->thread.regs->msr &= ~MSR_DEBUGCHANGE;
71 task->thread.regs->msr |= msr & MSR_DEBUGCHANGE;
76 * We prevent mucking around with the reserved area of trap
77 * which are used internally by the kernel.
79 static int set_user_trap(struct task_struct *task, unsigned long trap)
81 task->thread.regs->trap = trap & 0xfff0;
86 * Get contents of register REGNO in task TASK.
88 unsigned long ptrace_get_reg(struct task_struct *task, int regno)
90 if (task->thread.regs == NULL)
94 return get_user_msr(task);
96 if (regno < (sizeof(struct pt_regs) / sizeof(unsigned long)))
97 return ((unsigned long *)task->thread.regs)[regno];
103 * Write contents of register REGNO in task TASK.
105 int ptrace_put_reg(struct task_struct *task, int regno, unsigned long data)
107 if (task->thread.regs == NULL)
111 return set_user_msr(task, data);
112 if (regno == PT_TRAP)
113 return set_user_trap(task, data);
115 if (regno <= PT_MAX_PUT_REG) {
116 ((unsigned long *)task->thread.regs)[regno] = data;
122 static int gpr_get(struct task_struct *target, const struct user_regset *regset,
123 unsigned int pos, unsigned int count,
124 void *kbuf, void __user *ubuf)
128 if (target->thread.regs == NULL)
131 CHECK_FULL_REGS(target->thread.regs);
133 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
135 0, offsetof(struct pt_regs, msr));
137 unsigned long msr = get_user_msr(target);
138 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &msr,
139 offsetof(struct pt_regs, msr),
140 offsetof(struct pt_regs, msr) +
144 BUILD_BUG_ON(offsetof(struct pt_regs, orig_gpr3) !=
145 offsetof(struct pt_regs, msr) + sizeof(long));
148 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
149 &target->thread.regs->orig_gpr3,
150 offsetof(struct pt_regs, orig_gpr3),
151 sizeof(struct pt_regs));
153 ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
154 sizeof(struct pt_regs), -1);
159 static int gpr_set(struct task_struct *target, const struct user_regset *regset,
160 unsigned int pos, unsigned int count,
161 const void *kbuf, const void __user *ubuf)
166 if (target->thread.regs == NULL)
169 CHECK_FULL_REGS(target->thread.regs);
171 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
173 0, PT_MSR * sizeof(reg));
175 if (!ret && count > 0) {
176 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®,
177 PT_MSR * sizeof(reg),
178 (PT_MSR + 1) * sizeof(reg));
180 ret = set_user_msr(target, reg);
183 BUILD_BUG_ON(offsetof(struct pt_regs, orig_gpr3) !=
184 offsetof(struct pt_regs, msr) + sizeof(long));
187 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
188 &target->thread.regs->orig_gpr3,
189 PT_ORIG_R3 * sizeof(reg),
190 (PT_MAX_PUT_REG + 1) * sizeof(reg));
192 if (PT_MAX_PUT_REG + 1 < PT_TRAP && !ret)
193 ret = user_regset_copyin_ignore(
194 &pos, &count, &kbuf, &ubuf,
195 (PT_MAX_PUT_REG + 1) * sizeof(reg),
196 PT_TRAP * sizeof(reg));
198 if (!ret && count > 0) {
199 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, ®,
200 PT_TRAP * sizeof(reg),
201 (PT_TRAP + 1) * sizeof(reg));
203 ret = set_user_trap(target, reg);
207 ret = user_regset_copyin_ignore(
208 &pos, &count, &kbuf, &ubuf,
209 (PT_TRAP + 1) * sizeof(reg), -1);
214 static int fpr_get(struct task_struct *target, const struct user_regset *regset,
215 unsigned int pos, unsigned int count,
216 void *kbuf, void __user *ubuf)
222 flush_fp_to_thread(target);
225 /* copy to local buffer then write that out */
226 for (i = 0; i < 32 ; i++)
227 buf[i] = target->thread.TS_FPR(i);
228 memcpy(&buf[32], &target->thread.fpscr, sizeof(double));
229 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
232 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) !=
233 offsetof(struct thread_struct, TS_FPR(32)));
235 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
236 &target->thread.fpr, 0, -1);
240 static int fpr_set(struct task_struct *target, const struct user_regset *regset,
241 unsigned int pos, unsigned int count,
242 const void *kbuf, const void __user *ubuf)
248 flush_fp_to_thread(target);
251 /* copy to local buffer then write that out */
252 i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1);
255 for (i = 0; i < 32 ; i++)
256 target->thread.TS_FPR(i) = buf[i];
257 memcpy(&target->thread.fpscr, &buf[32], sizeof(double));
260 BUILD_BUG_ON(offsetof(struct thread_struct, fpscr) !=
261 offsetof(struct thread_struct, TS_FPR(32)));
263 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
264 &target->thread.fpr, 0, -1);
268 #ifdef CONFIG_ALTIVEC
270 * Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go.
271 * The transfer totals 34 quadword. Quadwords 0-31 contain the
272 * corresponding vector registers. Quadword 32 contains the vscr as the
273 * last word (offset 12) within that quadword. Quadword 33 contains the
274 * vrsave as the first word (offset 0) within the quadword.
276 * This definition of the VMX state is compatible with the current PPC32
277 * ptrace interface. This allows signal handling and ptrace to use the
278 * same structures. This also simplifies the implementation of a bi-arch
279 * (combined (32- and 64-bit) gdb.
282 static int vr_active(struct task_struct *target,
283 const struct user_regset *regset)
285 flush_altivec_to_thread(target);
286 return target->thread.used_vr ? regset->n : 0;
289 static int vr_get(struct task_struct *target, const struct user_regset *regset,
290 unsigned int pos, unsigned int count,
291 void *kbuf, void __user *ubuf)
295 flush_altivec_to_thread(target);
297 BUILD_BUG_ON(offsetof(struct thread_struct, vscr) !=
298 offsetof(struct thread_struct, vr[32]));
300 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
301 &target->thread.vr, 0,
302 33 * sizeof(vector128));
305 * Copy out only the low-order word of vrsave.
311 memset(&vrsave, 0, sizeof(vrsave));
312 vrsave.word = target->thread.vrsave;
313 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &vrsave,
314 33 * sizeof(vector128), -1);
320 static int vr_set(struct task_struct *target, const struct user_regset *regset,
321 unsigned int pos, unsigned int count,
322 const void *kbuf, const void __user *ubuf)
326 flush_altivec_to_thread(target);
328 BUILD_BUG_ON(offsetof(struct thread_struct, vscr) !=
329 offsetof(struct thread_struct, vr[32]));
331 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
332 &target->thread.vr, 0, 33 * sizeof(vector128));
333 if (!ret && count > 0) {
335 * We use only the first word of vrsave.
341 memset(&vrsave, 0, sizeof(vrsave));
342 vrsave.word = target->thread.vrsave;
343 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &vrsave,
344 33 * sizeof(vector128), -1);
346 target->thread.vrsave = vrsave.word;
351 #endif /* CONFIG_ALTIVEC */
356 * For get_evrregs/set_evrregs functions 'data' has the following layout:
365 static int evr_active(struct task_struct *target,
366 const struct user_regset *regset)
368 flush_spe_to_thread(target);
369 return target->thread.used_spe ? regset->n : 0;
372 static int evr_get(struct task_struct *target, const struct user_regset *regset,
373 unsigned int pos, unsigned int count,
374 void *kbuf, void __user *ubuf)
378 flush_spe_to_thread(target);
380 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
382 0, sizeof(target->thread.evr));
384 BUILD_BUG_ON(offsetof(struct thread_struct, acc) + sizeof(u64) !=
385 offsetof(struct thread_struct, spefscr));
388 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
390 sizeof(target->thread.evr), -1);
395 static int evr_set(struct task_struct *target, const struct user_regset *regset,
396 unsigned int pos, unsigned int count,
397 const void *kbuf, const void __user *ubuf)
401 flush_spe_to_thread(target);
403 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
405 0, sizeof(target->thread.evr));
407 BUILD_BUG_ON(offsetof(struct thread_struct, acc) + sizeof(u64) !=
408 offsetof(struct thread_struct, spefscr));
411 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
413 sizeof(target->thread.evr), -1);
417 #endif /* CONFIG_SPE */
421 * These are our native regset flavors.
423 enum powerpc_regset {
426 #ifdef CONFIG_ALTIVEC
434 static const struct user_regset native_regsets[] = {
436 .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
437 .size = sizeof(long), .align = sizeof(long),
438 .get = gpr_get, .set = gpr_set
441 .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
442 .size = sizeof(double), .align = sizeof(double),
443 .get = fpr_get, .set = fpr_set
445 #ifdef CONFIG_ALTIVEC
447 .core_note_type = NT_PPC_VMX, .n = 34,
448 .size = sizeof(vector128), .align = sizeof(vector128),
449 .active = vr_active, .get = vr_get, .set = vr_set
455 .size = sizeof(u32), .align = sizeof(u32),
456 .active = evr_active, .get = evr_get, .set = evr_set
461 static const struct user_regset_view user_ppc_native_view = {
462 .name = UTS_MACHINE, .e_machine = ELF_ARCH, .ei_osabi = ELF_OSABI,
463 .regsets = native_regsets, .n = ARRAY_SIZE(native_regsets)
467 #include <linux/compat.h>
469 static int gpr32_get(struct task_struct *target,
470 const struct user_regset *regset,
471 unsigned int pos, unsigned int count,
472 void *kbuf, void __user *ubuf)
474 const unsigned long *regs = &target->thread.regs->gpr[0];
475 compat_ulong_t *k = kbuf;
476 compat_ulong_t __user *u = ubuf;
479 if (target->thread.regs == NULL)
482 CHECK_FULL_REGS(target->thread.regs);
485 count /= sizeof(reg);
488 for (; count > 0 && pos < PT_MSR; --count)
491 for (; count > 0 && pos < PT_MSR; --count)
492 if (__put_user((compat_ulong_t) regs[pos++], u++))
495 if (count > 0 && pos == PT_MSR) {
496 reg = get_user_msr(target);
499 else if (__put_user(reg, u++))
506 for (; count > 0 && pos < PT_REGS_COUNT; --count)
509 for (; count > 0 && pos < PT_REGS_COUNT; --count)
510 if (__put_user((compat_ulong_t) regs[pos++], u++))
516 count *= sizeof(reg);
517 return user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
518 PT_REGS_COUNT * sizeof(reg), -1);
521 static int gpr32_set(struct task_struct *target,
522 const struct user_regset *regset,
523 unsigned int pos, unsigned int count,
524 const void *kbuf, const void __user *ubuf)
526 unsigned long *regs = &target->thread.regs->gpr[0];
527 const compat_ulong_t *k = kbuf;
528 const compat_ulong_t __user *u = ubuf;
531 if (target->thread.regs == NULL)
534 CHECK_FULL_REGS(target->thread.regs);
537 count /= sizeof(reg);
540 for (; count > 0 && pos < PT_MSR; --count)
543 for (; count > 0 && pos < PT_MSR; --count) {
544 if (__get_user(reg, u++))
550 if (count > 0 && pos == PT_MSR) {
553 else if (__get_user(reg, u++))
555 set_user_msr(target, reg);
561 for (; count > 0 && pos <= PT_MAX_PUT_REG; --count)
563 for (; count > 0 && pos < PT_TRAP; --count, ++pos)
566 for (; count > 0 && pos <= PT_MAX_PUT_REG; --count) {
567 if (__get_user(reg, u++))
571 for (; count > 0 && pos < PT_TRAP; --count, ++pos)
572 if (__get_user(reg, u++))
576 if (count > 0 && pos == PT_TRAP) {
579 else if (__get_user(reg, u++))
581 set_user_trap(target, reg);
589 count *= sizeof(reg);
590 return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
591 (PT_TRAP + 1) * sizeof(reg), -1);
595 * These are the regset flavors matching the CONFIG_PPC32 native set.
597 static const struct user_regset compat_regsets[] = {
599 .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
600 .size = sizeof(compat_long_t), .align = sizeof(compat_long_t),
601 .get = gpr32_get, .set = gpr32_set
604 .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
605 .size = sizeof(double), .align = sizeof(double),
606 .get = fpr_get, .set = fpr_set
608 #ifdef CONFIG_ALTIVEC
610 .core_note_type = NT_PPC_VMX, .n = 34,
611 .size = sizeof(vector128), .align = sizeof(vector128),
612 .active = vr_active, .get = vr_get, .set = vr_set
617 .core_note_type = NT_PPC_SPE, .n = 35,
618 .size = sizeof(u32), .align = sizeof(u32),
619 .active = evr_active, .get = evr_get, .set = evr_set
624 static const struct user_regset_view user_ppc_compat_view = {
625 .name = "ppc", .e_machine = EM_PPC, .ei_osabi = ELF_OSABI,
626 .regsets = compat_regsets, .n = ARRAY_SIZE(compat_regsets)
628 #endif /* CONFIG_PPC64 */
630 const struct user_regset_view *task_user_regset_view(struct task_struct *task)
633 if (test_tsk_thread_flag(task, TIF_32BIT))
634 return &user_ppc_compat_view;
636 return &user_ppc_native_view;
640 void user_enable_single_step(struct task_struct *task)
642 struct pt_regs *regs = task->thread.regs;
645 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
646 task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC;
652 set_tsk_thread_flag(task, TIF_SINGLESTEP);
655 void user_disable_single_step(struct task_struct *task)
657 struct pt_regs *regs = task->thread.regs;
660 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
661 task->thread.dbcr0 = 0;
662 regs->msr &= ~MSR_DE;
664 regs->msr &= ~MSR_SE;
667 clear_tsk_thread_flag(task, TIF_SINGLESTEP);
670 static int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
673 /* We only support one DABR and no IABRS at the moment */
677 /* The bottom 3 bits are flags */
678 if ((data & ~0x7UL) >= TASK_SIZE)
681 /* Ensure translation is on */
682 if (data && !(data & DABR_TRANSLATION))
685 task->thread.dabr = data;
690 * Called by kernel/ptrace.c when detaching..
692 * Make sure single step bits etc are not set.
694 void ptrace_disable(struct task_struct *child)
696 /* make sure the single step bit is not set. */
697 user_disable_single_step(child);
701 * Here are the old "legacy" powerpc specific getregs/setregs ptrace calls,
702 * we mark them as obsolete now, they will be removed in a future version
704 static long arch_ptrace_old(struct task_struct *child, long request, long addr,
708 case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */
709 return copy_regset_to_user(child, &user_ppc_native_view,
710 REGSET_GPR, 0, 32 * sizeof(long),
711 (void __user *) data);
713 case PPC_PTRACE_SETREGS: /* Set GPRs 0 - 31. */
714 return copy_regset_from_user(child, &user_ppc_native_view,
715 REGSET_GPR, 0, 32 * sizeof(long),
716 (const void __user *) data);
718 case PPC_PTRACE_GETFPREGS: /* Get FPRs 0 - 31. */
719 return copy_regset_to_user(child, &user_ppc_native_view,
720 REGSET_FPR, 0, 32 * sizeof(double),
721 (void __user *) data);
723 case PPC_PTRACE_SETFPREGS: /* Set FPRs 0 - 31. */
724 return copy_regset_from_user(child, &user_ppc_native_view,
725 REGSET_FPR, 0, 32 * sizeof(double),
726 (const void __user *) data);
732 long arch_ptrace(struct task_struct *child, long request, long addr, long data)
737 /* read the word at location addr in the USER area. */
738 case PTRACE_PEEKUSR: {
739 unsigned long index, tmp;
742 /* convert to index and check */
744 index = (unsigned long) addr >> 2;
745 if ((addr & 3) || (index > PT_FPSCR)
746 || (child->thread.regs == NULL))
748 index = (unsigned long) addr >> 3;
749 if ((addr & 7) || (index > PT_FPSCR))
753 CHECK_FULL_REGS(child->thread.regs);
754 if (index < PT_FPR0) {
755 tmp = ptrace_get_reg(child, (int) index);
757 flush_fp_to_thread(child);
758 tmp = ((unsigned long *)child->thread.fpr)
759 [TS_FPRWIDTH * (index - PT_FPR0)];
761 ret = put_user(tmp,(unsigned long __user *) data);
765 /* write the word at location addr in the USER area */
766 case PTRACE_POKEUSR: {
770 /* convert to index and check */
772 index = (unsigned long) addr >> 2;
773 if ((addr & 3) || (index > PT_FPSCR)
774 || (child->thread.regs == NULL))
776 index = (unsigned long) addr >> 3;
777 if ((addr & 7) || (index > PT_FPSCR))
781 CHECK_FULL_REGS(child->thread.regs);
782 if (index < PT_FPR0) {
783 ret = ptrace_put_reg(child, index, data);
785 flush_fp_to_thread(child);
786 ((unsigned long *)child->thread.fpr)
787 [TS_FPRWIDTH * (index - PT_FPR0)] = data;
793 case PTRACE_GET_DEBUGREG: {
795 /* We only support one DABR and no IABRS at the moment */
798 ret = put_user(child->thread.dabr,
799 (unsigned long __user *)data);
803 case PTRACE_SET_DEBUGREG:
804 ret = ptrace_set_debugreg(child, addr, data);
808 case PTRACE_GETREGS64:
810 case PTRACE_GETREGS: /* Get all pt_regs from the child. */
811 return copy_regset_to_user(child, &user_ppc_native_view,
813 0, sizeof(struct pt_regs),
814 (void __user *) data);
817 case PTRACE_SETREGS64:
819 case PTRACE_SETREGS: /* Set all gp regs in the child. */
820 return copy_regset_from_user(child, &user_ppc_native_view,
822 0, sizeof(struct pt_regs),
823 (const void __user *) data);
825 case PTRACE_GETFPREGS: /* Get the child FPU state (FPR0...31 + FPSCR) */
826 return copy_regset_to_user(child, &user_ppc_native_view,
828 0, sizeof(elf_fpregset_t),
829 (void __user *) data);
831 case PTRACE_SETFPREGS: /* Set the child FPU state (FPR0...31 + FPSCR) */
832 return copy_regset_from_user(child, &user_ppc_native_view,
834 0, sizeof(elf_fpregset_t),
835 (const void __user *) data);
837 #ifdef CONFIG_ALTIVEC
838 case PTRACE_GETVRREGS:
839 return copy_regset_to_user(child, &user_ppc_native_view,
841 0, (33 * sizeof(vector128) +
843 (void __user *) data);
845 case PTRACE_SETVRREGS:
846 return copy_regset_from_user(child, &user_ppc_native_view,
848 0, (33 * sizeof(vector128) +
850 (const void __user *) data);
853 case PTRACE_GETEVRREGS:
854 /* Get the child spe register state. */
855 return copy_regset_to_user(child, &user_ppc_native_view,
856 REGSET_SPE, 0, 35 * sizeof(u32),
857 (void __user *) data);
859 case PTRACE_SETEVRREGS:
860 /* Set the child spe register state. */
861 return copy_regset_from_user(child, &user_ppc_native_view,
862 REGSET_SPE, 0, 35 * sizeof(u32),
863 (const void __user *) data);
866 /* Old reverse args ptrace callss */
867 case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */
868 case PPC_PTRACE_SETREGS: /* Set GPRs 0 - 31. */
869 case PPC_PTRACE_GETFPREGS: /* Get FPRs 0 - 31. */
870 case PPC_PTRACE_SETFPREGS: /* Get FPRs 0 - 31. */
871 ret = arch_ptrace_old(child, request, addr, data);
875 ret = ptrace_request(child, request, addr, data);
881 static void do_syscall_trace(void)
883 /* the 0x80 provides a way for the tracing parent to distinguish
884 between a syscall stop and SIGTRAP delivery */
885 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
889 * this isn't the same as continuing with a signal, but it will do
890 * for normal use. strace only continues with a signal if the
891 * stopping signal is not SIGTRAP. -brl
893 if (current->exit_code) {
894 send_sig(current->exit_code, current, 1);
895 current->exit_code = 0;
899 void do_syscall_trace_enter(struct pt_regs *regs)
901 secure_computing(regs->gpr[0]);
903 if (test_thread_flag(TIF_SYSCALL_TRACE)
904 && (current->ptrace & PT_PTRACED))
907 if (unlikely(current->audit_context)) {
909 if (!test_thread_flag(TIF_32BIT))
910 audit_syscall_entry(AUDIT_ARCH_PPC64,
912 regs->gpr[3], regs->gpr[4],
913 regs->gpr[5], regs->gpr[6]);
916 audit_syscall_entry(AUDIT_ARCH_PPC,
918 regs->gpr[3] & 0xffffffff,
919 regs->gpr[4] & 0xffffffff,
920 regs->gpr[5] & 0xffffffff,
921 regs->gpr[6] & 0xffffffff);
925 void do_syscall_trace_leave(struct pt_regs *regs)
927 if (unlikely(current->audit_context))
928 audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS,
931 if ((test_thread_flag(TIF_SYSCALL_TRACE)
932 || test_thread_flag(TIF_SINGLESTEP))
933 && (current->ptrace & PT_PTRACED))