From 81b0032420fd6f1be3b24af69d393f9d10393133 Mon Sep 17 00:00:00 2001 From: Jon Purdy Date: Tue, 1 Nov 2016 17:30:43 -0700 Subject: [PATCH] [runtime] Fix Mach ARM build. --- mono/utils/mach-support-arm.c | 8 +++++++- mono/utils/mach-support-arm64.c | 16 +++++++++++----- mono/utils/mach-support-unknown.c | 16 +++++++++++----- mono/utils/mono-context.h | 2 +- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/mono/utils/mach-support-arm.c b/mono/utils/mach-support-arm.c index d535fbc18dd..b80db06385e 100644 --- a/mono/utils/mach-support-arm.c +++ b/mono/utils/mach-support-arm.c @@ -84,7 +84,7 @@ mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state) } void -mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context) +mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context) { int i; arm_thread_state_t *arch_state = (arm_thread_state_t *) state; @@ -103,6 +103,12 @@ mono_mach_arch_get_thread_state_size () return sizeof (arm_thread_state_t); } +int +mono_mach_arch_get_thread_fpstate_size () +{ + g_assert_not_reached (); +} + kern_return_t mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t *count) { diff --git a/mono/utils/mach-support-arm64.c b/mono/utils/mach-support-arm64.c index 6483238d456..2035f485b14 100644 --- a/mono/utils/mach-support-arm64.c +++ b/mono/utils/mach-support-arm64.c @@ -66,7 +66,7 @@ mono_mach_arch_get_mcontext_size () } void -mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context) +mono_mach_arch_thread_states_to_mcontext (thread_state_t state, thread_state_t fpstate, void *context) { arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state; struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context; @@ -75,7 +75,7 @@ mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context) } void -mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state) +mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate) { arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state; struct __darwin_mcontext64 *ctx = (struct __darwin_mcontext64 *) context; @@ -84,7 +84,7 @@ mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state) } void -mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context) +mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context) { int i; arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state; @@ -103,8 +103,14 @@ mono_mach_arch_get_thread_state_size () return sizeof (arm_unified_thread_state_t); } +int +mono_mach_arch_get_thread_fpstate_size () +{ + g_assert_not_reached (); +} + 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_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) { arm_unified_thread_state_t *arch_state = (arm_unified_thread_state_t *) state; kern_return_t ret; @@ -116,7 +122,7 @@ mono_mach_arch_get_thread_state (thread_port_t thread, thread_state_t state, mac } kern_return_t -mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count) +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) { return thread_set_state (thread, ARM_UNIFIED_THREAD_STATE, state, count); } diff --git a/mono/utils/mach-support-unknown.c b/mono/utils/mach-support-unknown.c index 20012550114..4d960bcf6c6 100644 --- a/mono/utils/mach-support-unknown.c +++ b/mono/utils/mach-support-unknown.c @@ -35,19 +35,19 @@ mono_mach_arch_get_mcontext_size () } void -mono_mach_arch_thread_state_to_mcontext (thread_state_t state, void *context) +mono_mach_arch_thread_states_to_mcontext (thread_state_t state, void *context) { g_assert_not_reached (); } void -mono_mach_arch_mcontext_to_thread_state (void *context, thread_state_t state) +mono_mach_arch_mcontext_to_thread_states (void *context, thread_state_t state, thread_state_t fpstate) { g_assert_not_reached (); } void -mono_mach_arch_thread_state_to_mono_context (thread_state_t state, MonoContext *context) +mono_mach_arch_thread_states_to_mono_context (thread_state_t state, thread_state_t fpstate, MonoContext *context) { g_assert_not_reached (); } @@ -58,14 +58,20 @@ mono_mach_arch_get_thread_state_size () g_assert_not_reached (); } +int +mono_mach_arch_get_thread_fpstate_size () +{ + g_assert_not_reached (); +} + 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_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) { g_assert_not_reached (); } kern_return_t -mono_mach_arch_set_thread_state (thread_port_t thread, thread_state_t state, mach_msg_type_number_t count) +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) { g_assert_not_reached (); } diff --git a/mono/utils/mono-context.h b/mono/utils/mono-context.h index 860589e74b0..9603c81f6cd 100644 --- a/mono/utils/mono-context.h +++ b/mono/utils/mono-context.h @@ -405,7 +405,7 @@ typedef struct { thread_port_t self = mach_thread_self (); \ kern_return_t ret = thread_get_state (self, state_flavor, (thread_state_t) &thread_state, &state_count); \ g_assert (ret == 0); \ - mono_mach_arch_thread_state_to_mono_context ((thread_state_t)&thread_state, &ctx); \ + mono_mach_arch_thread_states_to_mono_context ((thread_state_t)&thread_state, (thread_state_t)NULL, &ctx); \ mach_port_deallocate (current_task (), self); \ } while (0); -- 2.25.1