-/* md_codegen_patch_branch *****************************************************
-
- Back-patches a branch instruction.
-
-*******************************************************************************/
-
-void md_codegen_patch_branch(codegendata *cd, s4 branchmpc, s4 targetmpc)
-{
- s4 *mcodeptr;
- s4 disp; /* branch displacement */
-
- /* calculate the patch position */
-
- mcodeptr = (s4 *) (cd->mcodebase + branchmpc);
-
- /* Calculate the branch displacement. */
-
- disp = (targetmpc - branchmpc - 4) >> 2;
-
- if ((disp < (s4) 0xff000000) || (disp > (s4) 0x00ffffff))
- vm_abort("md_codegen_patch_branch: branch displacement out of range: %d > +/-%d", disp, 0x00ffffff);
-
- /* patch the branch instruction before the mcodeptr */
-
- mcodeptr[-1] |= (disp & 0x00ffffff);
-}
-
-
-/* md_stacktrace_get_returnaddress *********************************************
-
- Returns the return address of the current stackframe, specified by
- the passed stack pointer and the stack frame size.
-
-*******************************************************************************/
-
-u1 *md_stacktrace_get_returnaddress(u1 *sp, u4 framesize)
-{
- u1 *ra;
-
- /*printf("md_stacktrace_get_returnaddress(): called (sp=%x, framesize=%d)\n", sp, framesize);*/
-
- /* on ARM the return address is located on the top of the stackframe */
- /* ATTENTION: this is only true for non-leaf methods !!! */
- ra = *((u1 **) (sp + framesize - SIZEOF_VOID_P));
-
- /*printf("md_stacktrace_get_returnaddress(): result (ra=%x)\n", ra);*/
-
- return ra;
-}
-
-
-/* md_assembler_get_patch_address **********************************************