1.1 --- a/src/sh4/ia32abi.h Wed Nov 21 11:40:15 2007 +0000
1.2 +++ b/src/sh4/ia32abi.h Tue Jan 01 04:58:57 2008 +0000
1.4 exit_block( pc, pc );
1.6 if( sh4_x86.backpatch_posn != 0 ) {
1.9 uint8_t *end_ptr = xlat_output;
1.10 - // Exception termination. Jump block for various exception codes:
1.11 - PUSH_imm32( EXC_DATA_ADDR_READ );
1.12 - JMP_rel8( 33, target1 );
1.13 - PUSH_imm32( EXC_DATA_ADDR_WRITE );
1.14 - JMP_rel8( 26, target2 );
1.15 - PUSH_imm32( EXC_ILLEGAL );
1.16 - JMP_rel8( 19, target3 );
1.17 - PUSH_imm32( EXC_SLOT_ILLEGAL );
1.18 - JMP_rel8( 12, target4 );
1.19 - PUSH_imm32( EXC_FPU_DISABLED );
1.20 - JMP_rel8( 5, target5 );
1.21 - PUSH_imm32( EXC_SLOT_FPU_DISABLED );
1.23 - JMP_TARGET(target1);
1.24 - JMP_TARGET(target2);
1.25 - JMP_TARGET(target3);
1.26 - JMP_TARGET(target4);
1.27 - JMP_TARGET(target5);
1.28 - // Raise exception
1.29 load_spreg( R_ECX, REG_OFFSET(pc) );
1.30 ADD_r32_r32( R_EDX, R_ECX );
1.31 ADD_r32_r32( R_EDX, R_ECX );
1.32 @@ -188,7 +171,34 @@
1.36 - sh4_x86_do_backpatch( end_ptr );
1.37 + // Exception already raised - just cleanup
1.38 + uint8_t *preexc_ptr = xlat_output;
1.39 + load_imm32( R_ECX, sh4_x86.block_start_pc );
1.40 + ADD_r32_r32( R_EDX, R_ECX );
1.41 + ADD_r32_r32( R_EDX, R_ECX );
1.42 + store_spreg( R_ECX, REG_OFFSET(spc) );
1.43 + MOV_moff32_EAX( &sh4_cpu_period );
1.45 + ADD_r32_sh4r( R_EAX, REG_OFFSET(slice_cycle) );
1.46 + load_spreg( R_EAX, REG_OFFSET(pc) );
1.47 + call_func1(xlat_get_code,R_EAX);
1.51 + for( i=0; i< sh4_x86.backpatch_posn; i++ ) {
1.52 + *sh4_x86.backpatch_list[i].fixup_addr =
1.53 + xlat_output - ((uint8_t *)sh4_x86.backpatch_list[i].fixup_addr) - 4;
1.54 + if( sh4_x86.backpatch_list[i].exc_code == -1 ) {
1.55 + load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.56 + int rel = preexc_ptr - xlat_output;
1.59 + PUSH_imm32( sh4_x86.backpatch_list[i].exc_code );
1.60 + load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.61 + int rel = end_ptr - xlat_output;