fix DEBUG_TB_CHECK in exec.c
PATCH 1/1 fix DEBUG_TB_CHECK in exec.c
With DEBUG_TB_CHECK enabled, exec.c fails to build. This patch corrects the compilation errors.
Regards,
Andrew
--
balrog 2oo6
Dear Outlook users: Please remove me from your address books
http://www.newsforge.com/article.pl?sid=03/08/21/143258
exec.c +11 -9
@@ -40,8 +40,8 @@//#define DEBUG_TLB /* make various TB consistency checks */ -//#define DEBUG_TB_CHECK -//#define DEBUG_TLB_CHECK +//#define DEBUG_TB_CHECK +//#define DEBUG_TLB_CHECK /* threshold to flush the translated code buffer */ #define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - CODE_GEN_MAX_SIZE)
@@ -319,16 +319,17 @@ void tb_flush(CPUState *env1) #ifdef DEBUG_TB_CHECK +#ifndef CONFIG_SOFTMMU static void tb_invalidate_check(unsigned long address) { TranslationBlock *tb; int i; address &= TARGET_PAGE_MASK; -for (i =0 ;i <CODE_GEN_HASH_SIZE ; i++) { -for (tb = tb_hash[i]; tb !=NULL ; tb = tb->hash_next) { + for(i = 0;i < CODE_GEN_PHYS_HASH_SIZE; i++) { + for(tb = tb_phys_hash[i]; tb != NULL; tb = tb->phys_hash_next) { if (!(address + TARGET_PAGE_SIZE <= tb->pc || address >= tb->pc + tb->size)) { -printf ("ERROR invalidate: address=%08lx PC=%08lx size=%04x\n" , + printf("ERROR invalidate: address=%08lx PC=%08x size=%04x\n", address, tb->pc, tb->size); } }
@@ -341,17 +342,18 @@ static void tb_page_check(void)TranslationBlock *tb;int i, flags1, flags2; -for (i =0 ;i <CODE_GEN_HASH_SIZE ; i++) { -for (tb = tb_hash[i]; tb !=NULL ; tb = tb->hash_next) { +for (i =0 ;i <CODE_GEN_PHYS_HASH_SIZE ; i++) { +for (tb = tb_phys_hash[i]; tb !=NULL ; tb = tb->phys_hash_next) { flags1 =page_get_flags (tb->pc); flags2 =page_get_flags (tb->pc + tb->size -1 );if ((flags1 &PAGE_WRITE ) || (flags2 &PAGE_WRITE )) { -printf ("ERROR page flags: PC=%08lx size=%04x f1=%x f2=%x\n" , +printf ("ERROR page flags: PC=%08x size=%04x f1=%x f2=%x\n" , tb->pc, tb->size, flags1, flags2); } } } } +#endif void tb_jmp_check (TranslationBlock *tb) {
@@ -907,7 +909,7 @@ void tb_link_phys(TranslationBlock *tb,if (tb->tb_next_offset[1 ] !=0xffff )tb_reset_jump (tb,1 ); -#ifdef DEBUG_TB_CHECK +#if defined(DEBUG_TB_CHECK ) && !defined(CONFIG_SOFTMMU )tb_page_check ();#endif }