Search
lxdream.org :: lxdream/src/sh4/ia64abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia64abi.h
changeset 559:06714bc64271
prev547:d6e00ffc4adc
next561:533f6b478071
author nkeynes
date Tue Jan 01 04:58:57 2008 +0000 (12 years ago)
branchlxdream-mmu
permissions -rw-r--r--
last change Commit first pass at full TLB support - still needs a lot more work
file annotate diff log raw
1.1 --- a/src/sh4/ia64abi.h Thu Dec 06 10:37:55 2007 +0000
1.2 +++ b/src/sh4/ia64abi.h Tue Jan 01 04:58:57 2008 +0000
1.3 @@ -135,7 +135,6 @@
1.4 RET();
1.5 }
1.6
1.7 -
1.8 /**
1.9 * Write the block trailer (exception handling block)
1.10 */
1.11 @@ -145,26 +144,9 @@
1.12 exit_block( pc, pc );
1.13 }
1.14 if( sh4_x86.backpatch_posn != 0 ) {
1.15 + unsigned int i;
1.16 + // Raise exception
1.17 uint8_t *end_ptr = xlat_output;
1.18 - // Exception termination. Jump block for various exception codes:
1.19 - load_imm32( R_EDI, EXC_DATA_ADDR_READ );
1.20 - JMP_rel8( 33, target1 );
1.21 - load_imm32( R_EDI, EXC_DATA_ADDR_WRITE );
1.22 - JMP_rel8( 26, target2 );
1.23 - load_imm32( R_EDI, EXC_ILLEGAL );
1.24 - JMP_rel8( 19, target3 );
1.25 - load_imm32( R_EDI, EXC_SLOT_ILLEGAL );
1.26 - JMP_rel8( 12, target4 );
1.27 - load_imm32( R_EDI, EXC_FPU_DISABLED );
1.28 - JMP_rel8( 5, target5 );
1.29 - load_imm32( R_EDI, EXC_SLOT_FPU_DISABLED );
1.30 - // target
1.31 - JMP_TARGET(target1);
1.32 - JMP_TARGET(target2);
1.33 - JMP_TARGET(target3);
1.34 - JMP_TARGET(target4);
1.35 - JMP_TARGET(target5);
1.36 - // Raise exception
1.37 load_spreg( R_ECX, REG_OFFSET(pc) );
1.38 ADD_r32_r32( R_EDX, R_ECX );
1.39 ADD_r32_r32( R_EDX, R_ECX );
1.40 @@ -179,7 +161,34 @@
1.41 POP_r32(R_EBP);
1.42 RET();
1.43
1.44 - sh4_x86_do_backpatch( end_ptr );
1.45 + // Exception already raised - just cleanup
1.46 + uint8_t *preexc_ptr = xlat_output;
1.47 + load_imm32( R_ECX, sh4_x86.block_start_pc );
1.48 + ADD_r32_r32( R_EDX, R_ECX );
1.49 + ADD_r32_r32( R_EDX, R_ECX );
1.50 + store_spreg( R_ECX, REG_OFFSET(spc) );
1.51 + MOV_moff32_EAX( &sh4_cpu_period );
1.52 + MUL_r32( R_EDX );
1.53 + ADD_r32_sh4r( R_EAX, REG_OFFSET(slice_cycle) );
1.54 + load_spreg( R_EAX, REG_OFFSET(pc) );
1.55 + call_func1(xlat_get_code,R_EAX);
1.56 + POP_r32(R_EBP);
1.57 + RET();
1.58 +
1.59 + for( i=0; i< sh4_x86.backpatch_posn; i++ ) {
1.60 + *sh4_x86.backpatch_list[i].fixup_addr =
1.61 + xlat_output - ((uint8_t *)sh4_x86.backpatch_list[i].fixup_addr) - 4;
1.62 + if( sh4_x86.backpatch_list[i].exc_code == -1 ) {
1.63 + load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.64 + int rel = preexc_ptr - xlat_output;
1.65 + JMP_rel(rel);
1.66 + } else {
1.67 + load_imm32( R_EDI, sh4_x86.backpatch_list[i].exc_code );
1.68 + load_imm32( R_EDX, sh4_x86.backpatch_list[i].fixup_icount );
1.69 + int rel = end_ptr - xlat_output;
1.70 + JMP_rel(rel);
1.71 + }
1.72 + }
1.73 }
1.74 }
1.75
.