From: Roland McGrath Date: Tue, 20 May 2008 01:35:55 +0000 (+0000) Subject: 2008-01-25 Bruna Moreira X-Git-Tag: v4.5.18~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5670331bf1ffb36fa815ddb817064e7f08dd2d97;p=strace 2008-01-25 Bruna Moreira * defs.h [ARM]: Define SUPPORTED_PERSONALITIES to 2. * syscall.c (get_scno) [ARM]: Add support for architecture specific syscalls. * linux/arm/syscallent.h: Update network syscalls list. * linux/arm/syscallent1.h: New file. Add new architecture specific syscalls. * linux/arm/errnoent1.h: New file. * linux/arm/ioctlent1.h: New file. * linux/arm/signalent1.h: New file. Fixes Debian#441000. --- diff --git a/defs.h b/defs.h index e8191748..0ac733f3 100644 --- a/defs.h +++ b/defs.h @@ -228,6 +228,13 @@ extern int ptrace(); #define PERSONALITY1_WORDSIZE 4 #endif +#ifdef ARM +#undef SUPPORTED_PERSONALITIES +#define SUPPORTED_PERSONALITIES 2 +#define PERSONALITY0_WORDSIZE 4 +#define PERSONALITY1_WORDSIZE 4 +#endif + #ifdef SVR4 #ifdef HAVE_MP_PROCFS extern int mp_ioctl (int f, int c, void *a, int s); diff --git a/linux/arm/errnoent1.h b/linux/arm/errnoent1.h new file mode 100644 index 00000000..a8948276 --- /dev/null +++ b/linux/arm/errnoent1.h @@ -0,0 +1,2 @@ +/* Our second set comes from the i386 files. */ +#include "../errnoent.h" diff --git a/linux/arm/ioctlent1.h b/linux/arm/ioctlent1.h new file mode 100644 index 00000000..a44b0ae5 --- /dev/null +++ b/linux/arm/ioctlent1.h @@ -0,0 +1,2 @@ +/* Our second set comes from the i386 files. */ +#include "../ioctlent.h" diff --git a/linux/arm/signalent1.h b/linux/arm/signalent1.h new file mode 100644 index 00000000..5c18d98b --- /dev/null +++ b/linux/arm/signalent1.h @@ -0,0 +1,2 @@ +/* Our second set comes from the i386 files. */ +#include "../signalent.h" diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index 8718cf70..b70dac12 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -311,23 +311,23 @@ { 2, 0, sys_mq_notify, "mq_notify" }, /* 278 */ { 3, 0, sys_mq_getsetattr, "mq_getsetattr" }, /* 279 */ { 5, TP, sys_waitid, "waitid" }, /* 280 */ - { 5, 0, printargs, "SYS_281" }, /* 281 */ - { 5, 0, printargs, "SYS_282" }, /* 282 */ - { 5, 0, printargs, "SYS_283" }, /* 283 */ - { 5, 0, printargs, "SYS_284" }, /* 284 */ - { 5, 0, printargs, "SYS_285" }, /* 285 */ - { 5, 0, printargs, "SYS_286" }, /* 286 */ - { 5, 0, printargs, "SYS_287" }, /* 287 */ - { 5, 0, printargs, "SYS_288" }, /* 288 */ - { 5, 0, printargs, "SYS_289" }, /* 289 */ - { 5, 0, printargs, "SYS_290" }, /* 290 */ - { 5, 0, printargs, "SYS_291" }, /* 291 */ - { 5, 0, printargs, "SYS_292" }, /* 292 */ - { 5, 0, printargs, "SYS_293" }, /* 293 */ - { 5, 0, printargs, "SYS_294" }, /* 294 */ - { 5, 0, printargs, "SYS_295" }, /* 295 */ - { 5, 0, printargs, "SYS_296" }, /* 296 */ - { 5, 0, printargs, "SYS_297" }, /* 297 */ + { 3, TN, sys_socket, "socket" }, /* 281 */ + { 3, TN, sys_bind, "bind" }, /* 282 */ + { 3, TN, sys_connect, "connect" }, /* 283 */ + { 2, TN, sys_listen, "listen" }, /* 284 */ + { 3, TN, sys_accept, "accept" }, /* 285 */ + { 3, TN, sys_getsockname, "getsockname" }, /* 286 */ + { 3, TN, sys_getpeername, "getpeername" }, /* 287 */ + { 4, TN, sys_socketpair, "socketpair" }, /* 288 */ + { 4, TN, sys_send, "send" }, /* 289 */ + { 6, TN, sys_sendto, "sendto" }, /* 290 */ + { 4, TN, sys_recv, "recv" }, /* 291 */ + { 6, TN, sys_recvfrom, "recvfrom" }, /* 292 */ + { 2, TN, sys_shutdown, "shutdown" }, /* 293 */ + { 5, TN, sys_setsockopt, "setsockopt" }, /* 294 */ + { 5, TN, sys_getsockopt, "getsockopt" }, /* 295 */ + { 3, TN, sys_sendmsg, "sendmsg" }, /* 296 */ + { 3, TN, sys_recvmsg, "recvmsg" }, /* 297 */ { 5, 0, printargs, "SYS_298" }, /* 298 */ { 5, 0, printargs, "SYS_299" }, /* 299 */ { 5, 0, printargs, "SYS_300" }, /* 300 */ diff --git a/linux/arm/syscallent1.h b/linux/arm/syscallent1.h new file mode 100644 index 00000000..0978e9fb --- /dev/null +++ b/linux/arm/syscallent1.h @@ -0,0 +1,7 @@ +/* ARM specific syscalls */ + { 5, 0, printargs, "SYS_0" }, /* 0 */ + { 5, 0, printargs, "breakpoint" }, /* 1 */ + { 5, 0, printargs, "cacheflush" }, /* 2 */ + { 5, 0, printargs, "usr26" }, /* 3 */ + { 5, 0, printargs, "usr32" }, /* 4 */ + { 5, 0, printargs, "set_tls" }, /* 5 */ diff --git a/syscall.c b/syscall.c index e699c618..a2d26d39 100644 --- a/syscall.c +++ b/syscall.c @@ -1055,6 +1055,14 @@ struct tcb *tcp; scno &= 0x000fffff; } } + if (scno & 0x0f0000) { + /* + * Handle ARM specific syscall + */ + set_personality(1); + scno &= 0x0000ffff; + } else + set_personality(0); if (tcp->flags & TCB_INSYSCALL) { fprintf(stderr, "pid %d stray syscall entry\n", tcp->pid);