revision 592:4343cbfdd21b
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 592:4343cbfdd21b |
parent | 591:7b9612fd2395 |
child | 593:6c710c7c6835 |
author | nkeynes |
date | Thu Jan 17 10:17:32 2008 +0000 (16 years ago) |
Change recovery table to offset rather than pointer (so as to survive block moves)
src/sh4/sh4trans.c | view | annotate | diff | log | ||
src/sh4/xltcache.c | view | annotate | diff | log | ||
src/sh4/xltcache.h | view | annotate | diff | log |
1.1 --- a/src/sh4/sh4trans.c Thu Jan 17 10:11:37 2008 +00001.2 +++ b/src/sh4/sh4trans.c Thu Jan 17 10:17:32 2008 +00001.3 @@ -168,7 +168,7 @@1.4 xlat_output = block->code + (xlat_output - oldstart);1.5 }1.6 memcpy( xlat_output, xlat_recovery, recovery_size);1.7 - block->recover_table = (xlat_recovery_record_t)xlat_output;1.8 + block->recover_table_offset = xlat_output - (uint8_t *)block->code;1.9 block->recover_table_size = xlat_recovery_posn;1.10 xlat_commit_block( finalsize, pc-start );1.11 return block->code;
2.1 --- a/src/sh4/xltcache.c Thu Jan 17 10:11:37 2008 +00002.2 +++ b/src/sh4/xltcache.c Thu Jan 17 10:17:32 2008 +00002.3 @@ -213,7 +213,7 @@2.4 if( code != NULL ) {2.5 xlat_cache_block_t block = BLOCK_FOR_CODE(code);2.6 uint32_t count = block->recover_table_size;2.7 - xlat_recovery_record_t records = block->recover_table;2.8 + xlat_recovery_record_t records = (xlat_recovery_record_t)(&block->code[block->recover_table_offset]);2.9 uint32_t posn;2.10 if( recover_after ) {2.11 if( records[count-1].xlat_pc <= (uintptr_t)native_pc ) {2.12 @@ -263,10 +263,10 @@2.13 uint32_t xlat_get_code_size( void *block )2.14 {2.15 xlat_cache_block_t xlt = (xlat_cache_block_t)(((char *)block)-sizeof(struct xlat_cache_block));2.16 - if( xlt->recover_table == NULL ) {2.17 + if( xlt->recover_table_offset == 0 ) {2.18 return xlt->size;2.19 } else {2.20 - return ((uint8_t *)xlt->recover_table) - ((uint8_t *)block);2.21 + return xlt->recover_table_offset;2.22 }2.23 }
3.1 --- a/src/sh4/xltcache.h Thu Jan 17 10:11:37 2008 +00003.2 +++ b/src/sh4/xltcache.h Thu Jan 17 10:17:32 2008 +00003.3 @@ -41,7 +41,7 @@3.4 int active; /* 0 = deleted, 1 = normal. 2 = accessed (temp-space only) */3.5 uint32_t size;3.6 void **lut_entry; /* For deletion */3.7 - xlat_recovery_record_t recover_table;3.8 + uint32_t recover_table_offset; // Offset from code[0] of the recovery table;3.9 uint32_t recover_table_size;3.10 unsigned char code[0];3.11 } __attribute__((packed));
.