|
From: <sv...@va...> - 2011-07-11 18:28:00
|
Author: sewardj
Date: 2011-07-11 19:23:09 +0100 (Mon, 11 Jul 2011)
New Revision: 11871
Log:
Handle sigaction, sigsuspend, sigprocmask on arm-linux; comment-only
changes for x86-linux and ppc32-linux. Derived from patch in bug
266035 comment 10 (Jeff Brown, jef...@go...).
Modified:
trunk/coregrind/m_syswrap/syswrap-arm-linux.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-arm-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-arm-linux.c 2011-07-11 17:48:24 UTC (rev 11870)
+++ trunk/coregrind/m_syswrap/syswrap-arm-linux.c 2011-07-11 18:23:09 UTC (rev 11871)
@@ -341,6 +341,7 @@
DECL_TEMPLATE(arm_linux, sys_clone);
DECL_TEMPLATE(arm_linux, sys_sigreturn);
DECL_TEMPLATE(arm_linux, sys_rt_sigreturn);
+DECL_TEMPLATE(arm_linux, sys_sigsuspend);
DECL_TEMPLATE(arm_linux, sys_set_tls);
DECL_TEMPLATE(arm_linux, sys_cacheflush);
DECL_TEMPLATE(arm_linux, sys_ptrace);
@@ -1188,6 +1189,26 @@
*flags |= SfPollAfter;
}
+/* NB: clone of x86-linux version, and ppc32-linux has an almost
+ identical one. */
+PRE(sys_sigsuspend)
+{
+ /* The C library interface to sigsuspend just takes a pointer to
+ a signal mask but this system call has three arguments - the first
+ two don't appear to be used by the kernel and are always passed as
+ zero by glibc and the third is the first word of the signal mask
+ so only 32 signals are supported.
+
+ In fact glibc normally uses rt_sigsuspend if it is available as
+ that takes a pointer to the signal mask so supports more signals.
+ */
+ *flags |= SfMayBlock;
+ PRINT("sys_sigsuspend ( %ld, %ld, %ld )", ARG1,ARG2,ARG3 );
+ PRE_REG_READ3(int, "sigsuspend",
+ int, history0, int, history1,
+ vki_old_sigset_t, mask);
+}
+
/* Very much ARM specific */
PRE(sys_set_tls)
@@ -1431,13 +1452,13 @@
GENX_(__NR_getpgrp, sys_getpgrp), // 65
GENX_(__NR_setsid, sys_setsid), // 66
-// _____(__NR_sigaction, sys_sigaction), // 67
+ LINXY(__NR_sigaction, sys_sigaction), // 67
//zz // (__NR_sgetmask, sys_sgetmask), // 68 */* (ANSI C)
//zz // (__NR_ssetmask, sys_ssetmask), // 69 */* (ANSI C)
//zz
LINX_(__NR_setreuid, sys_setreuid16), // 70
LINX_(__NR_setregid, sys_setregid16), // 71
-// _____(__NR_sigsuspend, sys_sigsuspend), // 72
+ PLAX_(__NR_sigsuspend, sys_sigsuspend), // 72
LINXY(__NR_sigpending, sys_sigpending), // 73
//zz // (__NR_sethostname, sys_sethostname), // 74 */*
//zz
@@ -1502,7 +1523,7 @@
//zz LINXY(__NR_adjtimex, sys_adjtimex), // 124
//zz
GENXY(__NR_mprotect, sys_mprotect), // 125
- // LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
+ LINXY(__NR_sigprocmask, sys_sigprocmask), // 126
//zz // Nb: create_module() was removed 2.4-->2.6
// GENX_(__NR_create_module, sys_ni_syscall), // 127
LINX_(__NR_init_module, sys_init_module), // 128
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2011-07-11 17:48:24 UTC (rev 11870)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2011-07-11 18:23:09 UTC (rev 11871)
@@ -2739,7 +2739,7 @@
// This wrapper is only suitable for 32-bit architectures.
// (XXX: so how is it that PRE(sys_sigpending) above doesn't need
// conditional compilation like this?)
-#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
+#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) || defined(VGP_arm_linux)
PRE(sys_sigprocmask)
{
vki_old_sigset_t* set;
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-07-11 17:48:24 UTC (rev 11870)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-07-11 18:23:09 UTC (rev 11871)
@@ -1391,6 +1391,8 @@
//.. }
//.. }
+/* NB: This is an almost identical clone of versions for x86-linux and
+ arm-linux, which are themselves literally identical. */
PRE(sys_sigsuspend)
{
/* The C library interface to sigsuspend just takes a pointer to
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2011-07-11 17:48:24 UTC (rev 11870)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2011-07-11 18:23:09 UTC (rev 11871)
@@ -1707,6 +1707,8 @@
# undef ARG2_5
}
+/* NB: arm-linux has a clone of this one, and ppc32-linux has an almost
+ identical version. */
PRE(sys_sigsuspend)
{
/* The C library interface to sigsuspend just takes a pointer to
|