diff options
author | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-29 00:46:26 +0400 |
---|---|---|
committer | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-29 00:46:26 +0400 |
commit | 20c8607143cf9366e28f6060046453d25e540bf4 (patch) | |
tree | 777bd0dc405c9d7f054e3559c463ce901c119a6f /libgc/darwin_stop_world.c | |
parent | 1a56620486ca6f747f4d1e61842a7e04149da2c8 (diff) |
2008-08-28 Geoff Norton <gnorton@novell.com>
* darwin_stop_world.c:
* include/private/gcconfig.h: Add support for Darwin/ARM
svn path=/trunk/mono/; revision=111873
Diffstat (limited to 'libgc/darwin_stop_world.c')
-rw-r--r-- | libgc/darwin_stop_world.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/libgc/darwin_stop_world.c b/libgc/darwin_stop_world.c index 20f3fc7614d..d3b94feb258 100644 --- a/libgc/darwin_stop_world.c +++ b/libgc/darwin_stop_world.c @@ -79,6 +79,9 @@ void GC_push_all_stacks() { #elif defined(I386) i386_thread_state_t state; mach_msg_type_number_t thread_state_count = i386_THREAD_STATE_COUNT; +#elif defined(ARM) + arm_thread_state_t state; + mach_msg_type_number_t thread_state_count = ARM_THREAD_STATE_COUNT; #else # error FIXME for non-x86 || ppc architectures mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT; @@ -193,6 +196,26 @@ void GC_push_all_stacks() { GC_push_one(state.r30); GC_push_one(state.r31); #endif +#elif defined(ARM) + lo = (void*)state.__sp; + + GC_push_one(state.__r[0]); + GC_push_one(state.__r[1]); + GC_push_one(state.__r[2]); + GC_push_one(state.__r[3]); + GC_push_one(state.__r[4]); + GC_push_one(state.__r[5]); + GC_push_one(state.__r[6]); + GC_push_one(state.__r[7]); + GC_push_one(state.__r[8]); + GC_push_one(state.__r[9]); + GC_push_one(state.__r[10]); + GC_push_one(state.__r[11]); + GC_push_one(state.__r[12]); + /* GC_push_one(state.__sp); */ + GC_push_one(state.__lr); + GC_push_one(state.__pc); + GC_push_one(state.__cpsr); #else # error FIXME for non-x86 || ppc architectures #endif @@ -318,7 +341,7 @@ void GC_push_all_stacks() { GC_push_one(info.r30); GC_push_one(info.r31); #endif -# else +# elif defined(I386) /* !POWERPC */ /* FIXME: Remove after testing: */ WARN("This is completely untested and likely will not work\n", 0); i386_thread_state_t info; @@ -366,7 +389,34 @@ void GC_push_all_stacks() { GC_push_one(info.fs); GC_push_one(info.gs); #endif -# endif /* !POWERPC */ +# elif defined(ARM) /* !I386 */ + arm_thread_state_t info; + mach_msg_type_number_t outCount = THREAD_STATE_MAX; + r = thread_get_state(thread, GC_MACH_THREAD_STATE_FLAVOR, + (natural_t *)&info, &outCount); + if(r != KERN_SUCCESS) continue; + + lo = (void*)info.__sp; + hi = (ptr_t)FindTopOfStack(info.__sp); + + GC_push_one(info.__r[0]); + GC_push_one(info.__r[1]); + GC_push_one(info.__r[2]); + GC_push_one(info.__r[3]); + GC_push_one(info.__r[4]); + GC_push_one(info.__r[5]); + GC_push_one(info.__r[6]); + GC_push_one(info.__r[7]); + GC_push_one(info.__r[8]); + GC_push_one(info.__r[9]); + GC_push_one(info.__r[10]); + GC_push_one(info.__r[11]); + GC_push_one(info.__r[12]); + /* GC_push_one(info.__sp); */ + GC_push_one(info.__lr); + GC_push_one(info.__pc); + GC_push_one(info.__cpsr); +# endif /* !ARM */ } # if DEBUG_THREADS GC_printf3("Darwin: Stack for thread 0x%lx = [%lx,%lx)\n", |