Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 1112:4cac5e474d4c
prev1103:de9ad2c0cf56
next1125:9dd5dee45db9
author nkeynes
date Fri Sep 10 08:50:55 2010 +1000 (13 years ago)
permissions -rw-r--r--
last change Add missing sh4_translate_breakpoint_hit to the symbol table
Change asm() to __asm__() as it's more likely to work
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Sun Feb 21 11:19:59 2010 +1000
1.2 +++ b/src/sh4/sh4trans.c Fri Sep 10 08:50:55 2010 +1000
1.3 @@ -33,7 +33,8 @@
1.4 uint32_t sh4_translate_run_slice( uint32_t nanosecs )
1.5 {
1.6 void * (*code)() = NULL;
1.7 - while( sh4r.slice_cycle < nanosecs ) {
1.8 + event_schedule( EVENT_ENDTIMESLICE, nanosecs );
1.9 + for(;;) {
1.10 if( sh4r.event_pending <= sh4r.slice_cycle ) {
1.11 if( sh4r.event_types & PENDING_EVENT ) {
1.12 event_execute();
1.13 @@ -43,33 +44,23 @@
1.14 sh4_accept_interrupt();
1.15 code = NULL;
1.16 }
1.17 + if( sh4r.slice_cycle >= nanosecs )
1.18 + return nanosecs;
1.19 }
1.20
1.21 - if( code == NULL ) {
1.22 - if( IS_SYSCALL(sh4r.pc) ) {
1.23 - uint32_t pc = sh4r.pc;
1.24 - sh4r.pc = sh4r.pr;
1.25 - sh4r.in_delay_slot = 0;
1.26 - syscall_invoke( pc );
1.27 - }
1.28 + if( IS_SYSCALL(sh4r.pc) ) {
1.29 + uint32_t pc = sh4r.pc;
1.30 + sh4r.pc = sh4r.pr;
1.31 + sh4r.in_delay_slot = 0;
1.32 + syscall_invoke( pc );
1.33 + }
1.34
1.35 - code = xlat_get_code_by_vma( sh4r.pc );
1.36 - if( code == NULL || sh4r.xlat_sh4_mode != XLAT_BLOCK_MODE(code) ) {
1.37 - code = sh4_translate_basic_block( sh4r.pc );
1.38 - }
1.39 - } else if( sh4r.xlat_sh4_mode != XLAT_BLOCK_MODE(code) ) {
1.40 - if( !IS_IN_ICACHE(sh4r.pc) ) {
1.41 - /* If TLB is off, we may have gotten here without updating
1.42 - * the icache, so do it now. This should never fail, so...
1.43 - */
1.44 - mmu_update_icache(sh4r.pc);
1.45 - assert( IS_IN_ICACHE(sh4r.pc) );
1.46 - }
1.47 + code = xlat_get_code_by_vma( sh4r.pc );
1.48 + if( code == NULL || sh4r.xlat_sh4_mode != XLAT_BLOCK_MODE(code) ) {
1.49 code = sh4_translate_basic_block( sh4r.pc );
1.50 }
1.51 - code = code();
1.52 + code();
1.53 }
1.54 - return nanosecs;
1.55 }
1.56
1.57 uint8_t *xlat_output;
.