Skip to contentSkip to conversation

win32 patch for test-i386

Qemu-devel [email protected] 1 participant 1 message Dec 15, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

a while back I compiled the test-i386 with MinGW and GCC 3.4.5. I attached the .diff for it. Note, that the test will crash with optimizations, so you have to remove the -O2 from the Makefile. Also the TEST_CMOV and TEST_FCOMI will work on non-x86-64 machines.

So long
Oliver

test-i386.c renamed from test-i386.c.bak +13 -9
@@ -1333,18 +1333,18 @@
 #endif
 
 #if defined(__x86_64__)
-asm(".globl func_lret\n"
-    "func_lret:\n"
+asm(".globl _func_lret\n"
+    "_func_lret:\n"
     "movl $0x87654641, %eax\n"
     "lretq\n");
 #else
-asm(".globl func_lret\n"
-    "func_lret:\n"
+asm(".globl _func_lret\n"
+	"_func_lret:\n"
     "movl $0x87654321, %eax\n"
     "lret\n"
 
-    ".globl func_iret\n"
-    "func_iret:\n"
+    ".globl _func_iret\n"
+    "_func_iret:\n"
     "movl $0xabcd4321, %eax\n"
     "iret\n");
 #endif
@@ -1643,6 +1643,7 @@
 int v1;
 int tab[2];
 
+#if 0
 void sig_handler(int sig, siginfo_t *info, void *puc)
 {
     struct ucontext *uc = puc;
@@ -1832,8 +1833,10 @@
     }
     printf("val=0x%x\n", val);
 }
+#endif
 
 #if !defined(__x86_64__)
+#if 0
 /* specific precise single step test */
 void sig_trap_handler(int sig, siginfo_t *info, void *puc)
 {
@@ -1917,6 +1920,7 @@
     for(i = 0; i < 4; i++)
         printf("sstep_buf2[%d] = %d\n", i, sstep_buf2[i]);
 }
+#endif
 
 /* self modifying code test */
 uint8_t code[] = {
@@ -1924,7 +1928,7 @@
     0xc3, /* ret */
 };
 
-asm("smc_code2:\n"
+asm("_smc_code2:\n"
     "movl 4(%esp), %eax\n"
     "movl %eax, smc_patch_addr2 + 1\n"
     "nop\n"
@@ -2615,10 +2619,10 @@
 #ifdef TEST_VM86
     test_vm86();
 #endif
-    test_exceptions();
+    //test_exceptions();
 #if !defined(__x86_64__)
     test_self_modifying_code();
-    test_single_step();
+    //test_single_step();
 #endif
     test_enter();
 #ifdef TEST_SSE