X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini-gc.c;h=fddca9c6c346e7be93d95e0a204e6a679a28b2e7;hb=5bde5effed9f0e7dd3279f62c56bb488ff11b4ce;hp=41ca382a0bce51e8d0fe140f32ea6ea2fe8ec1c6;hpb=bb3ccfb141860a5e05acbe9892984a3427c91958;p=mono.git diff --git a/mono/mini/mini-gc.c b/mono/mini/mini-gc.c index 41ca382a0bc..fddca9c6c34 100644 --- a/mono/mini/mini-gc.c +++ b/mono/mini/mini-gc.c @@ -12,18 +12,13 @@ #include "mini-gc.h" #include -//#if 0 -#if defined(MONO_ARCH_GC_MAPS_SUPPORTED) +#if 0 +//#if defined(MONO_ARCH_GC_MAPS_SUPPORTED) +#include #include #include -#if SIZEOF_VOID_P == 4 -typedef guint32 mword; -#else -typedef guint64 mword; -#endif - #define SIZEOF_SLOT ((int)sizeof (mgreg_t)) #define GC_BITS_PER_WORD (sizeof (mword) * 8) @@ -441,6 +436,15 @@ static int callee_saved_regs [] = { ARMREG_V1, ARMREG_V2, ARMREG_V3, ARMREG_V4, static int callee_saved_regs [] = { }; #elif defined(TARGET_S390X) static int callee_saved_regs [] = { s390_r6, s390_r7, s390_r8, s390_r9, s390_r10, s390_r11, s390_r12, s390_r13, s390_r14 }; +#elif defined(TARGET_POWERPC64) && _CALL_ELF == 2 +static int callee_saved_regs [] = { + ppc_r13, ppc_r14, ppc_r15, ppc_r16, + ppc_r17, ppc_r18, ppc_r19, ppc_r20, + ppc_r21, ppc_r22, ppc_r23, ppc_r24, + ppc_r25, ppc_r26, ppc_r27, ppc_r28, + ppc_r29, ppc_r30, ppc_r31 }; +#elif defined(TARGET_POWERPC) +static int callee_saved_regs [] = { ppc_r6, ppc_r7, ppc_r8, ppc_r9, ppc_r10, ppc_r11, ppc_r12, ppc_r13, ppc_r14 }; #endif static guint32 @@ -598,19 +602,21 @@ thread_suspend_func (gpointer user_data, void *sigctx, MonoContext *ctx) if (tls->tid != GetCurrentThreadId ()) { /* Happens on osx because threads are not suspended using signals */ +#ifndef TARGET_WIN32 gboolean res; +#endif g_assert (tls->info); #ifdef TARGET_WIN32 return; #else - res = mono_thread_state_init_from_handle (&tls->unwind_state, (MonoNativeThreadId)tls->tid, tls->info->native_handle); + res = mono_thread_state_init_from_handle (&tls->unwind_state, tls->info); #endif } else { tls->unwind_state.unwind_data [MONO_UNWIND_DATA_LMF] = mono_get_lmf (); if (sigctx) { #ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX - mono_arch_sigctx_to_monoctx (sigctx, &tls->unwind_state.ctx); + mono_sigctx_to_monoctx (sigctx, &tls->unwind_state.ctx); tls->unwind_state.valid = TRUE; #else tls->unwind_state.valid = FALSE; @@ -1106,7 +1112,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) * pass. */ static void -precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) +precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end, void *gc_data) { int findex, i; FrameInfo *fi; @@ -1144,7 +1150,7 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) MonoObject *obj = *ptr; if (obj) { DEBUG (fprintf (logfile, "\tref %s0x%x(fp)=%p: %p ->", (guint8*)ptr >= (guint8*)fi->fp ? "" : "-", ABS ((int)((gssize)ptr - (gssize)fi->fp)), ptr, obj)); - *ptr = mono_gc_scan_object (obj); + *ptr = mono_gc_scan_object (obj, gc_data); DEBUG (fprintf (logfile, " %p.\n", *ptr)); } else { DEBUG (fprintf (logfile, "\tref %s0x%x(fp)=%p: %p.\n", (guint8*)ptr >= (guint8*)fi->fp ? "" : "-", ABS ((int)((gssize)ptr - (gssize)fi->fp)), ptr, obj)); @@ -1185,7 +1191,7 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) if (obj) { DEBUG (fprintf (logfile, "\treg %s saved at %p: %p ->", mono_arch_regname (fi->regs [i]), ptr, obj)); - *ptr = mono_gc_scan_object (obj); + *ptr = mono_gc_scan_object (obj, gc_data); DEBUG (fprintf (logfile, " %p.\n", *ptr)); } else { DEBUG (fprintf (logfile, "\treg %s saved at %p: %p\n", mono_arch_regname (fi->regs [i]), ptr, obj)); @@ -1213,7 +1219,7 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) * structure filled up by thread_suspend_func. */ static void -thread_mark_func (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gboolean precise) +thread_mark_func (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gboolean precise, void *gc_data) { TlsData *tls = user_data; @@ -1224,7 +1230,7 @@ thread_mark_func (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gb if (!precise) conservative_pass (tls, stack_start, stack_end); else - precise_pass (tls, stack_start, stack_end); + precise_pass (tls, stack_start, stack_end, gc_data); } #ifndef DISABLE_JIT