-/*
- * exceptions-arm.c: exception support for ARM
+/**
+ * \file
+ * exception support for ARM
*
* Authors:
* Dietmar Maurer (dietmar@ximian.com)
#include <string.h>
#ifndef MONO_CROSS_COMPILE
-#ifdef HAVE_ASM_SIGCONTEXT_H
+#ifdef PLATFORM_ANDROID
#include <asm/sigcontext.h>
-#endif /* def HAVE_ASM_SIGCONTEXT_H */
+#endif /* def PLATFORM_ANDROID */
#endif
#ifdef HAVE_UCONTEXT_H
ARM_MOV_REG_REG (code, ARMREG_IP, ARMREG_SP);
ARM_PUSH (code, MONO_ARM_REGSAVE_MASK);
+ ARM_SUB_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 8);
+
/* restore all the regs from ctx (in r0), but not sp, the stack pointer */
ctx_reg = ARMREG_R0;
ARM_LDR_IMM (code, ARMREG_IP, ctx_reg, MONO_STRUCT_OFFSET (MonoContext, pc));
ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
+ ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 8);
+
/* epilog */
ARM_POP_NWB (code, 0xff0 | ((1 << ARMREG_SP) | (1 << ARMREG_PC)));
/**
* mono_arch_get_throw_corlib_exception:
- *
- * Returns a function pointer which can be used to raise
+ * \returns a function pointer which can be used to raise
* corlib exceptions. The returned function has the following
* signature: void (*func) (guint32 ex_token, guint32 offset);
- * Here, offset is the offset which needs to be substracted from the caller IP
+ * Here, \c offset is the offset which needs to be substracted from the caller IP
* to get the IP of the throw. Passing the offset has the advantage that it
* needs no relocations in the caller.
* On ARM, the ip is passed instead of an offset.
static void
handle_signal_exception (gpointer obj)
{
- MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+ MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
MonoContext ctx;
memcpy (&ctx, &jit_tls->ex_ctx, sizeof (MonoContext));
* signal is disabled, and we could run arbitrary code though the debugger. So
* resume into the normal stack and do most work there if possible.
*/
- MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id);
+ MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
guint64 sp = UCONTEXT_REG_SP (sigctx);
/* Pass the ctx parameter in TLS */
{
#ifdef MONO_CROSS_COMPILE
g_assert_not_reached ();
-#elif defined(__native_client__)
- g_assert_not_reached ();
#else
arm_ucontext *my_uc = sigctx;
return (void*) UCONTEXT_REG_PC (my_uc);