X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fjit%2Farm%2Fasmpart.S;h=eaee0213d42fd83efc1dfeb14a3195fd67a11561;hb=68b801108b8c8785e890db73c0edf4772381dd70;hp=68c77517d0f34be9ac08822e1289cc86b4286aa9;hpb=8ccea0fdd01c4e7528a034eee149e50507334a36;p=cacao.git diff --git a/src/vm/jit/arm/asmpart.S b/src/vm/jit/arm/asmpart.S index 68c77517d..eaee0213d 100644 --- a/src/vm/jit/arm/asmpart.S +++ b/src/vm/jit/arm/asmpart.S @@ -1,9 +1,7 @@ /* src/vm/jit/arm/asmpart.S - Java-C interface functions for ARM - Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel, - C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring, - E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, - J. Wenninger, Institut f. Computersprachen - TU Wien + Copyright (C) 1996-2005, 2006, 2007, 2008 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO This file is part of CACAO. @@ -22,14 +20,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - $Id: asmpart.S 8160 2007-06-28 01:52:19Z michi $ - */ #include "config.h" -#include "vm/jit/arm/offsets.h" +#include + #include "vm/jit/arm/md-asm.h" #include "vm/jit/methodheader.h" @@ -43,38 +40,25 @@ /* export functions ***********************************************************/ .globl asm_vm_call_method + .type asm_vm_call_method, %function .globl asm_vm_call_method_int + .type asm_vm_call_method_int, %function .globl asm_vm_call_method_long + .type asm_vm_call_method_long, %function .globl asm_vm_call_method_float + .type asm_vm_call_method_float, %function .globl asm_vm_call_method_double + .type asm_vm_call_method_double, %function .globl asm_vm_call_method_exception_handler .globl asm_vm_call_method_end - .globl asm_call_jit_compiler - .globl asm_handle_exception .globl asm_handle_nat_exception .globl asm_abstractmethoderror .globl asm_cacheflush - - .globl asm_getclassvalues_atomic - .globl asm_criticalsections - - -#if !defined(ENABLE_THREADS) -asm_exceptionptr: - .word _no_threads_exceptionptr -#endif - -asm_criticalsections: -#if defined(ENABLE_THREADS) - .word _crit_begin - .word _crit_end - .word _crit_restart -#endif - .word 0 + .type asm_cacheflush, %function /* asm_vm_call_method ********************************************************** @@ -89,25 +73,17 @@ asm_criticalsections: .align 2 - .word 0 /* catch type all */ - .word 0 /* handler pc */ - .word 0 /* end pc */ - .word 0 /* start pc */ - .word 1 /* extable size */ - .word 0 /* line number table start */ - .word 0 /* line number table size */ .word 0 /* FltSave */ .word 0 /* IntSave */ .word 0 /* IsLeaf */ - .word 0 /* IsSync */ .word 0 /* FrameSize */ .word 0 /* CodeinfoPointer */ asm_vm_call_method: asm_vm_call_method_int: asm_vm_call_method_long: -/* asm_vm_call_method_float: -asm_vm_call_method_double: */ +asm_vm_call_method_float: +asm_vm_call_method_double: SAVE_SCRATCH_REGISTERS /* save our personal scratch regs */ stmfd sp!, {v1} /* V1 is used to remember SP */ str a0, [sp, #-4]! /* store methods entrypoint */ @@ -162,66 +138,9 @@ asm_vm_call_method_exception_handler: ldmfd sp!, {v1} RESTORE_SCRATCH_REGS_AND_RETURN /* return to caller, restore regs */ -asm_vm_call_method_float: - mov a0,#0x51 - b asm_debug -asm_vm_call_method_double: - mov a0,#0x52 - b asm_debug - asm_vm_call_method_end: -/****************** function asm_call_jit_compiler ***************************** -* * -* Invokes the compiler for untranslated JavaVM methods. * -* What this method does: * -* - save args and LR * -* - fire up jit_compile (pass methodinfo pointer) * -* - try to find out where to write back the new method pointer * -* - restore args and LR * -* - check for exceptions * -* - eventually write back new method pointer * -* - call jit code (wich will then return to caller) * -* * -* These methods can call us: codegen_compilerstub & asm_calljavafunction * -* ATTENTION: use REG_ITMP1 to pass methodinfo pointer to me! * -* * -*******************************************************************************/ - -#define MYSTACKSIZE (6*4) - -asm_call_jit_compiler: - SAVE_ARGUMENT_REGISTERS /* save our argument registers & LR */ - sub sp, sp, #4 /* keep stack 8-byte aligned */ - - mov a0, itmp1 /* pass methodinfo pointer */ - mov a1, mptr /* pass method pointer */ - add a2, sp, #MYSTACKSIZE /* pass Java sp */ - mov a3, lr /* pass Java RA (correct for leafs) */ - bl jit_asm_compile - mov itmp1, res1 /* save pointer to new jit-code */ - - tst itmp1,itmp1 /* check for exeption */ - beq L_asm_call_jit_compiler_exception - - add sp, sp, #4 /* keep stack 8-byte aligned */ - RESTORE_ARGUMENT_REGISTERS /* load our argument registers & LR */ - - mov ip, itmp1 - mov pc, ip /* call jit-code */ - -L_asm_call_jit_compiler_exception: - bl exceptions_get_and_clear_exception - mov xptr, res1 /* get exception */ - - add sp, sp, #4 /* keep stack 8-byte aligned */ - RESTORE_ARGUMENT_REGISTERS /* load LR */ - - sub xpc, lr, #4 /* xpc = instruction that called us */ - b asm_handle_nat_exception - - /********************* function asm_handle_exception *************************** * * * This function handles an exception. It does not use the usual calling * @@ -238,7 +157,7 @@ asm_handle_nat_exception: /*TODO:maybe make a macro out of it!!!*/ SAVE_ARGUMENT_REGISTERS mov a0, lr - bl md_codegen_get_pv_from_pc + bl md_asm_codegen_get_pv_from_pc mov ip, res1 RESTORE_ARGUMENT_REGISTERS /* fall through */ @@ -295,7 +214,7 @@ asm_handle_exception_not_catched: /*TODO:maybe make a macro out of it!!!*/ SAVE_ARGUMENT_REGISTERS mov a0, lr - bl md_codegen_get_pv_from_pc + bl md_asm_codegen_get_pv_from_pc mov ip, res1 RESTORE_ARGUMENT_REGISTERS @@ -328,39 +247,32 @@ asm_abstractmethoderror: * * *******************************************************************************/ -#if 1 -.equ sys_cacheflush, 0x9f0002 +L___ARM_NR_cacheflush: + .align 2 + .word __ARM_NR_cacheflush + asm_cacheflush: add a1, a0, a1 mov a2, #0 -#if 0 +#if defined(__ARM_EABI__) + /* According to EABI, the syscall number should be passed via R7, + see "http://wiki.debian.org/ArmEabiPort" for additional details. */ + + stmfd sp!, {r7} + ldr r7, L___ARM_NR_cacheflush + swi 0x0 + ldmfd sp!, {r7} +#else +# if 0 /* TWISTI: required on iyonix, maybe a linux-2.4 bug */ - /* TODO: repeair this! */ - /* cacheflush is messed up beyond all repair! */ - mov a0, #0x0 - mov a1, #0xff000000 -#endif + mov a0, #0x0 + mov a1, #0xff000000 +# endif - swi #sys_cacheflush - mov pc, lr + swi __ARM_NR_cacheflush #endif - -/********************* function asm_getclassvalues_atomic *********************/ - -asm_getclassvalues_atomic: - stmfd sp!, {r4, r5, r6} -_crit_restart: -_crit_begin: - ldr r4,[a0,#offbaseval] - ldr r5,[a0,#offdiffval] - ldr r6,[a1,#offbaseval] -_crit_end: - str r4,[a2,#offcast_super_baseval] - str r5,[a2,#offcast_super_diffval] - str r6,[a2,#offcast_sub_baseval] - ldmfd sp!, {r4, r5, r6} mov pc, lr