Skip to content

Commit

Permalink
[master][watchOS] Add simwatch64 support
Browse files Browse the repository at this point in the history
Xcode 12.2 removed 32 bits support for watchOS simulators, this PR helps to fix xamarin/xamarin-macios#9949, we have tested the new binaries and they are working as expected

![unknown](https://user-images.githubusercontent.com/204671/98253709-64413200-1f49-11eb-9774-8c5aa416fc57.png)
  • Loading branch information
dalexsoto committed Nov 5, 2020
1 parent 04ecc1c commit 4fd91fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mono/mono/utils/mach-support-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ mono_mach_arch_get_thread_fpstate_size ()
kern_return_t
mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count, thread_state_t fpstate, mach_msg_type_number_t *fpcount)
{
#if defined(HOST_WATCHOS)
g_error ("thread_get_state() is not supported by this platform");
#else
x86_thread_state64_t *arch_state = (x86_thread_state64_t *)state;
x86_float_state64_t *arch_fpstate = (x86_float_state64_t *)fpstate;
kern_return_t ret;
Expand All @@ -116,17 +119,22 @@ mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, ma

ret = thread_get_state (thread, x86_FLOAT_STATE64, (thread_state_t)arch_fpstate, fpcount);
return ret;
#endif
}

kern_return_t
mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count, thread_state_t fpstate, mach_msg_type_number_t fpcount)
{
#if defined(HOST_WATCHOS)
g_error ("thread_set_state() is not supported by this platform");
#else
kern_return_t ret;
ret = thread_set_state (thread, x86_THREAD_STATE64, state, count);
if (ret != KERN_SUCCESS)
return ret;
ret = thread_set_state (thread, x86_FLOAT_STATE64, fpstate, fpcount);
return ret;
#endif
}

#endif

0 comments on commit 4fd91fa

Please sign in to comment.