2007-06-05 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / mini-s390.c
index 1e42b090b7b553b9be15f66188107cab932c4f83..4728a071e798121a6f9b1df4676561d91c66c88a 100644 (file)
@@ -221,6 +221,7 @@ typedef struct {
 
 typedef struct {
        int nargs;
+       int lastgr;
        guint32 stack_usage;
        guint32 struct_ret;
        ArgInfo ret;
@@ -254,6 +255,7 @@ static guchar * emit_float_to_int (MonoCompile *, guchar *, int, int, int, gbool
 static void mono_arch_break(void);
 gpointer mono_arch_get_lmf_addr (void);
 static guint8 * emit_load_volatile_registers(guint8 *, MonoCompile *);
+static void emit_sig_cookie (MonoCompile *, MonoCallInst *, CallInfo *, int);
 
 /*========================= End of Prototypes ======================*/
 
@@ -265,8 +267,6 @@ int mono_exc_esp_offset = 0;
 
 static int indent_level = 0;
 
-static const char*const * ins_spec = s390_cpu_desc;
-
 static gboolean tls_offset_inited = FALSE;
 
 static int appdomain_tls_offset = -1,
@@ -650,7 +650,6 @@ static void
 enter_method (MonoMethod *method, RegParm *rParm, char *sp)
 {
        int i, oParm = 0, iParm = 0;
-       MonoClass *class;
        MonoObject *obj;
        MonoMethodSignature *sig;
        char *fname;
@@ -660,12 +659,6 @@ enter_method (MonoMethod *method, RegParm *rParm, char *sp)
        size_data sz;
        void *curParm;
 
-
-lc++;
-if (lc > 5000000) {
-fseek(stdout, 0L, SEEK_SET);
-lc = 0;
-}
        fname = mono_method_full_name (method, TRUE);
        indent (1);
        printf ("ENTER: %s(", fname);
@@ -1039,6 +1032,8 @@ is_regsize_var (MonoType *t) {
        case MONO_TYPE_U4:
        case MONO_TYPE_I:
        case MONO_TYPE_U:
+       case MONO_TYPE_PTR:
+       case MONO_TYPE_FNPTR:
                return TRUE;
        case MONO_TYPE_OBJECT:
        case MONO_TYPE_STRING:
@@ -1329,8 +1324,8 @@ enum_retvalue:
                        /* Fall through */
                case MONO_TYPE_VALUETYPE: {
                        MonoClass *klass = mono_class_from_mono_type (sig->ret);
-                       if (sig->ret->data.klass->enumtype) {
-                               simpletype = sig->ret->data.klass->enum_basetype->type;
+                       if (klass->enumtype) {
+                               simpletype = klass->enum_basetype->type;
                                goto enum_retvalue;
                        }
                        if (sig->pinvoke)
@@ -1356,7 +1351,7 @@ enum_retvalue:
                case MONO_TYPE_VOID:
                        break;
                default:
-                       g_error ("Can't handle as return value 0x%x", sig->ret->type);
+                       g_error ("mini-s390: cannot handle as return value 0x%x (0x%x)", sig->ret->type,simpletype);
        }
 
        if (sig->hasthis) {
@@ -1565,6 +1560,16 @@ enum_retvalue:
                }
        }
 
+       /*----------------------------------------------------------*/
+       /* Handle the case where there are no implicit arguments    */
+       /*----------------------------------------------------------*/
+       if ((sig->call_convention == MONO_CALL_VARARG) &&
+           (sig->param_count == sig->sentinelpos)) {
+               gr = S390_LAST_ARG_REG + 1;
+               add_general (&gr, sz, &cinfo->sigCookie, TRUE);
+       }
+
+       cinfo->lastgr   = gr;
        sz->stack_size  = sz->stack_size + sz->local_size + sz->parm_size + 
                          sz->offset;
        sz->stack_size  = S390_ALIGN(sz->stack_size, sizeof(long));
@@ -1660,7 +1665,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
        }
 
        if (sig->hasthis) {
-               inst = cfg->varinfo [0];
+               inst = cfg->args [0];
                if (inst->opcode != OP_REGVAR) {
                        inst->opcode       = OP_REGOFFSET;
                        inst->inst_basereg = frame_reg;
@@ -1679,7 +1684,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                cfg->sig_cookie += S390_MINIMAL_STACK_SIZE;
 
        for (iParm = sArg; iParm < eArg; ++iParm) {
-               inst = cfg->varinfo [curinst];
+               inst = cfg->args [curinst];
                if (inst->opcode != OP_REGVAR) {
                        switch (cinfo->args[iParm].regtype) {
                                case RegTypeStructByAddr :
@@ -1689,14 +1694,14 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                                        size               = abs(cinfo->args[iParm].vtsize);
                                        offset             = S390_ALIGN(offset, sizeof(long));
                                        inst->inst_offset  = offset; 
-                                       inst->unused       = cinfo->args[iParm].offset;
+                                       inst->backend.arg_info       = cinfo->args[iParm].offset;
                                } else {
                                        inst->opcode       = OP_S390_ARGREG;
                                        inst->inst_basereg = frame_reg;
                                        size               = sizeof(gpointer);
                                        offset             = S390_ALIGN(offset, size);
                                        inst->inst_offset  = offset;
-                                       inst->unused       = cinfo->args[iParm].offset;
+                                       inst->backend.arg_info       = cinfo->args[iParm].offset;
                                }
                                        break;
                                case RegTypeStructByVal :
@@ -1705,7 +1710,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                                        size               = cinfo->args[iParm].size;
                                        offset             = S390_ALIGN(offset, size);
                                        inst->inst_offset  = offset;
-                                       inst->unused       = cinfo->args[iParm].offset;
+                                       inst->backend.arg_info       = cinfo->args[iParm].offset;
                                        break;
                                default :
                                if (cinfo->args[iParm].reg != STK_BASE) {
@@ -1724,7 +1729,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                                                              : 0);
                                        inst->inst_offset  = cinfo->args[iParm].offset + 
                                                             size;
-                                       inst->unused       = 0;
+                                       inst->backend.arg_info       = 0;
                                        size               = sizeof(long);
                                } 
                        }
@@ -1746,11 +1751,11 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                        continue;
 
                /*--------------------------------------------------*/
-               /* inst->unused indicates native sized value types, */
+               /* inst->backend.is_pinvoke indicates native sized value types, */
                /* this is used by the pinvoke wrappers when they   */
                /* call functions returning structure               */
                /*--------------------------------------------------*/
-               if (inst->unused && MONO_TYPE_ISSTRUCT (inst->inst_vtype))
+               if (inst->backend.is_pinvoke && MONO_TYPE_ISSTRUCT (inst->inst_vtype))
                        size = mono_class_native_size (mono_class_from_mono_type(inst->inst_vtype), &align);
                else
                        size = mono_type_size (inst->inst_vtype, &align);
@@ -1804,7 +1809,7 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
        MonoMethodSignature *sig;
        int i, n, lParamArea;
        CallInfo *cinfo;
-       ArgInfo *ainfo;
+       ArgInfo *ainfo = NULL;
        size_data sz;
        int stackSize;
 
@@ -1828,20 +1833,7 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
 
                if ((sig->call_convention == MONO_CALL_VARARG) &&
                    (i == sig->sentinelpos)) {
-                       MonoInst *sigArg;
-                       
-                       cfg->disable_aot = TRUE;
-                       MONO_INST_NEW (cfg, sigArg, OP_ICONST);
-                       sigArg->inst_p0 = call->signature;
-
-                       MONO_INST_NEW_CALL_ARG (cfg, arg, OP_OUTARG_MEMBASE);
-                       arg->ins.inst_left  = sigArg;
-                       arg->ins.inst_right = (MonoInst *) call;
-                       arg->size           = ainfo->size;
-                       arg->offset         = cinfo->sigCookie.offset;
-                       call->used_iregs   |= 1 << ainfo->reg;
-                       arg->ins.next       = call->out_args;
-                       call->out_args      = (MonoInst *) arg;
+                       emit_sig_cookie (cfg, call, cinfo, ainfo->size);
                }
 
                if (is_virtual && i == 0) {
@@ -1859,7 +1851,7 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
                        call->out_args      = (MonoInst *) arg;
                        arg->ins.inst_right = (MonoInst *) call;
                        if (ainfo->regtype == RegTypeGeneral) {
-                               arg->ins.unused   = ainfo->reg;
+                               arg->ins.backend.reg3   = ainfo->reg;
                                call->used_iregs |= 1 << ainfo->reg;
                                if (arg->ins.type == STACK_I8)
                                        call->used_iregs |= 1 << (ainfo->reg + 1);
@@ -1899,7 +1891,7 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
                                arg->offset       = ainfo->offset;
                                call->used_iregs |= 1 << ainfo->reg;
                        } else if (ainfo->regtype == RegTypeFP) {
-                               arg->ins.unused   = ainfo->reg;
+                               arg->ins.backend.reg3   = ainfo->reg;
                                call->used_fregs |= 1 << ainfo->reg;
                                if (ainfo->size == 4)
                                        arg->ins.opcode = OP_OUTARG_R4;
@@ -1910,6 +1902,15 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
                        }
                }
        }
+
+       /*
+        * Handle the case where there are no implicit arguments 
+        */
+       if ((sig->call_convention == MONO_CALL_VARARG) &&
+           (i == sig->sentinelpos)) {
+               emit_sig_cookie (cfg, call, cinfo, ainfo->size);
+       }
+
        /*
         * Reverse the call->out_args list.
         */
@@ -1930,6 +1931,53 @@ mono_arch_call_opcode (MonoCompile *cfg, MonoBasicBlock* bb,
 
 /*========================= End of Function ========================*/
 
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name                - emit_sig_cookie.                                  */
+/*                                                                  */
+/* Function    - For variable length parameter lists construct a   */
+/*               signature cookie and emit it.                     */
+/*                                                                 */
+/*------------------------------------------------------------------*/
+
+static void
+emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, 
+                CallInfo *cinfo, int argSize)
+{
+       MonoCallArgParm *arg;
+       MonoMethodSignature *tmpSig;
+       MonoInst *sigArg;
+                       
+       cfg->disable_aot = TRUE;
+
+       /*----------------------------------------------------------*/
+       /* mono_ArgIterator_Setup assumes the signature cookie is   */
+       /* passed first and all the arguments which were before it  */
+       /* passed on the stack after the signature. So compensate   */
+       /* by passing a different signature.                        */
+       /*----------------------------------------------------------*/
+       tmpSig = mono_metadata_signature_dup (call->signature);
+       tmpSig->param_count -= call->signature->sentinelpos;
+       tmpSig->sentinelpos  = 0;
+       if (tmpSig->param_count > 0)
+               memcpy (tmpSig->params, 
+                       call->signature->params + call->signature->sentinelpos, 
+                       tmpSig->param_count * sizeof(MonoType *));
+
+       MONO_INST_NEW (cfg, sigArg, OP_ICONST);
+       sigArg->inst_p0 = tmpSig;
+
+       MONO_INST_NEW_CALL_ARG (cfg, arg, OP_OUTARG_MEMBASE);
+       arg->ins.inst_left   = sigArg;
+       arg->ins.inst_right  = (MonoInst *) call;
+       arg->size            = argSize;
+       arg->offset          = cinfo->sigCookie.offset;
+       arg->ins.next        = call->out_args;
+       call->out_args       = (MonoInst *) arg;
+}
+
+/*========================= End of Function ========================*/
+
 /*------------------------------------------------------------------*/
 /*                                                                  */
 /* Name                - mono_arch_instrument_mem_needs                    */
@@ -2225,15 +2273,8 @@ peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
                        if (last_ins && (last_ins->opcode == OP_STOREI1_MEMBASE_REG) &&
                                        ins->inst_basereg == last_ins->inst_destbasereg &&
                                        ins->inst_offset == last_ins->inst_offset) {
-                               if (ins->dreg == last_ins->sreg1) {
-                                       last_ins->next = ins->next;                             
-                                       ins = ins->next;                                
-                                       continue;
-                               } else {
-                                       //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
-                                       ins->opcode = OP_MOVE;
-                                       ins->sreg1 = last_ins->sreg1;
-                               }
+                               ins->opcode = (ins->opcode == OP_LOADI1_MEMBASE) ? CEE_CONV_I1 : CEE_CONV_U1;
+                               ins->sreg1 = last_ins->sreg1;                           
                        }
                        break;
                case OP_LOADU2_MEMBASE:
@@ -2241,14 +2282,8 @@ peephole_pass (MonoCompile *cfg, MonoBasicBlock *bb)
                        if (last_ins && (last_ins->opcode == OP_STOREI2_MEMBASE_REG) &&
                                        ins->inst_basereg == last_ins->inst_destbasereg &&
                                        ins->inst_offset == last_ins->inst_offset) {
-                               if (ins->dreg == last_ins->sreg1) {
-                                       last_ins->next = ins->next;                             
-                                       ins = ins->next;                                
-                                       continue;
-                               } else {
-                                       ins->opcode = OP_MOVE;
-                                       ins->sreg1 = last_ins->sreg1;
-                               }
+                               ins->opcode = (ins->opcode == OP_LOADI2_MEMBASE) ? CEE_CONV_I2 : CEE_CONV_U2;
+                               ins->sreg1 = last_ins->sreg1;                           
                        }
                        break;
                case CEE_CONV_I4:
@@ -2408,7 +2443,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
        while (ins) {
                offset = code - cfg->native_code;
 
-               max_len = ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+               max_len = ((guint8 *)ins_get_spec (ins->opcode))[MONO_INST_LEN];
 
                if (offset > (cfg->code_size - max_len - 16)) {
                        cfg->code_size *= 2;
@@ -2684,7 +2719,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        }
                }
                        break;
-               case CEE_BREAK: {
+               case OP_BREAK: {
                        mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, mono_arch_break);
                         s390_brasl (code, s390_r14, 0);
                }
@@ -2784,7 +2819,6 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                }
                        break;
                case OP_LADD: {
-                       short int *o[1];
                        s390_alr  (code, s390_r0, ins->sreg1);
                        s390_jnc  (code, 4);
                        s390_ahi  (code, s390_r1, 1);
@@ -3313,7 +3347,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                                s390_ledbr (code, ins->dreg, ins->sreg1);
                }
                        break;
-               case CEE_JMP: {
+               case OP_JMP: {
                        if (cfg->method->save_lmf)
                                restoreLMF(code, cfg->frame_reg, cfg->stack_usage);
 
@@ -3465,7 +3499,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        s390_br  (code, s390_r14);
                }
                        break;
-               case CEE_THROW: {
+               case OP_THROW: {
                        s390_lr (code, s390_r2, ins->sreg1);
                        mono_add_patch_info (cfg, code-cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, 
                                             (gpointer)"mono_arch_throw_exception");
@@ -3511,7 +3545,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        s390_br  (code, s390_r14);
                }
                        break;
-               case CEE_ENDFINALLY: {
+               case OP_ENDFINALLY: {
                        if (s390_is_uimm12 (ins->inst_left->inst_offset)) {
                                s390_l  (code, s390_r14, 0, ins->inst_left->inst_basereg,
                                         ins->inst_left->inst_offset);
@@ -3536,7 +3570,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        ins->inst_c0 = code - cfg->native_code;
                }
                        break;
-               case CEE_BR: 
+               case OP_BR: 
                        EMIT_UNCOND_BRANCH(ins);
                        break;
                case OP_BR_REG: {
@@ -3850,37 +3884,57 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        s390_lhi   (code, ins->dreg, 0);
                }
                        break;
-               case OP_FBEQ:
-                       EMIT_COND_BRANCH (ins, S390_CC_EQ|S390_CC_OV);
+               case OP_FBEQ: {
+                       short *o;
+                       s390_jo (code, 0); CODEPTR(code, o);
+                       EMIT_COND_BRANCH (ins, S390_CC_EQ);
+                       PTRSLOT(code, o);
+               }
                        break;
                case OP_FBNE_UN:
                        EMIT_COND_BRANCH (ins, S390_CC_NE|S390_CC_OV);
                        break;
-               case OP_FBLT:
+               case OP_FBLT: {
+                       short *o;
+                       s390_jo (code, 0); CODEPTR(code, o);
                        EMIT_COND_BRANCH (ins, S390_CC_LT);
+                       PTRSLOT(code, o);
+               }
                        break;
                case OP_FBLT_UN:
                        EMIT_COND_BRANCH (ins, S390_CC_LT|S390_CC_OV);
                        break;
-               case OP_FBGT:
+               case OP_FBGT: {
+                       short *o;
+                       s390_jo (code, 0); CODEPTR(code, o);
                        EMIT_COND_BRANCH (ins, S390_CC_GT);
+                       PTRSLOT(code, o);
+               }
                        break;
                case OP_FBGT_UN:
                        EMIT_COND_BRANCH (ins, S390_CC_GT|S390_CC_OV);
                        break;
-               case OP_FBGE:
+               case OP_FBGE: {
+                       short *o;
+                       s390_jo (code, 0); CODEPTR(code, o);
                        EMIT_COND_BRANCH (ins, S390_CC_GE);
+                       PTRSLOT(code, o);
+               }
                        break;
                case OP_FBGE_UN:
                        EMIT_COND_BRANCH (ins, S390_CC_GE|S390_CC_OV);
                        break;
-               case OP_FBLE:
+               case OP_FBLE: {
+                       short *o;
+                       s390_jo (code, 0); CODEPTR(code, o);
                        EMIT_COND_BRANCH (ins, S390_CC_LE);
+                       PTRSLOT(code, o);
+               }
                        break;
                case OP_FBLE_UN:
                        EMIT_COND_BRANCH (ins, S390_CC_LE|S390_CC_OV);
                        break;
-               case CEE_CKFINITE: {
+               case OP_CKFINITE: {
                        short *o;
                        s390_lhi  (code, s390_r13, 0x7f);
                        s390_tcdb (code, ins->sreg1, 0, s390_r13, 0);
@@ -3892,9 +3946,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                }
                        break;
                case OP_S390_MOVE: {
-                       if (ins->unused > 0) {
-                               if (ins->unused <= 256) {
-                                       s390_mvc  (code, ins->unused, ins->dreg, 
+                       if (ins->backend.size > 0) {
+                               if (ins->backend.size <= 256) {
+                                       s390_mvc  (code, ins->backend.size, ins->dreg, 
                                                   ins->inst_offset, ins->sreg1, ins->inst_imm);
                                } else {
                                        s390_lr   (code, s390_r0, ins->dreg);
@@ -3929,7 +3983,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                        s390_lr  (code, s390_r1, ins->sreg2);
                        s390_l   (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset);
                        s390_a   (code, s390_r1, 0, ins->inst_basereg, ins->inst_offset);
-                       s390_cs  (code, s390_r0, s390_r0, ins->inst_basereg, ins->inst_offset);
+                       s390_cs  (code, s390_r0, s390_r1, ins->inst_basereg, ins->inst_offset);
                        s390_jnz (code, -7);
                        s390_lr  (code, ins->dreg, s390_r1);
                }
@@ -4120,7 +4174,7 @@ emit_load_volatile_registers(guint8 * code, MonoCompile *cfg)
 
        for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
                ArgInfo *ainfo = cinfo->args + i;
-               inst = cfg->varinfo [pos];
+               inst = cfg->args [pos];
                
                if (inst->opcode == OP_REGVAR) {
                        if (ainfo->regtype == RegTypeGeneral)
@@ -4264,7 +4318,7 @@ mono_arch_emit_prolog (MonoCompile *cfg)
                        max_offset += 6; 
 
                while (ins) {
-                       max_offset += ((guint8 *)ins_spec [ins->opcode])[MONO_INST_LEN];
+                       max_offset += ((guint8 *)ins_get_spec (ins->opcode))[MONO_INST_LEN];
                        ins = ins->next;
                }
        }
@@ -4278,13 +4332,13 @@ mono_arch_emit_prolog (MonoCompile *cfg)
        if (cinfo->struct_ret) {
                ArgInfo *ainfo = &cinfo->ret;
                inst         = cfg->ret;
-               inst->unused = ainfo->vtsize;
+               inst->backend.size = ainfo->vtsize;
                s390_st (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset);
        }
 
        for (i = 0; i < sig->param_count + sig->hasthis; ++i) {
                ArgInfo *ainfo = cinfo->args + i;
-               inst = cfg->varinfo [pos];
+               inst = cfg->args [pos];
                
                if (inst->opcode == OP_REGVAR) {
                        if (ainfo->regtype == RegTypeGeneral)
@@ -4548,8 +4602,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
                        iExc;
        guint32         code_size;
        MonoClass       *exc_classes [MAX_EXC];
-       guint8          *exc_throw_start [MAX_EXC], 
-                       *exc_throw_end [MAX_EXC];
+       guint8          *exc_throw_start [MAX_EXC];
 
        for (patch_info = cfg->patch_info; 
             patch_info; 
@@ -4837,15 +4890,15 @@ mono_arch_print_tree (MonoInst *tree, int arity)
                        break;
                case OP_S390_MOVE:
                        printf ("[0x%lx(%d,%s),0x%lx(%s)]",
-                               tree->inst_offset, tree->unused,
+                               tree->inst_offset, tree->backend.size,
                                mono_arch_regname(tree->dreg), tree->inst_imm, 
                                mono_arch_regname(tree->sreg1));
                        done = 1;
                        break;
                case OP_S390_SETF4RET:
-                       printf ("[f%ld,f%ld]", 
-                               mono_arch_regname (tree->dreg),
-                               mono_arch_regname (tree->sreg1));
+                       printf ("[%s,%s]", 
+                               mono_arch_fregname (tree->dreg),
+                               mono_arch_fregname (tree->sreg1));
                        done = 1;
                        break;
                case OP_TLS_GET:
@@ -4973,4 +5026,22 @@ mono_arch_get_lmf_addr (void)
 }
 
 
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/*                                                                  */
+/* Name                - mono_arch_get_patch_offset                        */
+/*                                                                  */
+/* Function    - Dummy entry point until s390x supports aot.       */
+/*                                                                 */
+/* Returns     - Offset for patch.                                 */
+/*                                                                  */
+/*------------------------------------------------------------------*/
+
+guint32
+mono_arch_get_patch_offset (guint8 *code)
+{
+       return 0;
+}
+
 /*========================= End of Function ========================*/