qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix DEBUG_TB_CHECK in exec.c
@ 2006-04-07 21:43 andrzej zaborowski
  0 siblings, 0 replies; only message in thread
From: andrzej zaborowski @ 2006-04-07 21:43 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

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

[-- Attachment #2: qemu-exec-cleanups.patch --]
[-- Type: application/octet-stream, Size: 2380 bytes --]

diff -pNaur qemu/exec.c qemu-omap-clean/exec.c
--- qemu/exec.c	2006-02-08 22:43:39.000000000 +0000
+++ qemu-omap-clean/exec.c	2006-04-07 20:56:55.000000000 +0000
@@ -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
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-07 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-07 21:43 [Qemu-devel] [PATCH] fix DEBUG_TB_CHECK in exec.c andrzej zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).