Implement passing of this as the first argument for ia64 correctly.
[mono.git] / mono / mini / mini-ppc.h
index f6046df7f6be12cefe4e4b21f1adc04d73334b01..18c225f7726778ffc9b2399b5b17ceeb65b5a505 100644 (file)
@@ -27,6 +27,10 @@ void ppc_patch (guchar *code, const guchar *target);
 void ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd);
 
 struct MonoLMF {
+       /*
+        * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and
+        * the other fields are not valid.
+        */
        gpointer    previous_lmf;
        gpointer    lmf_addr;
        MonoMethod *method;
@@ -51,6 +55,15 @@ typedef struct {
        double fregs [MONO_SAVED_FREGS];
 } MonoContext;
 
+/*
+ * This structure is an extension of MonoLMF and contains extra information.
+ */
+typedef struct {
+       struct MonoLMF lmf;
+       gboolean debugger_invoke;
+       MonoContext ctx; /* if debugger_invoke is TRUE */
+} MonoLMFExt;
+
 typedef struct MonoCompileArch {
        int fp_conv_var_offset;
 } MonoCompileArch;
@@ -189,16 +202,20 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
 
 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1
-#define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
 
 #define MONO_ARCH_HAVE_STATIC_RGCTX_TRAMPOLINE 1
 #define MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES 1
+#define MONO_ARCH_HAVE_XP_UNWIND 1
 
 #define MONO_ARCH_GSHARED_SUPPORTED 1
 
 #define MONO_ARCH_NEED_DIV_CHECK 1
 #define MONO_ARCH_AOT_SUPPORTED 1
 #define MONO_ARCH_NEED_GOT_VAR 1
+#if !defined(MONO_CROSS_COMPILE) && !defined(TARGET_PS3)
+#define MONO_ARCH_SOFT_DEBUG_SUPPORTED 1
+#endif
+#define MONO_ARCH_THIS_AS_FIRST_ARG 1
 
 #define PPC_NUM_REG_ARGS (PPC_LAST_ARG_REG-PPC_FIRST_ARG_REG+1)
 #define PPC_NUM_REG_FPARGS (PPC_LAST_FPARG_REG-PPC_FIRST_FPARG_REG+1)
@@ -207,6 +224,7 @@ typedef struct MonoCompileArch {
 #define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->sc_ir = (gulong)ip; } while (0);
 /* FIXME: should be called SET_SP */
 #define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->sc_sp = (gulong)bp; } while (0);
+#define MONO_CONTEXT_SET_SP(ctx,sp) do { (ctx)->sc_sp = (gulong)sp; } while (0);
 
 #define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->sc_ir))
 #define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->regs [ppc_r31-13]))
@@ -297,6 +315,16 @@ extern guint8* mono_ppc_create_pre_code_ftnptr (guint8 *code) MONO_INTERNAL;
 #define MONO_ARCH_USE_SIGACTION 1
 #elif defined(__FreeBSD__)
 #define MONO_ARCH_USE_SIGACTION 1
+#elif defined(MONO_CROSS_COMPILE)
+       typedef MonoContext ucontext_t;
+/*     typedef struct {
+               int dummy;
+       } ucontext_t;*/
+       #define UCONTEXT_REG_Rn(ctx, n)
+       #define UCONTEXT_REG_FPRn(ctx, n)
+       #define UCONTEXT_REG_NIP(ctx)
+       #define UCONTEXT_REG_LNK(ctx)
+
 #else
 /* For other operating systems, we pull the definition from an external file */
 #include "mini-ppc-os.h"
@@ -310,7 +338,7 @@ mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp,
 
 #ifdef __mono_ppc64__
 #define MONO_PPC_32_64_CASE(c32,c64)   c64
-extern void mono_ppc_emitted (guint8 *code, ssize_t length, const char *format, ...);
+extern void mono_ppc_emitted (guint8 *code, gint64 length, const char *format, ...);
 #else
 #define MONO_PPC_32_64_CASE(c32,c64)   c32
 #endif
@@ -319,4 +347,6 @@ gboolean mono_ppc_is_direct_call_sequence (guint32 *code) MONO_INTERNAL;
 
 void mono_ppc_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *addr) MONO_INTERNAL;
 
+void mono_ppc_set_func_into_sigctx (void *sigctx, void *func) MONO_INTERNAL;
+
 #endif /* __MONO_MINI_PPC_H__ */