#endif /* PLATFORM_WIN32 */
-#if defined( __linux__) || defined(__sun) || defined(__APPLE__)
+#if defined( __linux__) || defined(__sun) || defined(__APPLE__) || defined(__NetBSD__)
#define MONO_ARCH_USE_SIGACTION
#endif
#ifndef PLATFORM_WIN32
#ifdef HAVE_WORKING_SIGALTSTACK
+/*
+ * solaris doesn't have pthread_getattr_np () needed by the sigaltstack setup
+ * code.
+ */
+#ifndef __sun
#define MONO_ARCH_SIGSEGV_ON_ALTSTACK
+#endif
#define MONO_ARCH_USE_SIGACTION
#endif /* HAVE_WORKING_SIGALTSTACK */
#endif /* !PLATFORM_WIN32 */
-#define MONO_ARCH_SIGNAL_STACK_SIZE (64 * 1024)
+/* we should lower this size and make sure we don't call heavy stack users in the segv handler */
+#define MONO_ARCH_SIGNAL_STACK_SIZE (16 * 1024)
/* Enables OP_LSHL, OP_LSHL_IMM, OP_LSHR, OP_LSHR_IMM, OP_LSHR_UN, OP_LSHR_UN_IMM */
#define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
+#define MONO_ARCH_CPU_SPEC x86_desc
+
#define MONO_MAX_IREGS 8
#define MONO_MAX_FREGS 6
/* Parameters used by the register allocator */
-#define MONO_ARCH_HAS_XP_LOCAL_REGALLOC
-
#define MONO_ARCH_CALLEE_REGS X86_CALLEE_REGS
#define MONO_ARCH_CALLEE_SAVED_REGS X86_CALLER_REGS
#define inst_sreg2_high sreg2>>3
struct MonoLMF {
- gpointer previous_lmf;
+ /* Offset by 1 if this is a trampoline LMF frame */
+ guint32 previous_lmf;
gpointer lmf_addr;
+ /* Only set in trampoline LMF frames */
MonoMethod *method;
+ /* Only set in trampoline LMF frames */
+ guint32 esp;
guint32 ebx;
guint32 edi;
guint32 esi;
#define UCONTEXT_REG_ESI(ctx) ((ctx)->uc_mcontext->ss.esi)
#define UCONTEXT_REG_EDI(ctx) ((ctx)->uc_mcontext->ss.edi)
#define UCONTEXT_REG_EIP(ctx) ((ctx)->uc_mcontext->ss.eip)
+#elif defined(__NetBSD__)
+ #define UCONTEXT_REG_EAX(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EAX])
+ #define UCONTEXT_REG_EBX(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EBX])
+ #define UCONTEXT_REG_ECX(ctx) ((ctx)->uc_mcontext.__gregs [_REG_ECX])
+ #define UCONTEXT_REG_EDX(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EDX])
+ #define UCONTEXT_REG_EBP(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EBP])
+ #define UCONTEXT_REG_ESP(ctx) ((ctx)->uc_mcontext.__gregs [_REG_ESP])
+ #define UCONTEXT_REG_ESI(ctx) ((ctx)->uc_mcontext.__gregs [_REG_ESI])
+ #define UCONTEXT_REG_EDI(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EDI])
+ #define UCONTEXT_REG_EIP(ctx) ((ctx)->uc_mcontext.__gregs [_REG_EIP])
#else
#define UCONTEXT_REG_EAX(ctx) ((ctx)->uc_mcontext.gregs [REG_EAX])
#define UCONTEXT_REG_EBX(ctx) ((ctx)->uc_mcontext.gregs [REG_EBX])
} \
MONO_CONTEXT_SET_IP ((ctx), (start_func)); \
MONO_CONTEXT_SET_BP ((ctx), stackptr); \
+ MONO_CONTEXT_SET_SP ((ctx), stackptr); \
} while (0)
#else
mono_arch_flush_register_windows (); \
MONO_CONTEXT_SET_IP ((ctx), (start_func)); \
MONO_CONTEXT_SET_BP ((ctx), __builtin_frame_address (0)); \
+ MONO_CONTEXT_SET_SP ((ctx), __builtin_frame_address (0)); \
} while (0)
#endif
#define MONO_ARCH_NEED_GOT_VAR 1
#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
#define MONO_ARCH_ENABLE_EMIT_STATE_OPT 1
+#define MONO_ARCH_ENABLE_MONO_LMF_VAR 1
#define MONO_ARCH_HAVE_CREATE_TRAMPOLINE_FROM_TOKEN 1
#define MONO_ARCH_HAVE_CREATE_SPECIFIC_TRAMPOLINE 1
#define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE 1
#define MONO_ARCH_HAVE_CREATE_VARS 1
+#define MONO_ARCH_HAVE_IMT 1
+#define MONO_ARCH_IMT_REG X86_EDX
+#define MONO_ARCH_COMMON_VTABLE_TRAMPOLINE 1
+
+#define MONO_ARCH_AOT_SUPPORTED 1
#endif /* __MONO_MINI_X86_H__ */