* src/vm/signale.c (signale_init) [ENABLE_GC_CACAO]: Handler for SIGUSR1.
* src/vm/signallocal.h: Added prototype for SIGUSR1 handler.
* src/vm/jit/i386/linux/md-os.c (md_signal_handler_sigusr1): Added.
--HG--
branch : exact-gc
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
dnl 02110-1301, USA.
dnl
-dnl $Id: configure.ac 7434 2007-03-02 19:44:53Z edwin $
+dnl $Id: configure.ac 7441 2007-03-02 23:13:10Z michi $
dnl Process this file with autoconf to produce a configure script.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: headers.c 7246 2007-01-29 18:49:05Z twisti $
+ $Id: headers.c 7297 2007-02-07 14:59:56Z twisti $
*/
/* Global Variables ***********************************************************/
+extern bool gc_pending;
extern bool gc_notify_finalizer;
+/* Prototypes *****************************************************************/
+
+#if defined(ENABLE_THREADS)
+void gc_suspend(threadobject *thread, ucontext_t *context);
+#endif
+
+
/* Statistics *****************************************************************/
#if defined(ENABLE_STATISTICS)
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Field.c 7441 2007-03-02 23:13:10Z michi $
+ $Id: java_lang_reflect_Field.c 7429 2007-03-01 12:42:16Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: threads.c 7338 2007-02-13 00:17:22Z twisti $
+ $Id: threads.c 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: threads.h 7338 2007-02-13 00:17:22Z twisti $
+ $Id: threads.h 7356 2007-02-14 11:00:28Z twisti $
*/
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
##
-## $Id: Makefile.am 7289 2007-02-06 08:47:05Z twisti $
+## $Id: Makefile.am 7297 2007-02-07 14:59:56Z twisti $
## Process this file with automake to produce Makefile.in
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: builtin.h 7316 2007-02-10 19:06:54Z twisti $
+ $Id: builtin.h 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
- $Id: simplereg.c 7246 2007-01-29 18:49:05Z twisti $
+ $Id: simplereg.c 7297 2007-02-07 14:59:56Z twisti $
*/
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen-common.c 7403 2007-02-25 21:31:58Z pm $
+ $Id: codegen-common.c 7407 2007-02-26 19:12:03Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 7316 2007-02-10 19:06:54Z twisti $
+ $Id: emit.c 7356 2007-02-14 11:00:28Z twisti $
*/
Changes:
- $Id: md-os.c 5172 2006-07-25 15:33:58Z twisti $
+ $Id: md-os.c 7480 2007-03-08 12:46:19Z michi $
*/
#include "vm/types.h"
+#if defined(ENABLE_GC_CACAO)
+# include "mm/cacao-gc/gc.h"
+#endif
+
#include "vm/exceptions.h"
#include "vm/signallocal.h"
#include "vm/stringlocal.h"
}
+/* md_signal_handler_sigusr1 ***************************************************
+
+ Signale handler the exact GC to suspend threads.
+
+*******************************************************************************/
+
+#if defined(ENABLE_THREADS) && defined(ENABLE_GC_CACAO)
+void md_signal_handler_sigusr1(int sig, siginfo_t *siginfo, void *_p)
+{
+ threadobject *t;
+ executionstate_t *es;
+ ucontext_t *_uc;
+ mcontext_t *_mc;
+
+ t = THREADOBJECT;
+ t->es = NEW(executionstate_t); /* TODO: this must be done before!!! */
+ es = t->es;
+
+ _uc = (ucontext_t *) _p;
+ _mc = &_uc->uc_mcontext;
+
+ /* assume there is a GC pending */
+ assert(gc_pending);
+
+ /* fill in the execution state of this thread */
+ es->pc = (u1 *) _mc->gregs[REG_EIP];
+ es->sp = (u1 *) _mc->gregs[REG_ESP];
+ es->pv = (u1 *) NULL;
+
+ /* TODO: int registers are missing */
+
+ /* now suspend the current thread for GC */
+ gc_suspend(t, _uc);
+}
+#endif
+
+
/* md_signal_handler_sigusr2 ***************************************************
Signal handler for profiling sampling.
Changes:
- $Id: inline.c 7228 2007-01-19 01:13:48Z edwin $
+ $Id: inline.c 7297 2007-02-07 14:59:56Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: intrp.h 7357 2007-02-14 11:35:59Z twisti $
+ $Id: intrp.h 7368 2007-02-16 11:16:10Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7357 2007-02-14 11:35:59Z twisti $
+ $Id: patcher.c 7368 2007-02-16 11:16:10Z twisti $
*/
Christian Ullrich
Edwin Steiner
- $Id: codegen.c 7441 2007-03-02 23:13:10Z michi $
+ $Id: codegen.c 7429 2007-03-01 12:42:16Z twisti $
*/
Authors: Andreas Krall
Christian Thalinger
- $Id: codegen.h 7407 2007-02-26 19:12:03Z michi $
+ $Id: codegen.h 7413 2007-02-27 21:51:17Z twisti $
*/
Authors: Christian Thalinger
- $Id: emit.c 7300 2007-02-07 22:06:53Z pm $
+ $Id: emit.c 7355 2007-02-14 10:57:32Z twisti $
*/
Changes:
- $Id: md-abi.h 7283 2007-02-04 19:41:14Z pm $
+ $Id: md-abi.h 7297 2007-02-07 14:59:56Z twisti $
*/
Changes:
- $Id: md-asm.h 7407 2007-02-26 19:12:03Z michi $
+ $Id: md-asm.h 7413 2007-02-27 21:51:17Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: stack.c 7441 2007-03-02 23:13:10Z michi $
+ $Id: stack.c 7429 2007-03-01 12:42:16Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: typecheck.c 7441 2007-03-02 23:13:10Z michi $
+ $Id: typecheck.c 7429 2007-03-01 12:42:16Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: typeinfo.c 7246 2007-01-29 18:49:05Z twisti $
+ $Id: typeinfo.c 7297 2007-02-07 14:59:56Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: emit.c 7317 2007-02-11 00:02:54Z twisti $
+ $Id: emit.c 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md-abi.c 7381 2007-02-21 18:20:01Z twisti $
+ $Id: md-abi.c 7383 2007-02-21 20:26:52Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md.c 7284 2007-02-05 00:52:42Z twisti $
+ $Id: md.c 7297 2007-02-07 14:59:56Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: signal.c 7344 2007-02-13 12:23:54Z ajordan $
+ $Id: signal.c 7480 2007-03-08 12:46:19Z michi $
*/
sigaction(SIGHUP, &act, NULL);
#endif
+#if defined(ENABLE_THREADS) && defined(ENABLE_GC_CACAO)
+ /* SIGUSR1 handler for the exact GC to suspend threads */
+
+ act.sa_sigaction = md_signal_handler_sigusr1;
+ act.sa_flags = SA_SIGINFO;
+ sigaction(SIGUSR1, &act, NULL);
+#endif
+
#if defined(ENABLE_THREADS) && defined(ENABLE_PROFILING)
/* SIGUSR2 handler for profiling sampling */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: signallocal.h 7286 2007-02-05 01:07:45Z twisti $
+ $Id: signallocal.h 7480 2007-03-08 12:46:19Z michi $
*/
void md_signal_handler_sigfpe(int sig, siginfo_t *siginfo, void *_p);
#endif
+void md_signal_handler_sigusr1(int sig, siginfo_t *siginfo, void *_p);
+
void md_signal_handler_sigusr2(int sig, siginfo_t *siginfo, void *_p);
#endif /* _CACAO_SIGNAL_H */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: classcache.c 7435 2007-03-02 19:45:42Z edwin $
+ $Id: classcache.c 7441 2007-03-02 23:13:10Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: descriptor.c 7329 2007-02-11 21:24:14Z twisti $
+ $Id: descriptor.c 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: options.c 7338 2007-02-13 00:17:22Z twisti $
+ $Id: options.c 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: options.h 7338 2007-02-13 00:17:22Z twisti $
+ $Id: options.h 7356 2007-02-14 11:00:28Z twisti $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: statistics.c 7369 2007-02-16 17:56:40Z twisti $
+ $Id: statistics.c 7370 2007-02-16 18:00:03Z twisti $
*/
##
## Authors: Christian Thalinger
##
-## $Id: Makefile.am 7433 2007-03-02 19:42:13Z edwin $
+## $Id: Makefile.am 7441 2007-03-02 23:13:10Z michi $
## Process this file with automake to produce Makefile.in