]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle sigaction, sigsuspend, sigprocmask on arm-linux; comment-only
authorJulian Seward <jseward@acm.org>
Mon, 11 Jul 2011 18:23:09 +0000 (18:23 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 11 Jul 2011 18:23:09 +0000 (18:23 +0000)
changes for x86-linux and ppc32-linux.  Derived from patch in bug
266035 comment 10 (Jeff Brown, jeffbrown@google.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11871

coregrind/m_syswrap/syswrap-arm-linux.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c

index 076508908fea474ec26024af1842a61b8ce38d9a..a1e1b3bf814309ac2ba2287e49f11cd22e77a52a 100644 (file)
@@ -341,6 +341,7 @@ DECL_TEMPLATE(arm_linux, sys_fstat64);
 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 @@ PRE(sys_rt_sigreturn)
    *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 @@ static SyscallTableEntry syscall_main_table[] = {
 
    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 @@ static SyscallTableEntry syscall_main_table[] = {
 //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
index 00e4cc6d198d879c5e449d2ec66ed879ae8fdc81..57859d30164b673de7ad557fe10579dabf6d2ac2 100644 (file)
@@ -2739,7 +2739,7 @@ POST(sys_sigpending)
 // 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;
index edcd1512c0024ebe0c04d08a3cc7f3e16d7423b9..4ec98a3451532b8eb39a7cbf2da9bf2e436a63b3 100644 (file)
@@ -1391,6 +1391,8 @@ PRE(sys_rt_sigreturn)
 //..    }
 //.. }
 
+/* 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
index c4acdf51504a03b688b53572008d2aff4d51a8dc..9888cc6f3274b02f188ee3e62eb42c59c01f877e 100644 (file)
@@ -1707,6 +1707,8 @@ POST(sys_socketcall)
 #  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