Revert "Revert "Merge branch 'master' of https://github.com/mono/mono""
[mono.git] / mono / metadata / sgen-archdep.h
index e400d7cc6c8b101e2c73fe93e9c166a292111e05..b86ec318c7cb8bfb0e2139c578deacf455b507c9 100755 (executable)
@@ -89,7 +89,7 @@
 #define ARCH_COPY_SIGCTX_REGS(a,ctx) do {      \
        int __i;        \
        for (__i = 0; __i < 32; ++__i)  \
-               ((a)[__i]) = UCONTEXT_REG_Rn((ctx), __i);       \
+               ((a)[__i]) = (gpointer) UCONTEXT_REG_Rn((ctx), __i);    \
        } while (0)
 
 #elif defined(TARGET_ARM)
        ((a)[13]) = (gpointer) (UCONTEXT_REG_LR((ctx)));        \
        } while (0)
 
+#elif defined(TARGET_ARM64)
+
+#include <mono/utils/mono-sigcontext.h>
+
+#ifdef __linux__
+#define REDZONE_SIZE    0
+#elif defined(__APPLE__)
+#define REDZONE_SIZE   128
+#else
+#error "Not implemented."
+#endif
+#define USE_MONO_CTX
+#define ARCH_NUM_REGS 31
+
+#define ARCH_STORE_REGS(ptr) do { g_assert_not_reached (); } while (0)
+
+#define ARCH_SIGCTX_SP(ctx)    UCONTEXT_REG_SP (ctx)
+#define ARCH_SIGCTX_IP(ctx)    UCONTEXT_REG_PC (ctx)
+#define ARCH_COPY_SIGCTX_REGS(a,ctx) do { g_assert_not_reached (); } while (0)
+
 #elif defined(__mips__)
 
 #define REDZONE_SIZE   0
 #define USE_MONO_CTX
 #define ARCH_NUM_REGS 32
 
-#define ARCH_SIGCTX_SP(ctx)    (UCONTEXT_GREGS((ctx))[29])
-#define ARCH_SIGCTX_IP(ctx)    (UCONTEXT_REG_PC((ctx)))
+/*
+ * These casts are necessary since glibc always makes the
+ * gregs 64-bit values in userland.
+ */
+#define ARCH_SIGCTX_SP(ctx)    ((gsize) UCONTEXT_GREGS((ctx))[29])
+#define ARCH_SIGCTX_IP(ctx)    ((gsize) UCONTEXT_REG_PC((ctx)))
 
 #elif defined(__s390x__)