qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sparc32/sparc64 patch
@ 2006-03-03 17:24 Jose Renau
  0 siblings, 0 replies; only message in thread
From: Jose Renau @ 2006-03-03 17:24 UTC (permalink / raw)
  To: qemu-devel

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


  Without this patch I could not compile qemu for sparc64 on OS X (PPC).


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

Index: dyngen-exec.h
===================================================================
RCS file: /sources/qemu/qemu/dyngen-exec.h,v
retrieving revision 1.26
diff -b -B -d -U5 -r1.26 dyngen-exec.h
--- dyngen-exec.h	24 Jul 2005 15:11:38 -0000	1.26
+++ dyngen-exec.h	3 Mar 2006 17:05:22 -0000
@@ -33,18 +33,20 @@
 typedef unsigned long uint64_t;
 #else
 typedef unsigned long long uint64_t;
 #endif
 
+#ifdef HOST_PPC
 typedef signed char int8_t;
 typedef signed short int16_t;
 typedef signed int int32_t;
 #if defined (__x86_64__) || defined(__ia64)
 typedef signed long int64_t;
 #else
 typedef signed long long int64_t;
 #endif
+#endif
 
 #define INT8_MIN		(-128)
 #define INT16_MIN		(-32767-1)
 #define INT32_MIN		(-2147483647-1)
 #define INT64_MIN		(-(int64_t)(9223372036854775807)-1)
Index: dyngen.c
===================================================================
RCS file: /sources/qemu/qemu/dyngen.c,v
retrieving revision 1.41
diff -b -B -d -U5 -r1.41 dyngen.c
--- dyngen.c	4 Feb 2006 20:47:57 -0000	1.41
+++ dyngen.c	3 Mar 2006 17:05:26 -0000
@@ -1192,17 +1192,17 @@
     if (strstart(sym_name, "__op_param", &p)) {
         snprintf(name, name_size, "param%s", p);
     } else if (strstart(sym_name, "__op_gen_label", &p)) {
         snprintf(name, name_size, "gen_labels[param%s]", p);
     } else {
-#ifdef HOST_SPARC
+//#ifdef HOST_SPARC
         if (sym_name[0] == '.')
-            snprintf(name, sizeof(name),
+            snprintf(name, name_size,
                      "(long)(&__dot_%s)",
                      sym_name + 1);
         else
-#endif
+//#endif
             snprintf(name, name_size, "(long)(&%s)", sym_name);
     }
 }
 
 #ifdef HOST_IA64
@@ -1588,18 +1588,18 @@
                     continue;
                 if (*sym_name && 
                     !strstart(sym_name, "__op_param", NULL) &&
                     !strstart(sym_name, "__op_jmp", NULL) &&
                     !strstart(sym_name, "__op_gen_label", NULL)) {
-#if defined(HOST_SPARC)
+//#if defined(HOST_SPARC)
 		    if (sym_name[0] == '.') {
 			fprintf(outfile,
 				"extern char __dot_%s __asm__(\"%s\");\n",
 				sym_name+1, sym_name);
 			continue;
 		    }
-#endif
+//#endif
 #if defined(__APPLE__)
 /* set __attribute((unused)) on darwin because we wan't to avoid warning when we don't use the symbol */
                     fprintf(outfile, "extern char %s __attribute__((unused));\n", sym_name);
 #elif defined(HOST_IA64)
 			if (ELF64_R_TYPE(rel->r_info) != R_IA64_PCREL21B)
Index: target-sparc/op.c
===================================================================
RCS file: /sources/qemu/qemu/target-sparc/op.c,v
retrieving revision 1.18
diff -b -B -d -U5 -r1.18 op.c
--- target-sparc/op.c	30 Oct 2005 17:28:50 -0000	1.18
+++ target-sparc/op.c	3 Mar 2006 17:05:31 -0000
@@ -849,11 +849,11 @@
     T0 = 0; // XXX read cycle counter and bit 31
 }
 
 void OPPROTO op_wrtick(void)
 {
-    // XXX write cycle counter and bit 31
+    T0 = 0; // XXX write cycle counter and bit 31
 }
 
 void OPPROTO op_rdtpc(void)
 {
     T0 = env->tpc[env->tl];
@@ -1436,10 +1436,11 @@
 
 void OPPROTO op_fitod(void)
 {
     DT0 = (double) *((int32_t *)&FT1);
 }
+#endif
 
 #ifdef TARGET_SPARC64
 void OPPROTO op_fxtos(void)
 {
     FT0 = (float) *((int64_t *)&DT1);
@@ -1448,11 +1449,10 @@
 void OPPROTO op_fxtod(void)
 {
     DT0 = (double) *((int64_t *)&DT1);
 }
 #endif
-#endif
 
 void OPPROTO op_fdtos(void)
 {
     FT0 = (float) DT1;
 }
@@ -1543,12 +1543,11 @@
     do_retry();
 }
 
 void OPPROTO op_sir(void)
 {
-    // XXX
-
+   T0 = 0;  // XXX
 }
 
 void OPPROTO op_ld_asi_reg()
 {
     T0 += PARAM1;

[-- Attachment #3: Type: text/plain, Size: 82 bytes --]



---
Never take life seriously. Nobody gets out alive, anyway.
  - Bumper Sticker

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

only message in thread, other threads:[~2006-03-04  4:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-03 17:24 [Qemu-devel] sparc32/sparc64 patch Jose Renau

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).