X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-context.h;h=0a1bd524cfd42261ac798b6f0b2eb1b8c7fe726f;hb=ea0e95eec1dbe1fea52e8261b2a264258b636120;hp=a8de3e99d53b29bfd957cfcc31a74bde8fcef5c8;hpb=f0a2c8ef306c93f9cfc38e4e0d802a590b33e5ee;p=mono.git diff --git a/mono/utils/mono-context.h b/mono/utils/mono-context.h index a8de3e99d53..0a1bd524cfd 100644 --- a/mono/utils/mono-context.h +++ b/mono/utils/mono-context.h @@ -253,6 +253,8 @@ typedef struct { #if defined(HOST_WATCHOS) #define MONO_CONTEXT_GET_CURRENT(ctx) do { \ + gpointer _dummy; \ + ctx.regs [ARMREG_SP] = &_dummy; \ } while (0); #else @@ -551,6 +553,7 @@ typedef struct { #elif defined(__sparc__) || defined(sparc) /* defined(__mono_ppc__) */ typedef struct MonoContext { + mgreg_t regs [15]; guint8 *ip; gpointer *sp; gpointer *fp; @@ -564,6 +567,54 @@ typedef struct MonoContext { #define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->fp)) #define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->sp)) +#ifdef __sparcv9 +#define MONO_CONTEXT_GET_CURRENT(ctx) \ + __asm__ __volatile__( \ + "st %%g1,[%0]\n" \ + "st %%g2,[%0+0x08]\n" \ + "st %%g3,[%0+0x10]\n" \ + "st %%g4,[%0+0x18]\n" \ + "st %%g5,[%0+0x20]\n" \ + "st %%g6,[%0+0x28]\n" \ + "st %%g7,[%0+0x30]\n" \ + "st %%o0,[%0+0x38]\n" \ + "st %%o1,[%0+0x40]\n" \ + "st %%o2,[%0+0x48]\n" \ + "st %%o3,[%0+0x50]\n" \ + "st %%o4,[%0+0x58]\n" \ + "st %%o5,[%0+0x60]\n" \ + "st %%o6,[%0+0x68]\n" \ + "st %%o7,[%0+0x70]\n" \ + : \ + : "r" (&(ctx)) \ + : "memory" \ + ) +#else +#define MONO_CONTEXT_GET_CURRENT(ctx) \ + __asm__ __volatile__( \ + "st %%g1,[%0]\n" \ + "st %%g2,[%0+0x04]\n" \ + "st %%g3,[%0+0x08]\n" \ + "st %%g4,[%0+0x0c]\n" \ + "st %%g5,[%0+0x10]\n" \ + "st %%g6,[%0+0x14]\n" \ + "st %%g7,[%0+0x18]\n" \ + "st %%o0,[%0+0x1c]\n" \ + "st %%o1,[%0+0x20]\n" \ + "st %%o2,[%0+0x24]\n" \ + "st %%o3,[%0+0x28]\n" \ + "st %%o4,[%0+0x2c]\n" \ + "st %%o5,[%0+0x30]\n" \ + "st %%o6,[%0+0x34]\n" \ + "st %%o7,[%0+0x38]\n" \ + : \ + : "r" (&(ctx)) \ + : "memory" \ + ) +#endif + +#define MONO_ARCH_HAS_MONO_CONTEXT 1 + #elif defined(__ia64__) /*defined(__sparc__) || defined(sparc) */ #ifndef UNW_LOCAL_ONLY @@ -648,6 +699,8 @@ mono_ia64_context_get_fp (MonoContext *ctx) #elif ((defined(__mips__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_MIPS))) && SIZEOF_REGISTER == 4 /* defined(__ia64__) */ +#define MONO_ARCH_HAS_MONO_CONTEXT 1 + #include typedef struct {