]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Move VG_(block_signals)() to vg_scheduler.c, the only file that uses
authorNicholas Nethercote <njn@valgrind.org>
Wed, 11 May 2005 18:48:33 +0000 (18:48 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 11 May 2005 18:48:33 +0000 (18:48 +0000)
it, and make it private.

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

coregrind/core.h
coregrind/vg_scheduler.c
coregrind/vg_signals.c

index 643bdc515c17ee66d50d80c11f8a863f50e26677..5b6ad0d462076695260d50864b58d507d949e520 100644 (file)
@@ -593,10 +593,6 @@ extern Bool VG_(my_fault);
    Exports of vg_signals.c
    ------------------------------------------------------------------ */
 
-/* Set the standard set of blocked signals, used wheneever we're not
-   running a client syscall. */
-extern void VG_(block_signals)(ThreadId tid);
-
 /* Highest signal the kernel will let us use */
 extern Int VG_(max_signal);
 
index d0ee0d80d6d82fa07a3b4e630cc65caeb185514c..9f18381aa56eaf3f907b899e89cd60d8c693aa17 100644 (file)
@@ -424,6 +424,32 @@ void VG_(resume_scheduler)(ThreadId tid)
    }
 }
 
+/* Set the standard set of blocked signals, used wheneever we're not
+   running a client syscall. */
+static void block_signals(ThreadId tid)
+{
+   vki_sigset_t mask;
+
+   VG_(sigfillset)(&mask);
+
+   /* Don't block these because they're synchronous */
+   VG_(sigdelset)(&mask, VKI_SIGSEGV);
+   VG_(sigdelset)(&mask, VKI_SIGBUS);
+   VG_(sigdelset)(&mask, VKI_SIGFPE);
+   VG_(sigdelset)(&mask, VKI_SIGILL);
+   VG_(sigdelset)(&mask, VKI_SIGTRAP);
+
+   /* Can't block these anyway */
+   VG_(sigdelset)(&mask, VKI_SIGSTOP);
+   VG_(sigdelset)(&mask, VKI_SIGKILL);
+
+   /* Master doesn't block this */
+   if (tid == VG_(master_tid))
+      VG_(sigdelset)(&mask, VKI_SIGVGCHLD);
+
+   VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
+}
+
 #define SCHEDSETJMP(tid, jumped, stmt)                                 \
    do {                                                                        \
       ThreadState * volatile _qq_tst = VG_(get_ThreadState)(tid);      \
@@ -511,7 +537,7 @@ UInt run_thread_for_a_while ( ThreadId tid )
          signal handler to longjmp. */
       vg_assert(trc == 0);
       trc = VG_TRC_FAULT_SIGNAL;
-      VG_(block_signals)(tid);
+      block_signals(tid);
    } 
 
    done_this_time = (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) - 0;
@@ -684,7 +710,7 @@ static void handle_syscall(ThreadId tid)
    vg_assert(VG_(is_running_thread)(tid));
    
    if (jumped) {
-      VG_(block_signals)(tid);
+      block_signals(tid);
       VG_(poll_signals)(tid);
    }
 }
@@ -706,7 +732,7 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid )
    VGP_PUSHCC(VgpSched);
 
    /* set the proper running signal mask */
-   VG_(block_signals)(tid);
+   block_signals(tid);
    
    vg_assert(VG_(is_running_thread)(tid));
 
index 79d2d97454c8eca8158a7bbb7a84010a58272751..fdcb15d8e41f410dae2a3bacc38bca043b89c55e 100644 (file)
@@ -2050,32 +2050,6 @@ void VG_(poll_signals)(ThreadId tid)
    VG_(restore_all_host_signals)(&saved_mask);
 }
 
-/* Set the standard set of blocked signals, used wheneever we're not
-   running a client syscall. */
-void VG_(block_signals)(ThreadId tid)
-{
-   vki_sigset_t mask;
-
-   VG_(sigfillset)(&mask);
-
-   /* Don't block these because they're synchronous */
-   VG_(sigdelset)(&mask, VKI_SIGSEGV);
-   VG_(sigdelset)(&mask, VKI_SIGBUS);
-   VG_(sigdelset)(&mask, VKI_SIGFPE);
-   VG_(sigdelset)(&mask, VKI_SIGILL);
-   VG_(sigdelset)(&mask, VKI_SIGTRAP);
-
-   /* Can't block these anyway */
-   VG_(sigdelset)(&mask, VKI_SIGSTOP);
-   VG_(sigdelset)(&mask, VKI_SIGKILL);
-
-   /* Master doesn't block this */
-   if (tid == VG_(master_tid))
-      VG_(sigdelset)(&mask, VKI_SIGVGCHLD);
-
-   VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
-}
-
 /* At startup, copy the process' real signal state to the SCSS.
    Whilst doing this, block all real signals.  Then calculate SKSS and
    set the kernel to that.  Also initialise DCSS.