Search
lxdream.org :: lxdream/src/sh4/ia32abi.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/ia32abi.h
changeset 956:4c1ed9e03985
prev953:f4a156508ad1
next968:6fb1481859a4
author nkeynes
date Wed Jan 14 00:09:44 2009 +0000 (11 years ago)
permissions -rw-r--r--
last change Exit immediately on an unconditional exception - makes those blocks a little simpler and shorter
file annotate diff log raw
1.1 --- a/src/sh4/ia32abi.h Tue Jan 13 11:56:28 2009 +0000
1.2 +++ b/src/sh4/ia32abi.h Wed Jan 14 00:09:44 2009 +0000
1.3 @@ -266,6 +266,28 @@
1.4 }
1.5
1.6 /**
1.7 + * Exit unconditionally with a general exception
1.8 + */
1.9 +void exit_block_exc( int code, sh4addr_t pc )
1.10 +{
1.11 + load_imm32( R_ECX, pc - sh4_x86.block_start_pc ); // 5
1.12 + ADD_r32_sh4r( R_ECX, R_PC );
1.13 + load_imm32( R_ECX, ((pc - sh4_x86.block_start_pc)>>1)*sh4_cpu_period ); // 5
1.14 + ADD_r32_sh4r( R_ECX, REG_OFFSET(slice_cycle) ); // 6
1.15 + load_imm32( R_EAX, code );
1.16 + call_func1( sh4_raise_exception, R_EAX );
1.17 +
1.18 + load_spreg( R_EAX, R_PC );
1.19 + if( sh4_x86.tlb_on ) {
1.20 + call_func1(xlat_get_code_by_vma,R_EAX);
1.21 + } else {
1.22 + call_func1(xlat_get_code,R_EAX);
1.23 + }
1.24 +
1.25 + exit_block();
1.26 +}
1.27 +
1.28 +/**
1.29 * Write the block trailer (exception handling block)
1.30 */
1.31 void sh4_translate_end_block( sh4addr_t pc ) {
.