1.1 --- a/src/sh4/xltcache.c Tue Jul 29 23:25:03 2008 +0000
1.2 +++ b/src/sh4/xltcache.c Sat Aug 09 10:48:03 2008 +0000
1.7 -xlat_recovery_record_t xlat_get_recovery( void *code, void *native_pc, gboolean recover_after )
1.8 +xlat_recovery_record_t xlat_get_post_recovery( void *code, void *native_pc, gboolean with_terminal )
1.10 if( code != NULL ) {
1.11 uintptr_t pc_offset = ((uint8_t *)native_pc) - ((uint8_t *)code);
1.12 @@ -216,28 +216,39 @@
1.13 uint32_t count = block->recover_table_size;
1.14 xlat_recovery_record_t records = (xlat_recovery_record_t)(&block->code[block->recover_table_offset]);
1.16 - if( recover_after ) {
1.17 - if( records[count-1].xlat_offset < pc_offset ) {
1.20 - for( posn=count-1; posn > 0; posn-- ) {
1.21 - if( records[posn-1].xlat_offset < pc_offset ) {
1.22 - return &records[posn];
1.25 - return &records[0]; // shouldn't happen
1.27 - for( posn = 1; posn < count; posn++ ) {
1.28 - if( records[posn].xlat_offset >= pc_offset ) {
1.29 - return &records[posn-1];
1.32 - return &records[count-1];
1.33 + if( count > 0 && !with_terminal )
1.35 + if( records[count-1].xlat_offset < pc_offset ) {
1.38 + for( posn=count-1; posn > 0; posn-- ) {
1.39 + if( records[posn-1].xlat_offset < pc_offset ) {
1.40 + return &records[posn];
1.43 + return &records[0]; // shouldn't happen
1.48 +xlat_recovery_record_t xlat_get_pre_recovery( void *code, void *native_pc )
1.50 + if( code != NULL ) {
1.51 + uintptr_t pc_offset = ((uint8_t *)native_pc) - ((uint8_t *)code);
1.52 + xlat_cache_block_t block = BLOCK_FOR_CODE(code);
1.53 + uint32_t count = block->recover_table_size;
1.54 + xlat_recovery_record_t records = (xlat_recovery_record_t)(&block->code[block->recover_table_offset]);
1.56 + for( posn = 1; posn < count; posn++ ) {
1.57 + if( records[posn].xlat_offset >= pc_offset ) {
1.58 + return &records[posn-1];
1.61 + return &records[count-1];
1.66 void **xlat_get_lut_entry( sh4addr_t address )
1.68 void **page = xlat_lut[XLAT_LUT_PAGE(address)];