Blame qemu-0.7.0-ppc-functions-end-in-branch.patch

David Woodhouse 9b980e
--- qemu-0.7.0/dyngen.c.orig	2005-04-30 11:59:05.000000000 +0100
David Woodhouse 9b980e
+++ qemu-0.7.0/dyngen.c	2005-04-30 12:00:11.000000000 +0100
David Woodhouse 9b980e
@@ -1396,11 +1395,13 @@ void gen_code(const char *name, host_ulo
David Woodhouse 9b980e
 #elif defined(HOST_PPC)
David Woodhouse 9b980e
     {
David Woodhouse 9b980e
         uint8_t *p;
David Woodhouse 9b980e
+        uint32_t insn;
David Woodhouse 9b980e
         p = (void *)(p_end - 4);
David Woodhouse 9b980e
         if (p == p_start)
David Woodhouse 9b980e
             error("empty code for %s", name);
David Woodhouse 9b980e
-        if (get32((uint32_t *)p) != 0x4e800020)
David Woodhouse 9b980e
-            error("blr expected at the end of %s", name);
David Woodhouse 9b980e
+        insn = get32((uint32_t *)p);
David Woodhouse 9b980e
+        if (insn != 0x4e800020 && (insn & 0xfc000002) != 0x48000000)
David Woodhouse 9b980e
+            error("blr or b expected at the end of %s", name);
David Woodhouse 9b980e
         copy_size = p - p_start;
David Woodhouse 9b980e
     }
David Woodhouse 9b980e
 #elif defined(HOST_S390)