|
From: <sv...@va...> - 2005-06-21 22:27:22
|
Author: njn
Date: 2005-06-21 23:27:19 +0100 (Tue, 21 Jun 2005)
New Revision: 3991
Log:
Move VG_(resume_scheduler) to m_signals, and make it local. Reduces
m_signals' dependence on m_scheduler.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_signals.c
trunk/coregrind/pub_core_scheduler.h
Modified: trunk/coregrind/m_scheduler/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/m_scheduler/scheduler.c 2005-06-21 22:23:59 UTC (rev =
3990)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-21 22:27:19 UTC (rev =
3991)
@@ -299,20 +299,6 @@
}
=20
=20
-void VG_(resume_scheduler)(ThreadId tid)
-{
- ThreadState *tst =3D VG_(get_ThreadState)(tid);
-
- vg_assert(tst->os_state.lwpid =3D=3D VG_(gettid)());
-
- if (tst->sched_jmpbuf_valid) {
- /* Can't continue; must longjmp back to the scheduler and thus
- enter the sighandler immediately. */
- =20
- longjmp(tst->sched_jmpbuf, True);
- }
-}
-
/* Set the standard set of blocked signals, used wheneever we're not
running a client syscall. */
static void block_signals(ThreadId tid)
Modified: trunk/coregrind/m_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/m_signals.c 2005-06-21 22:23:59 UTC (rev 3990)
+++ trunk/coregrind/m_signals.c 2005-06-21 22:27:19 UTC (rev 3991)
@@ -1500,6 +1500,19 @@
/* Thread state is ready to go - just add Runnable */
}
=20
+static void resume_scheduler(ThreadId tid)
+{
+ ThreadState *tst =3D VG_(get_ThreadState)(tid);
+
+ vg_assert(tst->os_state.lwpid =3D=3D VG_(gettid)());
+
+ if (tst->sched_jmpbuf_valid) {
+ /* Can't continue; must longjmp back to the scheduler and thus
+ enter the sighandler immediately. */
+ longjmp(tst->sched_jmpbuf, True);
+ }
+}
+
static void synth_fault_common(ThreadId tid, Addr addr, Int si_code)
{
vki_siginfo_t info;
@@ -1547,7 +1560,7 @@
info.si_code =3D 1; /* jrs: no idea what this should be */
info._sifields._sigfault._addr =3D (void*)addr;
=20
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
deliver_signal(tid, &info);
}
=20
@@ -1671,7 +1684,7 @@
=20
/* longjmp back to the thread's main loop to start executing the
handler. */
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
=20
VG_(core_panic)("async_signalhandler: got unexpected signal while out=
side of scheduler");
}
@@ -1805,7 +1818,7 @@
/* It's a fatal signal, so we force the default handler. */
VG_(set_default_handler)(sigNo);
deliver_signal(tid, info);
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
VG_(exit)(99); /* If we can't resume, then just exit */
}
=20
@@ -1911,7 +1924,7 @@
/* Can't continue; must longjmp back to the scheduler and thus
enter the sighandler immediately. */
deliver_signal(tid, info);
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
}
=20
/* Check to see if someone is interested in faults. */
@@ -1970,7 +1983,7 @@
VG_(set_running)(tid);
VG_(post_syscall)(tid);
=20
- VG_(resume_scheduler)(tid);
+ resume_scheduler(tid);
=20
VG_(core_panic)("sigvgkill_handler couldn't return to the scheduler\n=
");
}
Modified: trunk/coregrind/pub_core_scheduler.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/pub_core_scheduler.h 2005-06-21 22:23:59 UTC (rev 399=
0)
+++ trunk/coregrind/pub_core_scheduler.h 2005-06-21 22:27:19 UTC (rev 399=
1)
@@ -80,9 +80,6 @@
/* Stats ... */
extern void VG_(print_scheduler_stats) ( void );
=20
-// Longjmp back to the scheduler and thus enter the sighandler immediate=
ly.
-extern void VG_(resume_scheduler) ( ThreadId tid );
-
/* If true, a fault is Valgrind-internal (ie, a bug) */
extern Bool VG_(my_fault);
=20
|