[xbuild] Clean up test logs.
[mono.git] / mono / utils / mach-support-x86.c
index 9834d04d77216f58a8e47c34373d09692ceca0e8..a5b7def4337d00fb101e85de2a605c320f475b3b 100644 (file)
@@ -4,7 +4,7 @@
  * Authors:
  *   Geoff Norton (gnorton@novell.com)
  *
- * (C) 2010 Ximian, Inc.
+ * (C) 2010 Novell, Inc.
  */
 
 #include <config.h>
@@ -32,30 +32,37 @@ mono_mach_arch_get_sp (thread_state_t state)
        return (void *) arch_state->__esp;
 }
 
-void *
-mono_mach_arch_thread_state_to_context (thread_state_t state)
+int
+mono_mach_arch_get_mcontext_size ()
+{
+       return sizeof (struct __darwin_mcontext32);
+}
+
+void
+mono_mach_arch_thread_state_to_mcontext (thread_state_t state, mcontext_t context)
 {
        x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
-       struct __darwin_mcontext32 *ctx;
+       struct __darwin_mcontext32 *ctx = (struct __darwin_mcontext32 *) context;
 
-       ctx = (struct __darwin_mcontext32 *) g_new0 (struct __darwin_mcontext32, 1);
        ctx->__ss = *arch_state;
+}
 
-       return ctx;
+int
+mono_mach_arch_get_thread_state_size ()
+{
+       return sizeof (x86_thread_state32_t);
 }
 
 kern_return_t
-mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t *state, mach_msg_type_number_t *count)
+mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count)
 {
-       x86_thread_state32_t *arch_state = (x86_thread_state32_t *) g_new0 (x86_thread_state32_t, 1);
+       x86_thread_state32_t *arch_state = (x86_thread_state32_t *) state;
        kern_return_t ret;
 
        *count = x86_THREAD_STATE32_COUNT;
 
        ret = thread_get_state (thread, x86_THREAD_STATE32, (thread_state_t) arch_state, count);
 
-       *state = (thread_state_t) arch_state;
-
        return ret;
 }