X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmach-support-amd64.c;fp=mono%2Futils%2Fmach-support-amd64.c;h=0f7d2084f07289367ec6e4cdf1fe0a71acdb7ff1;hb=5ae226cc2626b04e9209bf93f26f283cb9f281ff;hp=2cc779b54f6d56c0cdd7a2fbed5b7a86bf0b0f94;hpb=2fa24c5ff41f8c6c017d7fcff8d71caf29618c50;p=mono.git diff --git a/mono/utils/mach-support-amd64.c b/mono/utils/mach-support-amd64.c index 2cc779b54f6..0f7d2084f07 100644 --- a/mono/utils/mach-support-amd64.c +++ b/mono/utils/mach-support-amd64.c @@ -32,30 +32,37 @@ mono_mach_arch_get_sp (thread_state_t state) return (void *) arch_state->__rsp; } -void * -mono_mach_arch_thread_state_to_context (thread_state_t state) +int +mono_mach_arch_get_mcontext_size () +{ + return sizeof (struct __darwin_mcontext64); +} + +void +mono_mach_arch_thread_state_to_mcontext (thread_state_t state, mcontext_t context) { x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state; - struct __darwin_mcontext64 *ctx; + struct __darwin_mcontext64 *ctx = (struct __darwin_mcontex64 *) context; - ctx = (struct __darwin_mcontext64 *) g_new0 (struct __darwin_mcontext64, 1); ctx->__ss = *arch_state; +} - return ctx; +int +mono_mach_arch_get_thread_state_size () +{ + return sizeof (x86_thread_state64_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_state64_t *arch_state = (x86_thread_state64_t *) g_new0 (x86_thread_state64_t, 1); + x86_thread_state64_t *arch_state = (x86_thread_state64_t *) state; kern_return_t ret; *count = x86_THREAD_STATE64_COUNT; ret = thread_get_state (thread, x86_THREAD_STATE64, (thread_state_t) arch_state, count); - *state = (thread_state_t) arch_state; - return ret; }