+void
+mono_arch_nullify_plt_entry (guint8 *code)
+{
+ g_assert_not_reached ();
+}
+
+/*========================= End of Function ========================*/
+
+/*------------------------------------------------------------------*/
+/* */
+/* Name - mono_arch_get_vcall_slot */
+/* */
+/* Function - This method is called by the arch independent */
+/* trampoline code to determine the vtable slot used by */
+/* the call which invoked the trampoline. */
+/* The calls */
+/* generated by mono for S/390 will look like either:*/
+/* 1. l %r1,xxx(%rx) */
+/* bras %r14,%r1 */
+/* 2. brasl %r14,xxxxxx */
+/* */
+/* Parameters - code - Pointer into caller code */
+/* regs - Register state at the point of the call */
+/* displacement - Out parameter which will receive */
+/* the displacement of the vtable slot */
+/* */
+/*------------------------------------------------------------------*/
+
+gpointer
+mono_arch_get_vcall_slot (guint8 *code, gpointer *regs, int *displacement)
+{
+ int reg;
+ guchar* base;
+ unsigned short opcode;
+ char *sp;
+
+ // We are passed sp instead of the register array
+ sp = (char*)regs;
+
+ *displacement = 0;
+
+ opcode = *((unsigned short *) (code - 6));
+ switch (opcode) {
+ case 0x5810 :
+ /* This is a bras r14,r1 instruction */
+ code -= 4;
+ reg = *code >> 4;
+ *displacement = *((short *)code) & 0x0fff;
+ if (reg > 5)
+ base = *((guchar **) (sp + S390_REG_SAVE_OFFSET+
+ sizeof(int)*(reg-6)));
+ else
+ base = *((guchar **) ((sp - CREATE_STACK_SIZE) +
+ CREATE_GR_OFFSET +
+ sizeof(int)*(reg-2)));
+ return base;
+ case 0x581d :
+ /* l %r1,OFFSET(%r13,%r7) */
+ code -= 4;
+ reg = *code >> 4;
+ *displacement = *((short *)code) & 0x0fff;
+ if (reg > 5)
+ base = *((guchar **) (sp + S390_REG_SAVE_OFFSET+
+ sizeof(int)*(reg-6)));
+ else
+ base = *((guchar **) ((sp - CREATE_STACK_SIZE) +
+ CREATE_GR_OFFSET +
+ sizeof(int)*(reg-2)));
+ base += *((guint32*) (sp + S390_REG_SAVE_OFFSET+
+ sizeof(int)*(s390_r13-6)));
+ return base;
+ case 0xc0e5 :
+ /* This is the 'brasl' instruction */
+ return NULL;
+ default :
+ g_error("Unable to patch instruction prior to %p",code);
+ }
+
+ return NULL;
+}
+
+/*========================= End of Function ========================*/
+