[threads] Remove mono_threads_suspend_needs_abort_syscall (#4450)
[mono.git] / mono / utils / mono-threads-mach.c
index b696064decdc986ea5305ef39a4aa4ee5a45242e..3dd01e8a21dc0e267c4e2f457edd325a47ca52d2 100644 (file)
@@ -54,13 +54,6 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 void
 mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
 {
-       g_assert_not_reached ();
-}
-
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return FALSE;
 }
 
 #else /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
@@ -117,8 +110,8 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
 
        if (info->async_target) {
                MonoContext tmp = info->thread_saved_state [ASYNC_SUSPEND_STATE_INDEX].ctx;
-               mach_msg_type_number_t num_state;
-               thread_state_t state;
+               mach_msg_type_number_t num_state, num_fpstate;
+               thread_state_t state, fpstate;
                ucontext_t uctx;
                mcontext_t mctx;
 
@@ -127,23 +120,24 @@ mono_threads_suspend_begin_async_resume (MonoThreadInfo *info)
                info->async_target = (void (*)(void *)) info->user_data;
 
                state = (thread_state_t) alloca (mono_mach_arch_get_thread_state_size ());
+               fpstate = (thread_state_t) alloca (mono_mach_arch_get_thread_fpstate_size ());
                mctx = (mcontext_t) alloca (mono_mach_arch_get_mcontext_size ());
 
                do {
-                       ret = mono_mach_arch_get_thread_state (info->native_handle, state, &num_state);
+                       ret = mono_mach_arch_get_thread_states (info->native_handle, state, &num_state, fpstate, &num_fpstate);
                } while (ret == KERN_ABORTED);
 
                if (ret != KERN_SUCCESS)
                        return FALSE;
 
-               mono_mach_arch_thread_state_to_mcontext (state, mctx);
+               mono_mach_arch_thread_states_to_mcontext (state, fpstate, mctx);
                uctx.uc_mcontext = mctx;
                mono_monoctx_to_sigctx (&tmp, &uctx);
 
-               mono_mach_arch_mcontext_to_thread_state (mctx, state);
+               mono_mach_arch_mcontext_to_thread_states (mctx, state, fpstate);
 
                do {
-                       ret = mono_mach_arch_set_thread_state (info->native_handle, state, num_state);
+                       ret = mono_mach_arch_set_thread_states (info->native_handle, state, num_state, fpstate, num_fpstate);
                } while (ret == KERN_ABORTED);
 
                if (ret != KERN_SUCCESS)
@@ -192,12 +186,6 @@ mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
        g_assert (ret == KERN_SUCCESS);
 }
 
-gboolean
-mono_threads_suspend_needs_abort_syscall (void)
-{
-       return TRUE;
-}
-
 #endif /* defined(HOST_WATCHOS) || defined(HOST_TVOS) */
 
 void