Commit 99773bd4b4e848955851bec18ae4b7daca8ed306
1 parent
24836689
Fix DEBUG_TB_CHECK build failure (balrog).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1820 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
6 deletions
exec.c
@@ -46,6 +46,11 @@ | @@ -46,6 +46,11 @@ | ||
46 | //#define DEBUG_TB_CHECK | 46 | //#define DEBUG_TB_CHECK |
47 | //#define DEBUG_TLB_CHECK | 47 | //#define DEBUG_TLB_CHECK |
48 | 48 | ||
49 | +#if !defined(CONFIG_USER_ONLY) | ||
50 | +/* TB consistency checks only implemented for usermode emulation. */ | ||
51 | +#undef DEBUG_TB_CHECK | ||
52 | +#endif | ||
53 | + | ||
49 | /* threshold to flush the translated code buffer */ | 54 | /* threshold to flush the translated code buffer */ |
50 | #define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - CODE_GEN_MAX_SIZE) | 55 | #define CODE_GEN_BUFFER_MAX_SIZE (CODE_GEN_BUFFER_SIZE - CODE_GEN_MAX_SIZE) |
51 | 56 | ||
@@ -330,12 +335,12 @@ static void tb_invalidate_check(unsigned long address) | @@ -330,12 +335,12 @@ static void tb_invalidate_check(unsigned long address) | ||
330 | TranslationBlock *tb; | 335 | TranslationBlock *tb; |
331 | int i; | 336 | int i; |
332 | address &= TARGET_PAGE_MASK; | 337 | address &= TARGET_PAGE_MASK; |
333 | - for(i = 0;i < CODE_GEN_HASH_SIZE; i++) { | ||
334 | - for(tb = tb_hash[i]; tb != NULL; tb = tb->hash_next) { | 338 | + for(i = 0;i < CODE_GEN_PHYS_HASH_SIZE; i++) { |
339 | + for(tb = tb_phys_hash[i]; tb != NULL; tb = tb->phys_hash_next) { | ||
335 | if (!(address + TARGET_PAGE_SIZE <= tb->pc || | 340 | if (!(address + TARGET_PAGE_SIZE <= tb->pc || |
336 | address >= tb->pc + tb->size)) { | 341 | address >= tb->pc + tb->size)) { |
337 | printf("ERROR invalidate: address=%08lx PC=%08lx size=%04x\n", | 342 | printf("ERROR invalidate: address=%08lx PC=%08lx size=%04x\n", |
338 | - address, tb->pc, tb->size); | 343 | + address, (long)tb->pc, tb->size); |
339 | } | 344 | } |
340 | } | 345 | } |
341 | } | 346 | } |
@@ -347,13 +352,13 @@ static void tb_page_check(void) | @@ -347,13 +352,13 @@ static void tb_page_check(void) | ||
347 | TranslationBlock *tb; | 352 | TranslationBlock *tb; |
348 | int i, flags1, flags2; | 353 | int i, flags1, flags2; |
349 | 354 | ||
350 | - for(i = 0;i < CODE_GEN_HASH_SIZE; i++) { | ||
351 | - for(tb = tb_hash[i]; tb != NULL; tb = tb->hash_next) { | 355 | + for(i = 0;i < CODE_GEN_PHYS_HASH_SIZE; i++) { |
356 | + for(tb = tb_phys_hash[i]; tb != NULL; tb = tb->phys_hash_next) { | ||
352 | flags1 = page_get_flags(tb->pc); | 357 | flags1 = page_get_flags(tb->pc); |
353 | flags2 = page_get_flags(tb->pc + tb->size - 1); | 358 | flags2 = page_get_flags(tb->pc + tb->size - 1); |
354 | if ((flags1 & PAGE_WRITE) || (flags2 & PAGE_WRITE)) { | 359 | if ((flags1 & PAGE_WRITE) || (flags2 & PAGE_WRITE)) { |
355 | printf("ERROR page flags: PC=%08lx size=%04x f1=%x f2=%x\n", | 360 | printf("ERROR page flags: PC=%08lx size=%04x f1=%x f2=%x\n", |
356 | - tb->pc, tb->size, flags1, flags2); | 361 | + (long)tb->pc, tb->size, flags1, flags2); |
357 | } | 362 | } |
358 | } | 363 | } |
359 | } | 364 | } |