Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mono / mini / mini-ppc.h
index 4b39b7ac2230065934bde90bf523b94f52998571..dc83f788509399e4f201a71dc391d4aa4f971c59 100644 (file)
@@ -4,12 +4,13 @@
 #include <mono/arch/ppc/ppc-codegen.h>
 #include <mono/utils/mono-sigcontext.h>
 #include <mono/utils/mono-context.h>
+#include <mono/metadata/object.h>
 #include <glib.h>
 
 #ifdef __mono_ppc64__
-#define MONO_ARCH_CPU_SPEC ppc64_cpu_desc
+#define MONO_ARCH_CPU_SPEC mono_ppc64_cpu_desc
 #else
-#define MONO_ARCH_CPU_SPEC ppcg4
+#define MONO_ARCH_CPU_SPEC mono_ppcg4
 #endif
 
 #define MONO_MAX_IREGS 32
@@ -68,23 +69,20 @@ typedef struct MonoCompileArch {
 #ifdef __mono_ppc64__
 #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
 #define MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
+
+/* ELFv2 ABI doesn't use function descriptors.  */
+#if _CALL_ELF == 2
+#undef PPC_USES_FUNCTION_DESCRIPTOR
+#else
 #define PPC_USES_FUNCTION_DESCRIPTOR
+#endif
 
 #ifndef __mono_ilp32__
 #define MONO_ARCH_HAVE_TLS_GET 1
-#define MONO_ARCH_ENABLE_MONITOR_IL_FASTPATH 1
 #endif
 
 #else /* must be __mono_ppc__ */
 
-#if 0
-/* enabling this for PPC32 causes hangs in the thread/delegate tests.
-   So disable for now. */
-#if defined(__linux__)
-#define MONO_ARCH_ENABLE_MONITOR_IL_FASTPATH 1
-#endif
-#endif
-
 #define MONO_ARCH_HAVE_TLS_GET 1
 #define MONO_ARCH_EMULATE_FCONV_TO_I8 1
 #define MONO_ARCH_EMULATE_LCONV_TO_R8 1
@@ -93,11 +91,10 @@ typedef struct MonoCompileArch {
 
 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
 #define MONO_ARCH_EMULATE_FREM 1
-#define MONO_ARCH_BIGMUL_INTRINS 1
 #define MONO_ARCH_GC_MAPS_SUPPORTED 1
 
 /* Parameters used by the register allocator */
-#define MONO_ARCH_CALLEE_REGS ((0xff << ppc_r3) | (1 << ppc_r11) | (1 << ppc_r12))
+#define MONO_ARCH_CALLEE_REGS ((0xff << ppc_r3) | (1 << ppc_r12) | (1 << ppc_r11))
 #define MONO_ARCH_CALLEE_SAVED_REGS (0xfffff << ppc_r13) /* ppc_13 - ppc_31 */
 
 #if defined(__APPLE__) || defined(__mono_ppc64__)
@@ -147,7 +144,6 @@ typedef struct MonoCompileArch {
 #define PPC_MINIMAL_PARAM_AREA_SIZE 64
 #define PPC_LAST_FPARG_REG ppc_f13
 #define PPC_PASS_STRUCTS_BY_VALUE 1
-#define PPC_SMALL_RET_STRUCT_IN_REG 0
 #define PPC_THREAD_PTR_REG ppc_r13
 #else
 #define PPC_RET_ADDR_OFFSET 4
@@ -156,7 +152,6 @@ typedef struct MonoCompileArch {
 #define PPC_MINIMAL_PARAM_AREA_SIZE 0
 #define PPC_LAST_FPARG_REG ppc_f8
 #define PPC_PASS_STRUCTS_BY_VALUE 0
-#define PPC_SMALL_RET_STRUCT_IN_REG 1
 #define PPC_THREAD_PTR_REG ppc_r2
 #endif
 #define PPC_FIRST_ARG_REG ppc_r3
@@ -164,15 +159,16 @@ typedef struct MonoCompileArch {
 #define PPC_FIRST_FPARG_REG ppc_f1
 #endif
 
+#define PPC_CALL_REG ppc_r12
+
 #if defined(HAVE_WORKING_SIGALTSTACK) && !defined(__APPLE__)
 #define MONO_ARCH_SIGSEGV_ON_ALTSTACK 1
 #define MONO_ARCH_SIGNAL_STACK_SIZE (12 * 1024)
 #endif /* HAVE_WORKING_SIGALTSTACK */
 
-#define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE
-#define MONO_ARCH_IMT_REG ppc_r12
+#define MONO_ARCH_IMT_REG ppc_r11
 
-#define MONO_ARCH_VTABLE_REG   ppc_r12
+#define MONO_ARCH_VTABLE_REG   ppc_r11
 #define MONO_ARCH_RGCTX_REG    MONO_ARCH_IMT_REG
 
 #define MONO_ARCH_NO_IOV_CHECK 1
@@ -194,7 +190,6 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_HAVE_OP_TAIL_CALL 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)
 
 #ifdef MONO_CROSS_COMPILE
 
@@ -267,7 +262,7 @@ typedef struct {
 } MonoPPCFunctionDescriptor;
 
 #define PPC_FTNPTR_SIZE                        sizeof (MonoPPCFunctionDescriptor)
-extern guint8* mono_ppc_create_pre_code_ftnptr (guint8 *code) MONO_INTERNAL;
+extern guint8* mono_ppc_create_pre_code_ftnptr (guint8 *code);
 #else
 #define PPC_FTNPTR_SIZE                        0
 #define mono_ppc_create_pre_code_ftnptr(c)     c
@@ -299,13 +294,13 @@ extern guint8* mono_ppc_create_pre_code_ftnptr (guint8 *code) MONO_INTERNAL;
 #endif
 
 gboolean
-mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig) MONO_INTERNAL;
+mono_ppc_tail_call_supported (MonoMethodSignature *caller_sig, MonoMethodSignature *callee_sig);
 
 void
-mono_ppc_patch (guchar *code, const guchar *target) MONO_INTERNAL;
+mono_ppc_patch (guchar *code, const guchar *target);
 
 void
-mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, mgreg_t *int_regs, gdouble *fp_regs, gboolean rethrow) MONO_INTERNAL;
+mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, mgreg_t *int_regs, gdouble *fp_regs, gboolean rethrow);
 
 #ifdef __mono_ppc64__
 #define MONO_PPC_32_64_CASE(c32,c64)   c64
@@ -314,10 +309,10 @@ extern void mono_ppc_emitted (guint8 *code, gint64 length, const char *format, .
 #define MONO_PPC_32_64_CASE(c32,c64)   c32
 #endif
 
-gboolean mono_ppc_is_direct_call_sequence (guint32 *code) MONO_INTERNAL;
+gboolean mono_ppc_is_direct_call_sequence (guint32 *code);
 
-void mono_ppc_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *addr) MONO_INTERNAL;
+void mono_ppc_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *addr);
 
-void mono_ppc_set_func_into_sigctx (void *sigctx, void *func) MONO_INTERNAL;
+void mono_ppc_set_func_into_sigctx (void *sigctx, void *func);
 
 #endif /* __MONO_MINI_PPC_H__ */