2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
6 * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Linux for s390 port by D.J. Barrow
8 * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
9 * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
10 * port by Greg Banks <gbanks@pocketpenguins.com>
12 * All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. The name of the author may not be used to endorse or promote products
23 * derived from this software without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 #include <sys/resource.h>
42 #include <sys/utsname.h>
52 #ifdef HAVE_LINUX_PTRACE_H
53 # undef PTRACE_SYSCALL
54 # ifdef HAVE_STRUCT_IA64_FPREG
55 # define ia64_fpreg XXX_ia64_fpreg
57 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
58 # define pt_all_user_regs XXX_pt_all_user_regs
60 # ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
61 # define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
63 # include <linux/ptrace.h>
64 # undef ptrace_peeksiginfo_args
66 # undef pt_all_user_regs
71 # undef PTRACE_GETREGS
72 # define PTRACE_GETREGS PTRACE_GETREGS64
73 # undef PTRACE_SETREGS
74 # define PTRACE_SETREGS PTRACE_SETREGS64
77 #ifdef HAVE_LINUX_FUTEX_H
78 # include <linux/futex.h>
90 # define FUTEX_REQUEUE 3
94 #include <asm/posix_types.h>
96 #define GETGROUPS_T __kernel_gid_t
98 #define GETGROUPS32_T __kernel_gid32_t
101 # include <asm/ptrace_offsets.h>
102 # include <asm/rse.h>
106 # include <sys/prctl.h>
108 #include "xlat/prctl_options.h"
111 unalignctl_string(unsigned int ctl)
113 static char buf[sizeof(int)*2 + 2];
116 #ifdef PR_UNALIGN_NOPRINT
117 case PR_UNALIGN_NOPRINT:
120 #ifdef PR_UNALIGN_SIGBUS
121 case PR_UNALIGN_SIGBUS:
127 sprintf(buf, "%x", ctl);
132 sys_prctl(struct tcb *tcp)
137 printxval(prctl_options, tcp->u_arg[0], "PR_???");
138 switch (tcp->u_arg[0]) {
143 #ifdef PR_SET_PDEATHSIG
144 case PR_SET_PDEATHSIG:
145 tprintf(", %lu", tcp->u_arg[1]);
148 #ifdef PR_GET_PDEATHSIG
149 case PR_GET_PDEATHSIG:
152 #ifdef PR_SET_DUMPABLE
153 case PR_SET_DUMPABLE:
154 tprintf(", %lu", tcp->u_arg[1]);
157 #ifdef PR_GET_DUMPABLE
158 case PR_GET_DUMPABLE:
161 #ifdef PR_SET_UNALIGN
163 tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
166 #ifdef PR_GET_UNALIGN
168 tprintf(", %#lx", tcp->u_arg[1]);
171 #ifdef PR_SET_KEEPCAPS
172 case PR_SET_KEEPCAPS:
173 tprintf(", %lu", tcp->u_arg[1]);
176 #ifdef PR_GET_KEEPCAPS
177 case PR_GET_KEEPCAPS:
181 for (i = 1; i < tcp->s_ent->nargs; i++)
182 tprintf(", %#lx", tcp->u_arg[i]);
186 switch (tcp->u_arg[0]) {
187 #ifdef PR_GET_PDEATHSIG
188 case PR_GET_PDEATHSIG:
189 if (umove(tcp, tcp->u_arg[1], &i) < 0)
190 tprintf(", %#lx", tcp->u_arg[1]);
192 tprintf(", {%u}", i);
195 #ifdef PR_GET_DUMPABLE
196 case PR_GET_DUMPABLE:
197 return RVAL_UDECIMAL;
199 #ifdef PR_GET_UNALIGN
201 if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
203 tcp->auxstr = unalignctl_string(i);
206 #ifdef PR_GET_KEEPCAPS
207 case PR_GET_KEEPCAPS:
208 return RVAL_UDECIMAL;
216 #endif /* HAVE_PRCTL */
219 sys_sethostname(struct tcb *tcp)
222 printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
223 tprintf(", %lu", tcp->u_arg[1]);
230 sys_gethostname(struct tcb *tcp)
234 tprintf("%#lx", tcp->u_arg[0]);
236 printstr(tcp, tcp->u_arg[0], -1);
237 tprintf(", %lu", tcp->u_arg[1]);
244 sys_setdomainname(struct tcb *tcp)
247 printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
248 tprintf(", %lu", tcp->u_arg[1]);
254 sys_exit(struct tcb *tcp)
257 fprintf(stderr, "_exit returned!\n");
260 /* special case: we stop tracing this process, finish line now */
261 tprintf("%ld) ", tcp->u_arg[0]);
268 /* defines copied from linux/sched.h since we can't include that
269 * ourselves (it conflicts with *lots* of libc includes)
271 #define CSIGNAL 0x000000ff /* signal mask to be sent at exit */
272 #define CLONE_VM 0x00000100 /* set if VM shared between processes */
273 #define CLONE_FS 0x00000200 /* set if fs info shared between processes */
274 #define CLONE_FILES 0x00000400 /* set if open files shared between processes */
275 #define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */
276 #define CLONE_IDLETASK 0x00001000 /* kernel-only flag */
277 #define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
278 #define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
279 #define CLONE_PARENT 0x00008000 /* set if we want to have the same parent as the cloner */
280 #define CLONE_THREAD 0x00010000 /* Same thread group? */
281 #define CLONE_NEWNS 0x00020000 /* New namespace group? */
282 #define CLONE_SYSVSEM 0x00040000 /* share system V SEM_UNDO semantics */
283 #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */
284 #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */
285 #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */
286 #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
287 #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
288 #define CLONE_STOPPED 0x02000000 /* Start in stopped state */
289 #define CLONE_NEWUTS 0x04000000 /* New utsname group? */
290 #define CLONE_NEWIPC 0x08000000 /* New ipcs */
291 #define CLONE_NEWUSER 0x10000000 /* New user namespace */
292 #define CLONE_NEWPID 0x20000000 /* New pid namespace */
293 #define CLONE_NEWNET 0x40000000 /* New network namespace */
294 #define CLONE_IO 0x80000000 /* Clone io context */
296 #include "xlat/clone_flags.h"
298 #if defined I386 || defined X86_64 || defined X32
299 extern void print_user_desc(struct tcb *, long);
300 #endif /* I386 || X86_64 || X32 */
305 # define ARG_STACKSIZE (tcp->scno == SYS_clone2 ? 2 : -1)
306 # define ARG_PTID (tcp->scno == SYS_clone2 ? 3 : 2)
307 # define ARG_CTID (tcp->scno == SYS_clone2 ? 4 : 3)
308 # define ARG_TLS (tcp->scno == SYS_clone2 ? 5 : 4)
309 #elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
315 #elif defined X86_64 || defined X32
316 /* x86 personality processes have the last two arguments flipped. */
320 # define ARG_CTID ((current_personality != 1) ? 3 : 4)
321 # define ARG_TLS ((current_personality != 1) ? 4 : 3)
322 #elif defined ALPHA || defined TILE || defined OR1K
337 sys_clone(struct tcb *tcp)
340 const char *sep = "|";
341 unsigned long flags = tcp->u_arg[ARG_FLAGS];
342 tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]);
344 if (ARG_STACKSIZE != -1)
345 tprintf("stack_size=%#lx, ",
346 tcp->u_arg[ARG_STACKSIZE]);
349 if (!printflags(clone_flags, flags &~ CSIGNAL, NULL))
351 if ((flags & CSIGNAL) != 0)
352 tprintf("%s%s", sep, signame(flags & CSIGNAL));
353 if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID
354 |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
356 if (flags & CLONE_PARENT_SETTID)
357 tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]);
358 if (flags & CLONE_SETTLS) {
359 #if defined I386 || defined X86_64 || defined X32
361 if (current_personality == 1)
365 print_user_desc(tcp, tcp->u_arg[ARG_TLS]);
370 #endif /* I386 || X86_64 || X32 */
371 tprintf(", tls=%#lx", tcp->u_arg[ARG_TLS]);
373 if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID))
374 tprintf(", child_tidptr=%#lx", tcp->u_arg[ARG_CTID]);
376 /* TODO on syscall entry:
377 * We can clear CLONE_PTRACE here since it is an ancient hack
378 * to allow us to catch children, and we use another hack for that.
379 * But CLONE_PTRACE can conceivably be used by malicious programs
380 * to subvert us. By clearing this bit, we can defend against it:
381 * in untraced execution, CLONE_PTRACE should have no effect.
383 * We can also clear CLONE_UNTRACED, since it allows to start
384 * children outside of our control. At the moment
385 * I'm trying to figure out whether there is a *legitimate*
386 * use of this flag which we should respect.
392 sys_setns(struct tcb *tcp)
395 printfd(tcp, tcp->u_arg[0]);
397 printflags(clone_flags, tcp->u_arg[1], "CLONE_???");
403 sys_unshare(struct tcb *tcp)
406 printflags(clone_flags, tcp->u_arg[0], "CLONE_???");
411 sys_fork(struct tcb *tcp)
414 return RVAL_UDECIMAL;
418 int sys_getuid(struct tcb *tcp)
421 tcp->u_rval = (uid_t) tcp->u_rval;
422 return RVAL_UDECIMAL;
425 int sys_setfsuid(struct tcb *tcp)
428 tprintf("%u", (uid_t) tcp->u_arg[0]);
430 tcp->u_rval = (uid_t) tcp->u_rval;
431 return RVAL_UDECIMAL;
435 sys_setuid(struct tcb *tcp)
438 tprintf("%u", (uid_t) tcp->u_arg[0]);
444 sys_getresuid(struct tcb *tcp)
449 tprintf("%#lx, %#lx, %#lx", tcp->u_arg[0],
450 tcp->u_arg[1], tcp->u_arg[2]);
452 if (umove(tcp, tcp->u_arg[0], &uid) < 0)
453 tprintf("%#lx, ", tcp->u_arg[0]);
455 tprintf("[%lu], ", (unsigned long) uid);
456 if (umove(tcp, tcp->u_arg[1], &uid) < 0)
457 tprintf("%#lx, ", tcp->u_arg[1]);
459 tprintf("[%lu], ", (unsigned long) uid);
460 if (umove(tcp, tcp->u_arg[2], &uid) < 0)
461 tprintf("%#lx", tcp->u_arg[2]);
463 tprintf("[%lu]", (unsigned long) uid);
470 sys_setreuid(struct tcb *tcp)
473 printuid("", tcp->u_arg[0]);
474 printuid(", ", tcp->u_arg[1]);
480 sys_setresuid(struct tcb *tcp)
483 printuid("", tcp->u_arg[0]);
484 printuid(", ", tcp->u_arg[1]);
485 printuid(", ", tcp->u_arg[2]);
491 sys_setgroups(struct tcb *tcp)
494 unsigned long len, size, start, cur, end, abbrev_end;
499 tprintf("%lu, ", len);
504 start = tcp->u_arg[1];
509 size = len * sizeof(gid);
511 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
512 tprintf("%#lx", start);
516 abbrev_end = start + max_strlen * sizeof(gid);
517 if (abbrev_end < start)
523 for (cur = start; cur < end; cur += sizeof(gid)) {
526 if (cur >= abbrev_end) {
530 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
535 tprintf("%lu", (unsigned long) gid);
539 tprintf(" %#lx", tcp->u_arg[1]);
545 sys_getgroups(struct tcb *tcp)
551 tprintf("%lu, ", len);
553 unsigned long size, start, cur, end, abbrev_end;
562 start = tcp->u_arg[1];
567 if (tcp->u_arg[0] == 0) {
568 tprintf("%#lx", start);
571 size = len * sizeof(gid);
573 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
574 size / sizeof(gid) != len || end < start) {
575 tprintf("%#lx", start);
579 abbrev_end = start + max_strlen * sizeof(gid);
580 if (abbrev_end < start)
586 for (cur = start; cur < end; cur += sizeof(gid)) {
589 if (cur >= abbrev_end) {
593 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
598 tprintf("%lu", (unsigned long) gid);
602 tprintf(" %#lx", tcp->u_arg[1]);
608 sys_setgroups32(struct tcb *tcp)
611 unsigned long len, size, start, cur, end, abbrev_end;
616 tprintf("%lu, ", len);
621 start = tcp->u_arg[1];
626 size = len * sizeof(gid);
628 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
629 tprintf("%#lx", start);
633 abbrev_end = start + max_strlen * sizeof(gid);
634 if (abbrev_end < start)
640 for (cur = start; cur < end; cur += sizeof(gid)) {
643 if (cur >= abbrev_end) {
647 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
652 tprintf("%lu", (unsigned long) gid);
656 tprintf(" %#lx", tcp->u_arg[1]);
662 sys_getgroups32(struct tcb *tcp)
668 tprintf("%lu, ", len);
670 unsigned long size, start, cur, end, abbrev_end;
679 start = tcp->u_arg[1];
684 size = len * sizeof(gid);
686 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
687 size / sizeof(gid) != len || end < start) {
688 tprintf("%#lx", start);
692 abbrev_end = start + max_strlen * sizeof(gid);
693 if (abbrev_end < start)
699 for (cur = start; cur < end; cur += sizeof(gid)) {
702 if (cur >= abbrev_end) {
706 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
711 tprintf("%lu", (unsigned long) gid);
715 tprintf(" %#lx", tcp->u_arg[1]);
721 printargv(struct tcb *tcp, long addr)
726 char data[sizeof(long)];
730 unsigned wordsize = current_wordsize;
733 for (sep = ""; !abbrev(tcp) || n < max_strlen / 2; sep = ", ", ++n) {
734 if (umoven(tcp, addr, wordsize, cp.data) < 0) {
735 tprintf("%#lx", addr);
743 printstr(tcp, cp.p64, -1);
747 tprintf("%s...", sep);
751 printargc(const char *fmt, struct tcb *tcp, long addr)
756 for (count = 0; umove(tcp, addr, &cp) >= 0 && cp != NULL; count++) {
757 addr += sizeof(char *);
759 tprintf(fmt, count, count == 1 ? "" : "s");
762 #if defined(SPARC) || defined(SPARC64)
764 sys_execv(struct tcb *tcp)
767 printpath(tcp, tcp->u_arg[0]);
769 tprintf(", %#lx", tcp->u_arg[1]);
772 printargv(tcp, tcp->u_arg[1]);
781 sys_execve(struct tcb *tcp)
784 printpath(tcp, tcp->u_arg[0]);
786 tprintf(", %#lx", tcp->u_arg[1]);
789 printargv(tcp, tcp->u_arg[1]);
793 tprintf(", %#lx", tcp->u_arg[2]);
794 else if (abbrev(tcp))
795 printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]);
798 printargv(tcp, tcp->u_arg[2]);
802 if (stack_trace_enabled) {
803 unwind_capture_stacktrace(tcp);
809 if (stack_trace_enabled) {
810 unwind_cache_invalidate(tcp);
819 #define __WNOTHREAD 0x20000000
822 #define __WALL 0x40000000
825 #define __WCLONE 0x80000000
828 #include "xlat/wait4_options.h"
830 #if !defined WCOREFLAG && defined WCOREFLG
831 # define WCOREFLAG WCOREFLG
834 # define WCOREFLAG 0x80
837 # define WCOREDUMP(status) ((status) & 0200)
840 # define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
843 # define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
847 printstatus(int status)
852 * Here is a tricky presentation problem. This solution
853 * is still not entirely satisfactory but since there
854 * are no wait status constructors it will have to do.
856 if (WIFSTOPPED(status)) {
857 tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s}",
858 signame(WSTOPSIG(status)));
859 status &= ~W_STOPCODE(WSTOPSIG(status));
861 else if (WIFSIGNALED(status)) {
862 tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}",
863 signame(WTERMSIG(status)),
864 WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
865 status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG);
867 else if (WIFEXITED(status)) {
868 tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}",
869 WEXITSTATUS(status));
871 status &= ~W_EXITCODE(WEXITSTATUS(status), 0);
874 tprintf("[%#x]", status);
881 tprintf(" | %#x]", status);
887 printwaitn(struct tcb *tcp, int n, int bitness)
892 /* On Linux, kernel-side pid_t is typedef'ed to int
893 * on all arches. Also, glibc-2.8 truncates wait3 and wait4
894 * pid argument to int on 64bit arches, producing,
895 * for example, wait4(4294967295, ...) instead of -1
896 * in strace. We have to use int here, not long.
898 int pid = tcp->u_arg[0];
899 tprintf("%d, ", pid);
904 else if (syserror(tcp) || tcp->u_rval == 0)
905 tprintf("%#lx", tcp->u_arg[1]);
906 else if (umove(tcp, tcp->u_arg[1], &status) < 0)
912 printflags(wait4_options, tcp->u_arg[2], "W???");
918 else if (tcp->u_rval > 0) {
921 printrusage32(tcp, tcp->u_arg[3]);
924 printrusage(tcp, tcp->u_arg[3]);
927 tprintf("%#lx", tcp->u_arg[3]);
934 sys_waitpid(struct tcb *tcp)
936 return printwaitn(tcp, 3, 0);
940 sys_wait4(struct tcb *tcp)
942 return printwaitn(tcp, 4, 0);
947 sys_osf_wait4(struct tcb *tcp)
949 return printwaitn(tcp, 4, 1);
953 #include "xlat/waitid_types.h"
956 sys_waitid(struct tcb *tcp)
959 printxval(waitid_types, tcp->u_arg[0], "P_???");
960 tprintf(", %ld, ", tcp->u_arg[1]);
964 printsiginfo_at(tcp, tcp->u_arg[2]);
967 printflags(wait4_options, tcp->u_arg[3], "W???");
968 if (tcp->s_ent->nargs > 4) {
973 else if (tcp->u_error)
974 tprintf("%#lx", tcp->u_arg[4]);
976 printrusage(tcp, tcp->u_arg[4]);
983 sys_uname(struct tcb *tcp)
985 struct utsname uname;
988 if (syserror(tcp) || !verbose(tcp))
989 tprintf("%#lx", tcp->u_arg[0]);
990 else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
992 else if (!abbrev(tcp)) {
993 tprintf("{sysname=\"%s\", nodename=\"%s\", ",
994 uname.sysname, uname.nodename);
995 tprintf("release=\"%s\", version=\"%s\", ",
996 uname.release, uname.version);
997 tprintf("machine=\"%s\"", uname.machine);
998 #ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
999 tprintf(", domainname=\"%s\"", uname.domainname);
1004 tprintf("{sys=\"%s\", node=\"%s\", ...}",
1005 uname.sysname, uname.nodename);
1010 #include "xlat/ptrace_cmds.h"
1011 #include "xlat/ptrace_setoptions_flags.h"
1012 #include "xlat/nt_descriptor_types.h"
1014 #define uoff(member) offsetof(struct user, member)
1016 const struct xlat struct_user_offsets[] = {
1017 #if defined(S390) || defined(S390X)
1018 { PT_PSWMASK, "psw_mask" },
1019 { PT_PSWADDR, "psw_addr" },
1020 { PT_GPR0, "gpr0" },
1021 { PT_GPR1, "gpr1" },
1022 { PT_GPR2, "gpr2" },
1023 { PT_GPR3, "gpr3" },
1024 { PT_GPR4, "gpr4" },
1025 { PT_GPR5, "gpr5" },
1026 { PT_GPR6, "gpr6" },
1027 { PT_GPR7, "gpr7" },
1028 { PT_GPR8, "gpr8" },
1029 { PT_GPR9, "gpr9" },
1030 { PT_GPR10, "gpr10" },
1031 { PT_GPR11, "gpr11" },
1032 { PT_GPR12, "gpr12" },
1033 { PT_GPR13, "gpr13" },
1034 { PT_GPR14, "gpr14" },
1035 { PT_GPR15, "gpr15" },
1036 { PT_ACR0, "acr0" },
1037 { PT_ACR1, "acr1" },
1038 { PT_ACR2, "acr2" },
1039 { PT_ACR3, "acr3" },
1040 { PT_ACR4, "acr4" },
1041 { PT_ACR5, "acr5" },
1042 { PT_ACR6, "acr6" },
1043 { PT_ACR7, "acr7" },
1044 { PT_ACR8, "acr8" },
1045 { PT_ACR9, "acr9" },
1046 { PT_ACR10, "acr10" },
1047 { PT_ACR11, "acr11" },
1048 { PT_ACR12, "acr12" },
1049 { PT_ACR13, "acr13" },
1050 { PT_ACR14, "acr14" },
1051 { PT_ACR15, "acr15" },
1052 { PT_ORIGGPR2, "orig_gpr2" },
1055 { PT_FPR0_HI, "fpr0.hi" },
1056 { PT_FPR0_LO, "fpr0.lo" },
1057 { PT_FPR1_HI, "fpr1.hi" },
1058 { PT_FPR1_LO, "fpr1.lo" },
1059 { PT_FPR2_HI, "fpr2.hi" },
1060 { PT_FPR2_LO, "fpr2.lo" },
1061 { PT_FPR3_HI, "fpr3.hi" },
1062 { PT_FPR3_LO, "fpr3.lo" },
1063 { PT_FPR4_HI, "fpr4.hi" },
1064 { PT_FPR4_LO, "fpr4.lo" },
1065 { PT_FPR5_HI, "fpr5.hi" },
1066 { PT_FPR5_LO, "fpr5.lo" },
1067 { PT_FPR6_HI, "fpr6.hi" },
1068 { PT_FPR6_LO, "fpr6.lo" },
1069 { PT_FPR7_HI, "fpr7.hi" },
1070 { PT_FPR7_LO, "fpr7.lo" },
1071 { PT_FPR8_HI, "fpr8.hi" },
1072 { PT_FPR8_LO, "fpr8.lo" },
1073 { PT_FPR9_HI, "fpr9.hi" },
1074 { PT_FPR9_LO, "fpr9.lo" },
1075 { PT_FPR10_HI, "fpr10.hi" },
1076 { PT_FPR10_LO, "fpr10.lo" },
1077 { PT_FPR11_HI, "fpr11.hi" },
1078 { PT_FPR11_LO, "fpr11.lo" },
1079 { PT_FPR12_HI, "fpr12.hi" },
1080 { PT_FPR12_LO, "fpr12.lo" },
1081 { PT_FPR13_HI, "fpr13.hi" },
1082 { PT_FPR13_LO, "fpr13.lo" },
1083 { PT_FPR14_HI, "fpr14.hi" },
1084 { PT_FPR14_LO, "fpr14.lo" },
1085 { PT_FPR15_HI, "fpr15.hi" },
1086 { PT_FPR15_LO, "fpr15.lo" },
1089 { PT_FPR0, "fpr0" },
1090 { PT_FPR1, "fpr1" },
1091 { PT_FPR2, "fpr2" },
1092 { PT_FPR3, "fpr3" },
1093 { PT_FPR4, "fpr4" },
1094 { PT_FPR5, "fpr5" },
1095 { PT_FPR6, "fpr6" },
1096 { PT_FPR7, "fpr7" },
1097 { PT_FPR8, "fpr8" },
1098 { PT_FPR9, "fpr9" },
1099 { PT_FPR10, "fpr10" },
1100 { PT_FPR11, "fpr11" },
1101 { PT_FPR12, "fpr12" },
1102 { PT_FPR13, "fpr13" },
1103 { PT_FPR14, "fpr14" },
1104 { PT_FPR15, "fpr15" },
1107 { PT_CR_10, "cr10" },
1108 { PT_CR_11, "cr11" },
1109 { PT_IEEE_IP, "ieee_exception_ip" },
1110 #elif defined(SPARC)
1111 /* XXX No support for these offsets yet. */
1113 /* XXX No support for these offsets yet. */
1114 #elif defined(POWERPC)
1116 # define PT_ORIG_R3 34
1118 # define REGSIZE (sizeof(unsigned long))
1119 { REGSIZE*PT_R0, "r0" },
1120 { REGSIZE*PT_R1, "r1" },
1121 { REGSIZE*PT_R2, "r2" },
1122 { REGSIZE*PT_R3, "r3" },
1123 { REGSIZE*PT_R4, "r4" },
1124 { REGSIZE*PT_R5, "r5" },
1125 { REGSIZE*PT_R6, "r6" },
1126 { REGSIZE*PT_R7, "r7" },
1127 { REGSIZE*PT_R8, "r8" },
1128 { REGSIZE*PT_R9, "r9" },
1129 { REGSIZE*PT_R10, "r10" },
1130 { REGSIZE*PT_R11, "r11" },
1131 { REGSIZE*PT_R12, "r12" },
1132 { REGSIZE*PT_R13, "r13" },
1133 { REGSIZE*PT_R14, "r14" },
1134 { REGSIZE*PT_R15, "r15" },
1135 { REGSIZE*PT_R16, "r16" },
1136 { REGSIZE*PT_R17, "r17" },
1137 { REGSIZE*PT_R18, "r18" },
1138 { REGSIZE*PT_R19, "r19" },
1139 { REGSIZE*PT_R20, "r20" },
1140 { REGSIZE*PT_R21, "r21" },
1141 { REGSIZE*PT_R22, "r22" },
1142 { REGSIZE*PT_R23, "r23" },
1143 { REGSIZE*PT_R24, "r24" },
1144 { REGSIZE*PT_R25, "r25" },
1145 { REGSIZE*PT_R26, "r26" },
1146 { REGSIZE*PT_R27, "r27" },
1147 { REGSIZE*PT_R28, "r28" },
1148 { REGSIZE*PT_R29, "r29" },
1149 { REGSIZE*PT_R30, "r30" },
1150 { REGSIZE*PT_R31, "r31" },
1151 { REGSIZE*PT_NIP, "NIP" },
1152 { REGSIZE*PT_MSR, "MSR" },
1153 { REGSIZE*PT_ORIG_R3, "ORIG_R3" },
1154 { REGSIZE*PT_CTR, "CTR" },
1155 { REGSIZE*PT_LNK, "LNK" },
1156 { REGSIZE*PT_XER, "XER" },
1157 { REGSIZE*PT_CCR, "CCR" },
1158 { REGSIZE*PT_FPR0, "FPR0" },
1160 #elif defined(ALPHA)
1227 { PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" },
1228 { PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" },
1229 { PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" },
1230 { PT_F41, "f41" }, { PT_F42, "f42" }, { PT_F43, "f43" },
1231 { PT_F44, "f44" }, { PT_F45, "f45" }, { PT_F46, "f46" },
1232 { PT_F47, "f47" }, { PT_F48, "f48" }, { PT_F49, "f49" },
1233 { PT_F50, "f50" }, { PT_F51, "f51" }, { PT_F52, "f52" },
1234 { PT_F53, "f53" }, { PT_F54, "f54" }, { PT_F55, "f55" },
1235 { PT_F56, "f56" }, { PT_F57, "f57" }, { PT_F58, "f58" },
1236 { PT_F59, "f59" }, { PT_F60, "f60" }, { PT_F61, "f61" },
1237 { PT_F62, "f62" }, { PT_F63, "f63" }, { PT_F64, "f64" },
1238 { PT_F65, "f65" }, { PT_F66, "f66" }, { PT_F67, "f67" },
1239 { PT_F68, "f68" }, { PT_F69, "f69" }, { PT_F70, "f70" },
1240 { PT_F71, "f71" }, { PT_F72, "f72" }, { PT_F73, "f73" },
1241 { PT_F74, "f74" }, { PT_F75, "f75" }, { PT_F76, "f76" },
1242 { PT_F77, "f77" }, { PT_F78, "f78" }, { PT_F79, "f79" },
1243 { PT_F80, "f80" }, { PT_F81, "f81" }, { PT_F82, "f82" },
1244 { PT_F83, "f83" }, { PT_F84, "f84" }, { PT_F85, "f85" },
1245 { PT_F86, "f86" }, { PT_F87, "f87" }, { PT_F88, "f88" },
1246 { PT_F89, "f89" }, { PT_F90, "f90" }, { PT_F91, "f91" },
1247 { PT_F92, "f92" }, { PT_F93, "f93" }, { PT_F94, "f94" },
1248 { PT_F95, "f95" }, { PT_F96, "f96" }, { PT_F97, "f97" },
1249 { PT_F98, "f98" }, { PT_F99, "f99" }, { PT_F100, "f100" },
1250 { PT_F101, "f101" }, { PT_F102, "f102" }, { PT_F103, "f103" },
1251 { PT_F104, "f104" }, { PT_F105, "f105" }, { PT_F106, "f106" },
1252 { PT_F107, "f107" }, { PT_F108, "f108" }, { PT_F109, "f109" },
1253 { PT_F110, "f110" }, { PT_F111, "f111" }, { PT_F112, "f112" },
1254 { PT_F113, "f113" }, { PT_F114, "f114" }, { PT_F115, "f115" },
1255 { PT_F116, "f116" }, { PT_F117, "f117" }, { PT_F118, "f118" },
1256 { PT_F119, "f119" }, { PT_F120, "f120" }, { PT_F121, "f121" },
1257 { PT_F122, "f122" }, { PT_F123, "f123" }, { PT_F124, "f124" },
1258 { PT_F125, "f125" }, { PT_F126, "f126" }, { PT_F127, "f127" },
1260 { PT_F2, "f2" }, { PT_F3, "f3" }, { PT_F4, "f4" },
1261 { PT_F5, "f5" }, { PT_F10, "f10" }, { PT_F11, "f11" },
1262 { PT_F12, "f12" }, { PT_F13, "f13" }, { PT_F14, "f14" },
1263 { PT_F15, "f15" }, { PT_F16, "f16" }, { PT_F17, "f17" },
1264 { PT_F18, "f18" }, { PT_F19, "f19" }, { PT_F20, "f20" },
1265 { PT_F21, "f21" }, { PT_F22, "f22" }, { PT_F23, "f23" },
1266 { PT_F24, "f24" }, { PT_F25, "f25" }, { PT_F26, "f26" },
1267 { PT_F27, "f27" }, { PT_F28, "f28" }, { PT_F29, "f29" },
1268 { PT_F30, "f30" }, { PT_F31, "f31" }, { PT_R4, "r4" },
1269 { PT_R5, "r5" }, { PT_R6, "r6" }, { PT_R7, "r7" },
1270 { PT_B1, "b1" }, { PT_B2, "b2" }, { PT_B3, "b3" },
1271 { PT_B4, "b4" }, { PT_B5, "b5" },
1272 { PT_AR_EC, "ar.ec" }, { PT_AR_LC, "ar.lc" },
1274 { PT_CR_IPSR, "psr" }, { PT_CR_IIP, "ip" },
1275 { PT_CFM, "cfm" }, { PT_AR_UNAT, "ar.unat" },
1276 { PT_AR_PFS, "ar.pfs" }, { PT_AR_RSC, "ar.rsc" },
1277 { PT_AR_RNAT, "ar.rnat" }, { PT_AR_BSPSTORE, "ar.bspstore" },
1278 { PT_PR, "pr" }, { PT_B6, "b6" }, { PT_AR_BSP, "ar.bsp" },
1279 { PT_R1, "r1" }, { PT_R2, "r2" }, { PT_R3, "r3" },
1280 { PT_R12, "r12" }, { PT_R13, "r13" }, { PT_R14, "r14" },
1281 { PT_R15, "r15" }, { PT_R8, "r8" }, { PT_R9, "r9" },
1282 { PT_R10, "r10" }, { PT_R11, "r11" }, { PT_R16, "r16" },
1283 { PT_R17, "r17" }, { PT_R18, "r18" }, { PT_R19, "r19" },
1284 { PT_R20, "r20" }, { PT_R21, "r21" }, { PT_R22, "r22" },
1285 { PT_R23, "r23" }, { PT_R24, "r24" }, { PT_R25, "r25" },
1286 { PT_R26, "r26" }, { PT_R27, "r27" }, { PT_R28, "r28" },
1287 { PT_R29, "r29" }, { PT_R30, "r30" }, { PT_R31, "r31" },
1288 { PT_AR_CCV, "ar.ccv" }, { PT_AR_FPSR, "ar.fpsr" },
1289 { PT_B0, "b0" }, { PT_B7, "b7" }, { PT_F6, "f6" },
1290 { PT_F7, "f7" }, { PT_F8, "f8" }, { PT_F9, "f9" },
1292 { PT_AR_CSD, "ar.csd" },
1295 { PT_AR_SSD, "ar.ssd" },
1297 { PT_DBR, "dbr" }, { PT_IBR, "ibr" }, { PT_PMD, "pmd" },
1316 #elif defined(X86_64) || defined(X32)
1335 { 8*EFLAGS, "8*EFL" },
1360 { 4*(REG_REG0+1), "4*REG_REG1" },
1361 { 4*(REG_REG0+2), "4*REG_REG2" },
1362 { 4*(REG_REG0+3), "4*REG_REG3" },
1363 { 4*(REG_REG0+4), "4*REG_REG4" },
1364 { 4*(REG_REG0+5), "4*REG_REG5" },
1365 { 4*(REG_REG0+6), "4*REG_REG6" },
1366 { 4*(REG_REG0+7), "4*REG_REG7" },
1367 { 4*(REG_REG0+8), "4*REG_REG8" },
1368 { 4*(REG_REG0+9), "4*REG_REG9" },
1369 { 4*(REG_REG0+10), "4*REG_REG10" },
1370 { 4*(REG_REG0+11), "4*REG_REG11" },
1371 { 4*(REG_REG0+12), "4*REG_REG12" },
1372 { 4*(REG_REG0+13), "4*REG_REG13" },
1373 { 4*(REG_REG0+14), "4*REG_REG14" },
1381 XLAT(4*REG_SYSCALL),
1384 { 4*(REG_FPREG0+1), "4*REG_FPREG1" },
1385 { 4*(REG_FPREG0+2), "4*REG_FPREG2" },
1386 { 4*(REG_FPREG0+3), "4*REG_FPREG3" },
1387 { 4*(REG_FPREG0+4), "4*REG_FPREG4" },
1388 { 4*(REG_FPREG0+5), "4*REG_FPREG5" },
1389 { 4*(REG_FPREG0+6), "4*REG_FPREG6" },
1390 { 4*(REG_FPREG0+7), "4*REG_FPREG7" },
1391 { 4*(REG_FPREG0+8), "4*REG_FPREG8" },
1392 { 4*(REG_FPREG0+9), "4*REG_FPREG9" },
1393 { 4*(REG_FPREG0+10), "4*REG_FPREG10" },
1394 { 4*(REG_FPREG0+11), "4*REG_FPREG11" },
1395 { 4*(REG_FPREG0+12), "4*REG_FPREG12" },
1396 { 4*(REG_FPREG0+13), "4*REG_FPREG13" },
1397 { 4*(REG_FPREG0+14), "4*REG_FPREG14" },
1398 XLAT(4*REG_FPREG15),
1401 { 4*(REG_XDREG0+2), "4*REG_XDREG2" },
1402 { 4*(REG_XDREG0+4), "4*REG_XDREG4" },
1403 { 4*(REG_XDREG0+6), "4*REG_XDREG6" },
1404 { 4*(REG_XDREG0+8), "4*REG_XDREG8" },
1405 { 4*(REG_XDREG0+10), "4*REG_XDREG10" },
1406 { 4*(REG_XDREG0+12), "4*REG_XDREG12" },
1407 XLAT(4*REG_XDREG14),
1415 { 16, "syscall no.(L)" },
1416 { 20, "syscall_no.(U)" },
1559 /* This entry is in case pt_regs contains dregs (depends on
1560 the kernel build options). */
1561 { uoff(regs), "offsetof(struct user, regs)" },
1562 { uoff(fpu), "offsetof(struct user, fpu)" },
1564 { uoff(regs.ARM_r0), "r0" },
1565 { uoff(regs.ARM_r1), "r1" },
1566 { uoff(regs.ARM_r2), "r2" },
1567 { uoff(regs.ARM_r3), "r3" },
1568 { uoff(regs.ARM_r4), "r4" },
1569 { uoff(regs.ARM_r5), "r5" },
1570 { uoff(regs.ARM_r6), "r6" },
1571 { uoff(regs.ARM_r7), "r7" },
1572 { uoff(regs.ARM_r8), "r8" },
1573 { uoff(regs.ARM_r9), "r9" },
1574 { uoff(regs.ARM_r10), "r10" },
1575 { uoff(regs.ARM_fp), "fp" },
1576 { uoff(regs.ARM_ip), "ip" },
1577 { uoff(regs.ARM_sp), "sp" },
1578 { uoff(regs.ARM_lr), "lr" },
1579 { uoff(regs.ARM_pc), "pc" },
1580 { uoff(regs.ARM_cpsr), "cpsr" },
1581 #elif defined(AVR32)
1582 { uoff(regs.sr), "sr" },
1583 { uoff(regs.pc), "pc" },
1584 { uoff(regs.lr), "lr" },
1585 { uoff(regs.sp), "sp" },
1586 { uoff(regs.r12), "r12" },
1587 { uoff(regs.r11), "r11" },
1588 { uoff(regs.r10), "r10" },
1589 { uoff(regs.r9), "r9" },
1590 { uoff(regs.r8), "r8" },
1591 { uoff(regs.r7), "r7" },
1592 { uoff(regs.r6), "r6" },
1593 { uoff(regs.r5), "r5" },
1594 { uoff(regs.r4), "r4" },
1595 { uoff(regs.r3), "r3" },
1596 { uoff(regs.r2), "r2" },
1597 { uoff(regs.r1), "r1" },
1598 { uoff(regs.r0), "r0" },
1599 { uoff(regs.r12_orig), "orig_r12" },
1673 { PTREGS_OFFSET_REG(0), "r0" },
1674 { PTREGS_OFFSET_REG(1), "r1" },
1675 { PTREGS_OFFSET_REG(2), "r2" },
1676 { PTREGS_OFFSET_REG(3), "r3" },
1677 { PTREGS_OFFSET_REG(4), "r4" },
1678 { PTREGS_OFFSET_REG(5), "r5" },
1679 { PTREGS_OFFSET_REG(6), "r6" },
1680 { PTREGS_OFFSET_REG(7), "r7" },
1681 { PTREGS_OFFSET_REG(8), "r8" },
1682 { PTREGS_OFFSET_REG(9), "r9" },
1683 { PTREGS_OFFSET_REG(10), "r10" },
1684 { PTREGS_OFFSET_REG(11), "r11" },
1685 { PTREGS_OFFSET_REG(12), "r12" },
1686 { PTREGS_OFFSET_REG(13), "r13" },
1687 { PTREGS_OFFSET_REG(14), "r14" },
1688 { PTREGS_OFFSET_REG(15), "r15" },
1689 { PTREGS_OFFSET_REG(16), "r16" },
1690 { PTREGS_OFFSET_REG(17), "r17" },
1691 { PTREGS_OFFSET_REG(18), "r18" },
1692 { PTREGS_OFFSET_REG(19), "r19" },
1693 { PTREGS_OFFSET_REG(20), "r20" },
1694 { PTREGS_OFFSET_REG(21), "r21" },
1695 { PTREGS_OFFSET_REG(22), "r22" },
1696 { PTREGS_OFFSET_REG(23), "r23" },
1697 { PTREGS_OFFSET_REG(24), "r24" },
1698 { PTREGS_OFFSET_REG(25), "r25" },
1699 { PTREGS_OFFSET_REG(26), "r26" },
1700 { PTREGS_OFFSET_REG(27), "r27" },
1701 { PTREGS_OFFSET_REG(28), "r28" },
1702 { PTREGS_OFFSET_REG(29), "r29" },
1703 { PTREGS_OFFSET_REG(30), "r30" },
1704 { PTREGS_OFFSET_REG(31), "r31" },
1705 { PTREGS_OFFSET_REG(32), "r32" },
1706 { PTREGS_OFFSET_REG(33), "r33" },
1707 { PTREGS_OFFSET_REG(34), "r34" },
1708 { PTREGS_OFFSET_REG(35), "r35" },
1709 { PTREGS_OFFSET_REG(36), "r36" },
1710 { PTREGS_OFFSET_REG(37), "r37" },
1711 { PTREGS_OFFSET_REG(38), "r38" },
1712 { PTREGS_OFFSET_REG(39), "r39" },
1713 { PTREGS_OFFSET_REG(40), "r40" },
1714 { PTREGS_OFFSET_REG(41), "r41" },
1715 { PTREGS_OFFSET_REG(42), "r42" },
1716 { PTREGS_OFFSET_REG(43), "r43" },
1717 { PTREGS_OFFSET_REG(44), "r44" },
1718 { PTREGS_OFFSET_REG(45), "r45" },
1719 { PTREGS_OFFSET_REG(46), "r46" },
1720 { PTREGS_OFFSET_REG(47), "r47" },
1721 { PTREGS_OFFSET_REG(48), "r48" },
1722 { PTREGS_OFFSET_REG(49), "r49" },
1723 { PTREGS_OFFSET_REG(50), "r50" },
1724 { PTREGS_OFFSET_REG(51), "r51" },
1725 { PTREGS_OFFSET_REG(52), "r52" },
1726 { PTREGS_OFFSET_TP, "tp" },
1727 { PTREGS_OFFSET_SP, "sp" },
1728 { PTREGS_OFFSET_LR, "lr" },
1729 { PTREGS_OFFSET_PC, "pc" },
1730 { PTREGS_OFFSET_EX1, "ex1" },
1731 { PTREGS_OFFSET_FAULTNUM, "faultnum" },
1732 { PTREGS_OFFSET_ORIG_R0, "orig_r0" },
1733 { PTREGS_OFFSET_FLAGS, "flags" },
1736 XLAT(4*PT_FRAMETYPE),
1737 XLAT(4*PT_ORIG_R10),
1756 XLAT(4*PT_CSRINSTR),
1762 XLAT(4*PT_ORIG_R10),
1805 { PT_GPR(0), "r0" },
1806 { PT_GPR(1), "r1" },
1807 { PT_GPR(2), "r2" },
1808 { PT_GPR(3), "r3" },
1809 { PT_GPR(4), "r4" },
1810 { PT_GPR(5), "r5" },
1811 { PT_GPR(6), "r6" },
1812 { PT_GPR(7), "r7" },
1813 { PT_GPR(8), "r8" },
1814 { PT_GPR(9), "r9" },
1815 { PT_GPR(10), "r10" },
1816 { PT_GPR(11), "r11" },
1817 { PT_GPR(12), "r12" },
1818 { PT_GPR(13), "r13" },
1819 { PT_GPR(14), "r14" },
1820 { PT_GPR(15), "r15" },
1821 { PT_GPR(16), "r16" },
1822 { PT_GPR(17), "r17" },
1823 { PT_GPR(18), "r18" },
1824 { PT_GPR(19), "r19" },
1825 { PT_GPR(20), "r20" },
1826 { PT_GPR(21), "r21" },
1827 { PT_GPR(22), "r22" },
1828 { PT_GPR(23), "r23" },
1829 { PT_GPR(24), "r24" },
1830 { PT_GPR(25), "r25" },
1831 { PT_GPR(26), "r26" },
1832 { PT_GPR(27), "r27" },
1833 { PT_GPR(28), "r28" },
1834 { PT_GPR(29), "r29" },
1835 { PT_GPR(30), "r30" },
1836 { PT_GPR(31), "r31" },
1838 { PT_MSR, "rmsr", },
1839 { PT_EAR, "rear", },
1840 { PT_ESR, "resr", },
1841 { PT_FSR, "rfsr", },
1842 { PT_KERNEL_MODE, "kernel_mode", },
1881 { SYSCALL_NR, "syscall_nr" },
1882 { REG_AR_BASE, "ar0" },
1883 { REG_AR_BASE+1, "ar1" },
1884 { REG_AR_BASE+2, "ar2" },
1885 { REG_AR_BASE+3, "ar3" },
1886 { REG_AR_BASE+4, "ar4" },
1887 { REG_AR_BASE+5, "ar5" },
1888 { REG_AR_BASE+6, "ar6" },
1889 { REG_AR_BASE+7, "ar7" },
1890 { REG_AR_BASE+8, "ar8" },
1891 { REG_AR_BASE+9, "ar9" },
1892 { REG_AR_BASE+10, "ar10" },
1893 { REG_AR_BASE+11, "ar11" },
1894 { REG_AR_BASE+12, "ar12" },
1895 { REG_AR_BASE+13, "ar13" },
1896 { REG_AR_BASE+14, "ar14" },
1897 { REG_AR_BASE+15, "ar15" },
1898 { REG_AR_BASE+16, "ar16" },
1899 { REG_AR_BASE+17, "ar17" },
1900 { REG_AR_BASE+18, "ar18" },
1901 { REG_AR_BASE+19, "ar19" },
1902 { REG_AR_BASE+20, "ar20" },
1903 { REG_AR_BASE+21, "ar21" },
1904 { REG_AR_BASE+22, "ar22" },
1905 { REG_AR_BASE+23, "ar23" },
1906 { REG_AR_BASE+24, "ar24" },
1907 { REG_AR_BASE+25, "ar25" },
1908 { REG_AR_BASE+26, "ar26" },
1909 { REG_AR_BASE+27, "ar27" },
1910 { REG_AR_BASE+28, "ar28" },
1911 { REG_AR_BASE+29, "ar29" },
1912 { REG_AR_BASE+30, "ar30" },
1913 { REG_AR_BASE+31, "ar31" },
1914 { REG_AR_BASE+32, "ar32" },
1915 { REG_AR_BASE+33, "ar33" },
1916 { REG_AR_BASE+34, "ar34" },
1917 { REG_AR_BASE+35, "ar35" },
1918 { REG_AR_BASE+36, "ar36" },
1919 { REG_AR_BASE+37, "ar37" },
1920 { REG_AR_BASE+38, "ar38" },
1921 { REG_AR_BASE+39, "ar39" },
1922 { REG_AR_BASE+40, "ar40" },
1923 { REG_AR_BASE+41, "ar41" },
1924 { REG_AR_BASE+42, "ar42" },
1925 { REG_AR_BASE+43, "ar43" },
1926 { REG_AR_BASE+44, "ar44" },
1927 { REG_AR_BASE+45, "ar45" },
1928 { REG_AR_BASE+46, "ar46" },
1929 { REG_AR_BASE+47, "ar47" },
1930 { REG_AR_BASE+48, "ar48" },
1931 { REG_AR_BASE+49, "ar49" },
1932 { REG_AR_BASE+50, "ar50" },
1933 { REG_AR_BASE+51, "ar51" },
1934 { REG_AR_BASE+52, "ar52" },
1935 { REG_AR_BASE+53, "ar53" },
1936 { REG_AR_BASE+54, "ar54" },
1937 { REG_AR_BASE+55, "ar55" },
1938 { REG_AR_BASE+56, "ar56" },
1939 { REG_AR_BASE+57, "ar57" },
1940 { REG_AR_BASE+58, "ar58" },
1941 { REG_AR_BASE+59, "ar59" },
1942 { REG_AR_BASE+60, "ar60" },
1943 { REG_AR_BASE+61, "ar61" },
1944 { REG_AR_BASE+62, "ar62" },
1945 { REG_AR_BASE+63, "ar63" },
1946 { REG_LBEG, "lbeg" },
1947 { REG_LEND, "lend" },
1948 { REG_LCOUNT, "lcount" },
1954 { REG_A_BASE, "a0" },
1955 { REG_A_BASE+1, "a1" },
1956 { REG_A_BASE+2, "a2" },
1957 { REG_A_BASE+3, "a3" },
1958 { REG_A_BASE+4, "a4" },
1959 { REG_A_BASE+5, "a5" },
1960 { REG_A_BASE+6, "a6" },
1961 { REG_A_BASE+7, "a7" },
1962 { REG_A_BASE+8, "a8" },
1963 { REG_A_BASE+9, "a9" },
1964 { REG_A_BASE+10, "a10" },
1965 { REG_A_BASE+11, "a11" },
1966 { REG_A_BASE+12, "a12" },
1967 { REG_A_BASE+13, "a13" },
1968 { REG_A_BASE+14, "a14" },
1969 { REG_A_BASE+15, "a15" },
1972 /* Other fields in "struct user" */
1973 #if defined(S390) || defined(S390X)
1974 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
1975 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
1976 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
1977 { uoff(start_code), "offsetof(struct user, start_code)" },
1978 /* S390[X] has no start_data */
1979 { uoff(start_stack), "offsetof(struct user, start_stack)" },
1980 { uoff(signal), "offsetof(struct user, signal)" },
1981 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
1982 { uoff(magic), "offsetof(struct user, magic)" },
1983 { uoff(u_comm), "offsetof(struct user, u_comm)" },
1984 { sizeof(struct user), "sizeof(struct user)" },
1985 #elif defined(POWERPC)
1986 { sizeof(struct user), "sizeof(struct user)" },
1987 #elif defined(I386) || defined(X86_64) || defined(X32)
1988 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
1989 { uoff(i387), "offsetof(struct user, i387)" },
1990 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
1991 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
1992 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
1993 { uoff(start_code), "offsetof(struct user, start_code)" },
1994 { uoff(start_stack), "offsetof(struct user, start_stack)" },
1995 { uoff(signal), "offsetof(struct user, signal)" },
1996 { uoff(reserved), "offsetof(struct user, reserved)" },
1997 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
1998 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
1999 { uoff(magic), "offsetof(struct user, magic)" },
2000 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2001 { uoff(u_debugreg), "offsetof(struct user, u_debugreg)" },
2002 { sizeof(struct user), "sizeof(struct user)" },
2004 { sizeof(struct user), "sizeof(struct user)" },
2006 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2007 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2008 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2009 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2010 { uoff(start_code), "offsetof(struct user, start_code)" },
2011 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2012 { uoff(signal), "offsetof(struct user, signal)" },
2013 { uoff(reserved), "offsetof(struct user, reserved)" },
2014 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2015 { uoff(magic), "offsetof(struct user, magic)" },
2016 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2017 { sizeof(struct user), "sizeof(struct user)" },
2018 #elif defined(AARCH64)
2021 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2022 { uoff(m68kfp), "offsetof(struct user, m68kfp)" },
2023 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2024 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2025 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2026 { uoff(start_code), "offsetof(struct user, start_code)" },
2027 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2028 { uoff(signal), "offsetof(struct user, signal)" },
2029 { uoff(reserved), "offsetof(struct user, reserved)" },
2030 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2031 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
2032 { uoff(magic), "offsetof(struct user, magic)" },
2033 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2034 { sizeof(struct user), "sizeof(struct user)" },
2035 #elif defined(MIPS) || defined(LINUX_MIPSN32)
2036 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2037 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2038 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2039 { uoff(start_code), "offsetof(struct user, start_code)" },
2040 { uoff(start_data), "offsetof(struct user, start_data)" },
2041 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2042 { uoff(signal), "offsetof(struct user, signal)" },
2043 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2044 { uoff(magic), "offsetof(struct user, magic)" },
2045 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2046 { sizeof(struct user), "sizeof(struct user)" },
2047 #elif defined(ALPHA)
2048 { sizeof(struct user), "sizeof(struct user)" },
2049 #elif defined(SPARC)
2050 { sizeof(struct user), "sizeof(struct user)" },
2051 #elif defined(SPARC64)
2052 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2053 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2054 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2055 { uoff(signal), "offsetof(struct user, signal)" },
2056 { uoff(magic), "offsetof(struct user, magic)" },
2057 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2058 { sizeof(struct user), "sizeof(struct user)" },
2061 #elif defined(SH) || defined(SH64)
2062 { uoff(u_fpvalid), "offsetof(struct user, u_fpvalid)" },
2063 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2064 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2065 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2066 { uoff(start_code), "offsetof(struct user, start_code)" },
2067 { uoff(start_data), "offsetof(struct user, start_data)" },
2068 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2069 { uoff(signal), "offsetof(struct user, signal)" },
2070 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2071 { uoff(u_fpstate), "offsetof(struct user, u_fpstate)" },
2072 { uoff(magic), "offsetof(struct user, magic)" },
2073 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2074 { sizeof(struct user), "sizeof(struct user)" },
2075 #elif defined(CRISV10) || defined(CRISV32)
2076 { sizeof(struct user), "sizeof(struct user)" },
2079 #elif defined(MICROBLAZE)
2080 { sizeof(struct user), "sizeof(struct user)" },
2081 #elif defined(AVR32)
2082 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2083 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2084 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2085 { uoff(start_code), "offsetof(struct user, start_code)" },
2086 { uoff(start_data), "offsetof(struct user, start_data)" },
2087 { uoff(start_stack), "offsetof(struct user, start_stack)" },
2088 { uoff(signal), "offsetof(struct user, signal)" },
2089 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2090 { uoff(magic), "offsetof(struct user, magic)" },
2091 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2092 { sizeof(struct user), "sizeof(struct user)" },
2094 { uoff(u_tsize), "offsetof(struct user, u_tsize)" },
2095 { uoff(u_dsize), "offsetof(struct user, u_dsize)" },
2096 { uoff(u_ssize), "offsetof(struct user, u_ssize)" },
2097 { uoff(start_code), "offsetof(struct user, start_code)" },
2098 { uoff(signal), "offsetof(struct user, signal)" },
2099 { uoff(u_ar0), "offsetof(struct user, u_ar0)" },
2100 { uoff(magic), "offsetof(struct user, magic)" },
2101 { uoff(u_comm), "offsetof(struct user, u_comm)" },
2102 { sizeof(struct user), "sizeof(struct user)" },
2105 #elif defined(METAG)
2107 #elif defined(XTENSA)
2116 sys_ptrace(struct tcb *tcp)
2118 const struct xlat *x;
2121 if (entering(tcp)) {
2122 printxval(ptrace_cmds, tcp->u_arg[0], "PTRACE_???");
2123 tprintf(", %lu, ", tcp->u_arg[1]);
2125 addr = tcp->u_arg[2];
2126 if (tcp->u_arg[0] == PTRACE_PEEKUSER
2127 || tcp->u_arg[0] == PTRACE_POKEUSER
2129 for (x = struct_user_offsets; x->str; x++) {
2134 tprintf("%#lx, ", addr);
2135 else if (x->val > addr && x != struct_user_offsets) {
2137 tprintf("%s + %ld, ", x->str, addr - x->val);
2140 tprintf("%s, ", x->str);
2142 #ifdef PTRACE_GETREGSET
2143 if (tcp->u_arg[0] == PTRACE_GETREGSET
2144 || tcp->u_arg[0] == PTRACE_SETREGSET
2146 printxval(nt_descriptor_types, tcp->u_arg[2], "NT_???");
2150 tprintf("%#lx, ", addr);
2153 switch (tcp->u_arg[0]) {
2155 case PTRACE_PEEKDATA:
2156 case PTRACE_PEEKTEXT:
2157 case PTRACE_PEEKUSER:
2161 case PTRACE_SINGLESTEP:
2162 case PTRACE_SYSCALL:
2164 printsignal(tcp->u_arg[3]);
2166 #ifdef PTRACE_SETOPTIONS
2167 case PTRACE_SETOPTIONS:
2168 printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???");
2171 #ifdef PTRACE_SETSIGINFO
2172 case PTRACE_SETSIGINFO: {
2173 printsiginfo_at(tcp, tcp->u_arg[3]);
2177 #ifdef PTRACE_GETSIGINFO
2178 case PTRACE_GETSIGINFO:
2179 /* Don't print anything, do it at syscall return. */
2182 #ifdef PTRACE_GETREGSET
2183 case PTRACE_GETREGSET:
2185 case PTRACE_SETREGSET:
2186 tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
2190 tprintf("%#lx", tcp->u_arg[3]);
2194 switch (tcp->u_arg[0]) {
2195 case PTRACE_PEEKDATA:
2196 case PTRACE_PEEKTEXT:
2197 case PTRACE_PEEKUSER:
2201 printnum(tcp, tcp->u_arg[3], "%#lx");
2204 #ifdef PTRACE_GETSIGINFO
2205 case PTRACE_GETSIGINFO: {
2206 printsiginfo_at(tcp, tcp->u_arg[3]);
2210 #ifdef PTRACE_GETREGSET
2211 case PTRACE_GETREGSET:
2212 tprint_iov(tcp, /*len:*/ 1, tcp->u_arg[3], /*as string:*/ 0);
2220 #ifndef FUTEX_CMP_REQUEUE
2221 # define FUTEX_CMP_REQUEUE 4
2223 #ifndef FUTEX_WAKE_OP
2224 # define FUTEX_WAKE_OP 5
2226 #ifndef FUTEX_LOCK_PI
2227 # define FUTEX_LOCK_PI 6
2228 # define FUTEX_UNLOCK_PI 7
2229 # define FUTEX_TRYLOCK_PI 8
2231 #ifndef FUTEX_WAIT_BITSET
2232 # define FUTEX_WAIT_BITSET 9
2234 #ifndef FUTEX_WAKE_BITSET
2235 # define FUTEX_WAKE_BITSET 10
2237 #ifndef FUTEX_WAIT_REQUEUE_PI
2238 # define FUTEX_WAIT_REQUEUE_PI 11
2240 #ifndef FUTEX_CMP_REQUEUE_PI
2241 # define FUTEX_CMP_REQUEUE_PI 12
2243 #ifndef FUTEX_PRIVATE_FLAG
2244 # define FUTEX_PRIVATE_FLAG 128
2246 #ifndef FUTEX_CLOCK_REALTIME
2247 # define FUTEX_CLOCK_REALTIME 256
2249 #ifndef FUTEX_WAIT_PRIVATE
2250 # define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
2252 #ifndef FUTEX_WAKE_PRIVATE
2253 # define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
2255 #ifndef FUTEX_REQUEUE_PRIVATE
2256 # define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
2258 #ifndef FUTEX_CMP_REQUEUE_PRIVATE
2259 # define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
2261 #ifndef FUTEX_WAKE_OP_PRIVATE
2262 # define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
2264 #ifndef FUTEX_LOCK_PI_PRIVATE
2265 # define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
2267 #ifndef FUTEX_UNLOCK_PI_PRIVATE
2268 # define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
2270 #ifndef FUTEX_TRYLOCK_PI_PRIVATE
2271 # define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
2273 #ifndef FUTEX_WAIT_BITSET_PRIVATE
2274 # define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
2276 #ifndef FUTEX_WAKE_BITSET_PRIVATE
2277 # define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
2279 #ifndef FUTEX_WAIT_REQUEUE_PI_PRIVATE
2280 # define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
2282 #ifndef FUTEX_CMP_REQUEUE_PI_PRIVATE
2283 # define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
2285 #include "xlat/futexops.h"
2286 #ifndef FUTEX_OP_SET
2287 # define FUTEX_OP_SET 0
2288 # define FUTEX_OP_ADD 1
2289 # define FUTEX_OP_OR 2
2290 # define FUTEX_OP_ANDN 3
2291 # define FUTEX_OP_XOR 4
2292 # define FUTEX_OP_CMP_EQ 0
2293 # define FUTEX_OP_CMP_NE 1
2294 # define FUTEX_OP_CMP_LT 2
2295 # define FUTEX_OP_CMP_LE 3
2296 # define FUTEX_OP_CMP_GT 4
2297 # define FUTEX_OP_CMP_GE 5
2299 #include "xlat/futexwakeops.h"
2300 #include "xlat/futexwakecmps.h"
2303 sys_futex(struct tcb *tcp)
2305 if (entering(tcp)) {
2306 long int cmd = tcp->u_arg[1] & 127;
2307 tprintf("%p, ", (void *) tcp->u_arg[0]);
2308 printxval(futexops, tcp->u_arg[1], "FUTEX_???");
2309 tprintf(", %ld", tcp->u_arg[2]);
2310 if (cmd == FUTEX_WAKE_BITSET)
2311 tprintf(", %lx", tcp->u_arg[5]);
2312 else if (cmd == FUTEX_WAIT) {
2314 printtv(tcp, tcp->u_arg[3]);
2315 } else if (cmd == FUTEX_WAIT_BITSET) {
2317 printtv(tcp, tcp->u_arg[3]);
2318 tprintf(", %lx", tcp->u_arg[5]);
2319 } else if (cmd == FUTEX_REQUEUE)
2320 tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]);
2321 else if (cmd == FUTEX_CMP_REQUEUE || cmd == FUTEX_CMP_REQUEUE_PI)
2322 tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]);
2323 else if (cmd == FUTEX_WAKE_OP) {
2324 tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
2325 if ((tcp->u_arg[5] >> 28) & 8)
2326 tprints("FUTEX_OP_OPARG_SHIFT|");
2327 printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
2328 tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
2329 if ((tcp->u_arg[5] >> 24) & 8)
2330 tprints("FUTEX_OP_OPARG_SHIFT|");
2331 printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
2332 tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
2333 } else if (cmd == FUTEX_WAIT_REQUEUE_PI) {
2335 printtv(tcp, tcp->u_arg[3]);
2336 tprintf(", %p", (void *) tcp->u_arg[4]);
2343 print_affinitylist(struct tcb *tcp, long list, unsigned int len)
2346 unsigned long w, min_len;
2348 if (abbrev(tcp) && len / sizeof(w) > max_strlen)
2349 min_len = len - max_strlen * sizeof(w);
2352 for (; len >= sizeof(w) && len > min_len;
2353 len -= sizeof(w), list += sizeof(w)) {
2354 if (umove(tcp, list, &w) < 0)
2365 tprintf("%#lx", list);
2367 tprintf(", %s}", (len >= sizeof(w) && len > min_len ?
2370 tprints(first ? "{}" : "}");
2375 sys_sched_setaffinity(struct tcb *tcp)
2377 if (entering(tcp)) {
2378 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
2379 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]);
2385 sys_sched_getaffinity(struct tcb *tcp)
2387 if (entering(tcp)) {
2388 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
2390 if (tcp->u_rval == -1)
2391 tprintf("%#lx", tcp->u_arg[2]);
2393 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
2399 sys_get_robust_list(struct tcb *tcp)
2401 if (entering(tcp)) {
2402 tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);
2407 if (syserror(tcp) ||
2409 umove(tcp, tcp->u_arg[1], &addr) < 0) {
2410 tprintf("%#lx, ", tcp->u_arg[1]);
2412 tprintf("[%p], ", addr);
2415 if (syserror(tcp) ||
2417 umove(tcp, tcp->u_arg[2], &len) < 0) {
2418 tprintf("%#lx", tcp->u_arg[2]);
2420 tprintf("[%lu]", (unsigned long) len);
2426 #include "xlat/schedulers.h"
2429 sys_sched_getscheduler(struct tcb *tcp)
2431 if (entering(tcp)) {
2432 tprintf("%d", (int) tcp->u_arg[0]);
2433 } else if (!syserror(tcp)) {
2434 tcp->auxstr = xlookup(schedulers, tcp->u_rval);
2435 if (tcp->auxstr != NULL)
2442 sys_sched_setscheduler(struct tcb *tcp)
2444 if (entering(tcp)) {
2445 struct sched_param p;
2446 tprintf("%d, ", (int) tcp->u_arg[0]);
2447 printxval(schedulers, tcp->u_arg[1], "SCHED_???");
2448 if (umove(tcp, tcp->u_arg[2], &p) < 0)
2449 tprintf(", %#lx", tcp->u_arg[2]);
2451 tprintf(", { %d }", p.sched_priority);
2457 sys_sched_getparam(struct tcb *tcp)
2459 if (entering(tcp)) {
2460 tprintf("%d, ", (int) tcp->u_arg[0]);
2462 struct sched_param p;
2463 if (umove(tcp, tcp->u_arg[1], &p) < 0)
2464 tprintf("%#lx", tcp->u_arg[1]);
2466 tprintf("{ %d }", p.sched_priority);
2472 sys_sched_setparam(struct tcb *tcp)
2474 if (entering(tcp)) {
2475 struct sched_param p;
2476 if (umove(tcp, tcp->u_arg[1], &p) < 0)
2477 tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
2479 tprintf("%d, { %d }", (int) tcp->u_arg[0], p.sched_priority);
2485 sys_sched_get_priority_min(struct tcb *tcp)
2487 if (entering(tcp)) {
2488 printxval(schedulers, tcp->u_arg[0], "SCHED_???");
2494 sys_sched_rr_get_interval(struct tcb *tcp)
2496 if (entering(tcp)) {
2497 tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);
2500 tprintf("%#lx", tcp->u_arg[1]);
2502 print_timespec(tcp, tcp->u_arg[1]);
2507 #if defined X86_64 || defined X32
2508 # include <asm/prctl.h>
2510 #include "xlat/archvals.h"
2513 sys_arch_prctl(struct tcb *tcp)
2515 if (entering(tcp)) {
2516 printxval(archvals, tcp->u_arg[0], "ARCH_???");
2517 if (tcp->u_arg[0] == ARCH_SET_GS
2518 || tcp->u_arg[0] == ARCH_SET_FS
2520 tprintf(", %#lx", tcp->u_arg[1]);
2523 if (tcp->u_arg[0] == ARCH_GET_GS
2524 || tcp->u_arg[0] == ARCH_GET_FS
2527 if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1)
2528 tprintf(", [%#lx]", v);
2530 tprintf(", %#lx", tcp->u_arg[1]);
2535 #endif /* X86_64 || X32 */
2538 sys_getcpu(struct tcb *tcp)
2542 if (tcp->u_arg[0] == 0)
2544 else if (umove(tcp, tcp->u_arg[0], &u) < 0)
2545 tprintf("%#lx, ", tcp->u_arg[0]);
2547 tprintf("[%u], ", u);
2548 if (tcp->u_arg[1] == 0)
2550 else if (umove(tcp, tcp->u_arg[1], &u) < 0)
2551 tprintf("%#lx, ", tcp->u_arg[1]);
2553 tprintf("[%u], ", u);
2554 tprintf("%#lx", tcp->u_arg[2]);
2560 sys_process_vm_readv(struct tcb *tcp)
2562 if (entering(tcp)) {
2564 tprintf("%ld, ", tcp->u_arg[0]);
2566 /* arg 2: local iov */
2567 if (syserror(tcp)) {
2568 tprintf("%#lx", tcp->u_arg[1]);
2570 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
2572 /* arg 3: local iovcnt */
2573 tprintf(", %lu, ", tcp->u_arg[2]);
2574 /* arg 4: remote iov */
2575 if (syserror(tcp)) {
2576 tprintf("%#lx", tcp->u_arg[3]);
2578 tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
2580 /* arg 5: remote iovcnt */
2582 tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);
2588 sys_process_vm_writev(struct tcb *tcp)
2590 if (entering(tcp)) {
2592 tprintf("%ld, ", tcp->u_arg[0]);
2593 /* arg 2: local iov */
2595 tprintf("%#lx", tcp->u_arg[1]);
2597 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], 1);
2598 /* arg 3: local iovcnt */
2599 tprintf(", %lu, ", tcp->u_arg[2]);
2600 /* arg 4: remote iov */
2602 tprintf("%#lx", tcp->u_arg[3]);
2604 tprint_iov(tcp, tcp->u_arg[4], tcp->u_arg[3], 0);
2605 /* arg 5: remote iovcnt */
2607 tprintf(", %lu, %lu", tcp->u_arg[4], tcp->u_arg[5]);