Move ssb thread registration and globals to its file.
[mono.git] / mono / metadata / sgen-archdep.h
index dda1665245eea42835129a387451f0be0dfe60bf..28168e537f1dc47499ac36d2d9110805883faeef 100644 (file)
 #define REDZONE_SIZE   0
 
 #define ARCH_NUM_REGS 8
+
+#ifdef MONO_ARCH_HAS_MONO_CONTEXT
 #define USE_MONO_CTX
+#else
+#define ARCH_STORE_REGS(ptr)   \
+       __asm__ __volatile__(   \
+               "mov %%edi,0(%0)\n"     \
+               "mov %%esi,4(%0)\n"     \
+               "mov %%ebx,8(%0)\n"     \
+               "mov %%edx,12(%0)\n"    \
+               "mov %%ecx,16(%0)\n"    \
+               "mov %%eax,20(%0)\n"    \
+               "mov %%ebp,24(%0)\n"    \
+               "mov %%esp,28(%0)\n"    \
+               :                       \
+               : "r" (ptr)     \
+       )
+#endif
 
 /*FIXME, move this to mono-sigcontext as this is generaly useful.*/
 #define ARCH_SIGCTX_SP(ctx)    (UCONTEXT_REG_ESP ((ctx)))
        ((a)[13]) = (gpointer) (UCONTEXT_REG_LR((ctx)));        \
        } 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)))
+
 #elif defined(__s390x__)
 
 #define REDZONE_SIZE   0