[runtime] Fix a few more places which accessed jinfo->method directly.
[mono.git] / mono / mini / mini-s390x.h
index 3c4baf035565681528d8d53f33037554cc1f3cca..a5be8f01087162cbde7ed649cf1cb945bc0464aa 100644 (file)
@@ -2,6 +2,7 @@
 #define __MONO_MINI_S390X_H__
 
 #include <mono/arch/s390x/s390x-codegen.h>
+#include <mono/utils/mono-context.h>
 #include <signal.h>
 
 #define MONO_ARCH_CPU_SPEC s390x_cpu_desc
@@ -14,7 +15,7 @@
 /*-------------------------------------------*/
 
 #define S390_LONG(loc, opy, op, r, ix, br, off)                                        \
-       if (has_ld) {                                                           \
+       if (mono_hwcap_s390x_has_ld) {                                          \
                if (s390_is_imm20(off)) {                                       \
                        s390_##opy (loc, r, ix, br, off);                       \
                } else {                                                        \
@@ -47,8 +48,6 @@ struct MonoLMF {
        gdouble     fregs[16];
 };
 
-typedef struct ucontext MonoContext;
-
 typedef struct MonoCompileArch {
        gpointer    litpool;
        glong       litsize;
@@ -114,12 +113,21 @@ typedef struct
 #define MONO_ARCH_SIGNAL_STACK_SIZE                    256*1024
 #define MONO_ARCH_HAVE_DECOMPOSE_OPTS                  1
 #define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE      1
-#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION          1
 #define MONO_ARCH_HAVE_IMT                             1
+#define MONO_ARCH_HAVE_TLS_GET                         1
+#define MONO_ARCH_ENABLE_MONO_LMF_VAR                  1
 #define MONO_ARCH_IMT_REG                              s390_r9
+#define MONO_ARCH_VTABLE_REG                           MONO_ARCH_IMT_REG
+#define MONO_ARCH_RGCTX_REG                            MONO_ARCH_IMT_REG
 #define MONO_ARCH_THIS_AS_FIRST_ARG                    1
-
-#define MONO_ARCH_USE_SIGACTION        1
+#define MONO_ARCH_HAVE_XP_UNWIND                       1
+#define MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX               1
+#define MONO_ARCH_SOFT_DEBUG_SUPPORTED                 1
+#define MONO_ARCH_HAVE_CONTEXT_SET_INT_REG             1
+#define MONO_ARCH_USE_SIGACTION                        1
+#define MONO_ARCH_GC_MAPS_SUPPORTED                    1
+#define MONO_ARCH_GSHARED_SUPPORTED                    1
+#define MONO_ARCH_MONITOR_ENTER_ADJUSTMENT             1
 
 #define S390_STACK_ALIGNMENT            8
 #define S390_FIRST_ARG_REG             s390_r2
@@ -187,32 +195,16 @@ typedef struct
 #define S390_CC_EQ                     8
 #define S390_ALIGN(v, a)       (((a) > 0 ? (((v) + ((a) - 1)) & ~((a) - 1)) : (v)))
 
-#define MONO_CONTEXT_SET_IP(ctx,ip)                                    \
-       do {                                                            \
-               (ctx)->uc_mcontext.gregs[14] = (unsigned long)ip;       \
-               (ctx)->uc_mcontext.psw.addr = (unsigned long)ip;        \
-       } while (0); 
-
-#define MONO_CONTEXT_SET_SP(ctx,bp) MONO_CONTEXT_SET_BP((ctx),(bp))
-#define MONO_CONTEXT_SET_BP(ctx,bp)                                    \
-       do {                                                            \
-               (ctx)->uc_mcontext.gregs[15] = (unsigned long)bp;       \
-               (ctx)->uc_stack.ss_sp        = (void*)bp;               \
-       } while (0) 
-
-#define MONO_CONTEXT_GET_IP(ctx) (gpointer) (ctx)->uc_mcontext.psw.addr
-#define MONO_CONTEXT_GET_BP(ctx) MONO_CONTEXT_GET_SP((ctx))
-#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->uc_mcontext.gregs[15]))
-
 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,func) do {                     \
                MonoS390StackFrame *sframe;                             \
                __asm__ volatile("lgr   %0,15" : "=r" (sframe));        \
                MONO_CONTEXT_SET_BP ((ctx), sframe->prev);              \
                MONO_CONTEXT_SET_SP ((ctx), sframe->prev);              \
-               sframe = (MonoS390StackFrame*)sframe->prev;             \
-               MONO_CONTEXT_SET_IP ((ctx), sframe->return_address);    \
+               MONO_CONTEXT_SET_IP ((ctx), func);                      \
        } while (0)
 
+#define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf) do { (lmf)->ebp = -1; } while (0)
+
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - s390_patch_rel                                    */