All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Taylor <sol10x86@cox.net>
To: Qemu-devel@nongnu.org
Subject: [Qemu-devel] Patch: sparc arm/mips/sparc register patch
Date: Wed, 31 Jan 2007 13:00:18 -0500	[thread overview]
Message-ID: <8469713.1170266418239.JavaMail.root@eastrmwml07.mgt.cox.net> (raw)

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


This patch was created by Martin Bochnig (mb1x@gmx.com)
and is for qemu compiling on sparc to work on arm, mips,
and sparc binaries, dealing with the sparc register allocation
issues.




[-- Attachment #2: mips-arms-sparc.patch --]
[-- Type: text/x-patch, Size: 2719 bytes --]

diff -ruN qemu-ORIG/target-arm/exec.h qemu/target-arm/exec.h
--- qemu-ORIG/target-arm/exec.h	2005-11-26 05:38:39.000000000 -0500
+++ qemu/target-arm/exec.h	2007-01-20 02:36:04.000000000 -0500
@@ -19,10 +19,17 @@
  */
 #include "dyngen-exec.h"
 
+#if defined(__sparc__)
+struct CPUARMState *env;
+uint32_t T0;
+uint32_t T1;
+uint32_t T2;
+#else
 register struct CPUARMState *env asm(AREG0);
 register uint32_t T0 asm(AREG1);
 register uint32_t T1 asm(AREG2);
 register uint32_t T2 asm(AREG3);
+#endif
 
 /* TODO: Put these in FP regs on targets that have such things.  */
 /* It is ok for FT0s and FT0d to overlap.  Likewise FT1s and FT1d.  */
diff -ruN qemu-ORIG/target-mips/exec.h qemu/target-mips/exec.h
--- qemu-ORIG/target-mips/exec.h	2007-01-23 20:47:51.000000000 -0500
+++ qemu/target-mips/exec.h	2007-01-30 16:27:20.000000000 -0500
@@ -7,7 +7,11 @@
 #include "mips-defs.h"
 #include "dyngen-exec.h"
 
+#if defined(__sparc__)
+struct CPUMIPSState *env;
+#else
 register struct CPUMIPSState *env asm(AREG0);
+#endif
 
 #if defined (USE_64BITS_REGS)
 typedef int64_t host_int_t;
@@ -17,6 +21,11 @@
 typedef uint32_t host_uint_t;
 #endif
 
+#if defined(__sparc__)
+host_uint_t T0;
+host_uint_t T1;
+host_uint_t T2;
+#else
 #if TARGET_LONG_BITS > HOST_LONG_BITS
 #define T0 (env->t0)
 #define T1 (env->t1)
@@ -26,6 +35,7 @@
 register host_uint_t T1 asm(AREG2);
 register host_uint_t T2 asm(AREG3);
 #endif
+#endif
 
 #if defined (USE_HOST_FLOAT_REGS)
 #error "implement me."
diff -ruN qemu-ORIG/target-sparc/exec.h qemu/target-sparc/exec.h
--- qemu-ORIG/target-sparc/exec.h	2005-10-30 13:16:26.000000000 -0500
+++ qemu/target-sparc/exec.h	2007-01-20 02:36:04.000000000 -0500
@@ -3,23 +3,41 @@
 #include "dyngen-exec.h"
 #include "config.h"
 
+#if defined(__sparc__)
+struct CPUSPARCState *env;
+#else
 register struct CPUSPARCState *env asm(AREG0);
+#endif
+
 #ifdef TARGET_SPARC64
 #define T0 (env->t0)
 #define T1 (env->t1)
 #define T2 (env->t2)
 #define REGWPTR env->regwptr
 #else
+#if defined(__sparc__)
+register uint32_t T0 asm(AREG3);
+register uint32_t T1 asm(AREG2);
+#else
 register uint32_t T0 asm(AREG1);
 register uint32_t T1 asm(AREG2);
+#endif
 
 #undef REG_REGWPTR // Broken
 #ifdef REG_REGWPTR
+#if defined(__sparc__)
+register uint32_t *REGWPTR asm(AREG4);
+#else
 register uint32_t *REGWPTR asm(AREG3);
+#endif
 #define reg_REGWPTR
 
 #ifdef AREG4
+#if defined(__sparc__)
+register uint32_t T2 asm(AREG0);
+#else
 register uint32_t T2 asm(AREG4);
+#endif
 #define reg_T2
 #else
 #define T2 (env->t2)
@@ -27,7 +45,11 @@
 
 #else
 #define REGWPTR env->regwptr
+#if defined(__sparc__)
+register uint32_t T2 asm(AREG0);
+#else
 register uint32_t T2 asm(AREG3);
+#endif
 #define reg_T2
 #endif
 #endif

             reply	other threads:[~2007-01-31 18:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 18:00 Ben Taylor [this message]
2007-01-31 22:16 ` [Qemu-devel] Patch: sparc arm/mips/sparc register patch Martin Bochnig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8469713.1170266418239.JavaMail.root@eastrmwml07.mgt.cox.net \
    --to=sol10x86@cox.net \
    --cc=Qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.