|
From: <sv...@va...> - 2005-05-11 18:48:35
|
Author: njn
Date: 2005-05-11 19:48:33 +0100 (Wed, 11 May 2005)
New Revision: 3661
Modified:
trunk/coregrind/core.h
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_signals.c
Log:
Move VG_(block_signals)() to vg_scheduler.c, the only file that uses
it, and make it private.
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-05-11 18:44:13 UTC (rev 3660)
+++ trunk/coregrind/core.h 2005-05-11 18:48:33 UTC (rev 3661)
@@ -593,10 +593,6 @@
Exports of vg_signals.c
------------------------------------------------------------------ */
=20
-/* 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);
=20
Modified: trunk/coregrind/vg_scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_scheduler.c 2005-05-11 18:44:13 UTC (rev 3660)
+++ trunk/coregrind/vg_scheduler.c 2005-05-11 18:48:33 UTC (rev 3661)
@@ -424,6 +424,32 @@
}
}
=20
+/* 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 =3D=3D 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 =3D VG_(get_ThreadState)(tid); \
@@ -511,7 +537,7 @@
signal handler to longjmp. */
vg_assert(trc =3D=3D 0);
trc =3D VG_TRC_FAULT_SIGNAL;
- VG_(block_signals)(tid);
+ block_signals(tid);
}=20
=20
done_this_time =3D (Int)dispatch_ctr_SAVED - (Int)VG_(dispatch_ctr) -=
0;
@@ -684,7 +710,7 @@
vg_assert(VG_(is_running_thread)(tid));
=20
if (jumped) {
- VG_(block_signals)(tid);
+ block_signals(tid);
VG_(poll_signals)(tid);
}
}
@@ -706,7 +732,7 @@
VGP_PUSHCC(VgpSched);
=20
/* set the proper running signal mask */
- VG_(block_signals)(tid);
+ block_signals(tid);
=20
vg_assert(VG_(is_running_thread)(tid));
=20
Modified: trunk/coregrind/vg_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_signals.c 2005-05-11 18:44:13 UTC (rev 3660)
+++ trunk/coregrind/vg_signals.c 2005-05-11 18:48:33 UTC (rev 3661)
@@ -2050,32 +2050,6 @@
VG_(restore_all_host_signals)(&saved_mask);
}
=20
-/* 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 =3D=3D 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.=20
|