diff options
author | Elijah Taylor <elijahtaylor@google.com> | 2013-02-01 02:00:58 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2013-04-07 11:47:16 +0400 |
commit | ab39b74267797f99f6abeb6a52bf0f3e187d9453 (patch) | |
tree | 00d52ff2d94fdd9b5ecc66eb615f9d8e15a595c2 /libgc/pthread_stop_world.c | |
parent | 1e726ce7a38a92860acab28f4427813d2ba14c13 (diff) |
NaCl ARM work, first pass
Diffstat (limited to 'libgc/pthread_stop_world.c')
-rw-r--r-- | libgc/pthread_stop_world.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libgc/pthread_stop_world.c b/libgc/pthread_stop_world.c index 8b25376b54a..fe2ba1a3810 100644 --- a/libgc/pthread_stop_world.c +++ b/libgc/pthread_stop_world.c @@ -537,6 +537,22 @@ static void pthread_stop_world() __asm__ __volatile__ ("add $16, %esp");\ } while (0) +#elif __arm__ + +#define NACL_STORE_REGS() \ + do { \ + __asm__ __volatile__ ("push {r4-r12,lr}");\ + __asm__ __volatile__ ("mov r0, %0" : : "r" (&nacl_gc_thread_self->stop_info.stack_ptr)); \ + __asm__ __volatile__ ("bic r0, r0, #0xc0000000");\ + __asm__ __volatile__ ("str sp, [r0]");\ + memcpy(nacl_gc_thread_self->stop_info.reg_storage, nacl_gc_thread_self->stop_info.stack_ptr, NACL_GC_REG_STORAGE_SIZE * sizeof(ptr_t));\ + __asm__ __volatile__ ("add sp, sp, #40");\ + __asm__ __volatile__ ("bic sp, sp, #0xc0000000");\ + } while (0) +#else + +#error "Please port NACL_STORE_REGS" + #endif void nacl_pre_syscall_hook() |