Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HD4zL-0000Bn-FE for qemu-devel@nongnu.org; Fri, 02 Feb 2007 15:26:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HD4zK-000088-2A for qemu-devel@nongnu.org; Fri, 02 Feb 2007 15:26:27 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HD4zJ-00007f-Ou for qemu-devel@nongnu.org; Fri, 02 Feb 2007 15:26:25 -0500 Received: from eastrmmtao01.cox.net ([68.230.240.38]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HD4zJ-0005cR-8V for qemu-devel@nongnu.org; Fri, 02 Feb 2007 15:26:25 -0500 Received: from eastrmimpo02.cox.net ([68.1.16.120]) by eastrmmtao01.cox.net (InterMail vM.6.01.06.03 201-2131-130-104-20060516) with ESMTP id <20070202202624.KLSG23750.eastrmmtao01.cox.net@eastrmimpo02.cox.net> for ; Fri, 2 Feb 2007 15:26:24 -0500 Message-ID: <1900000.1170447984838.JavaMail.root@eastrmwml07.mgt.cox.net> Date: Fri, 2 Feb 2007 15:26:24 -0500 From: Ben Taylor MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_17652_637953.1170447984431" Subject: [Qemu-devel] SPARC ops Reply-To: sol10x86@cox.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_17652_637953.1170447984431 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit This patch coded by Martin Bochnig (mb1x@gmx.com) adds support for a couple of Sparc V9 operations. ------=_Part_17652_637953.1170447984431 Content-Type: text/x-patch; name=sparc-ops.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=sparc-ops.diff diff -ruN qemu-ORIG/dyngen.c qemu/dyngen.c --- qemu-ORIG/dyngen.c 2006-12-21 11:49:27.000000000 -0500 +++ qemu/dyngen.c 2007-02-02 15:06:56.019613000 -0500 @@ -2349,6 +2349,33 @@ reloc_offset, reloc_offset, name, addend, reloc_offset); break; + case R_SPARC_HH22: + fprintf(outfile, + " *(uint32_t *)(gen_code_ptr + %d) = " + "((*(uint32_t *)(gen_code_ptr + %d)) " + " & ~0x00000000) " + " | (((%s + %d) >> 42) & 0x00000000);\n", + reloc_offset, reloc_offset, name, addend); + break; + + case R_SPARC_LM22: + fprintf(outfile, + " *(uint32_t *)(gen_code_ptr + %d) = " + "((*(uint32_t *)(gen_code_ptr + %d)) " + " & ~0x00000000) " + " | (((%s + %d) >> 10) & 0x00000000);\n", + reloc_offset, reloc_offset, name, addend); + break; + + case R_SPARC_HM10: + fprintf(outfile, + " *(uint32_t *)(gen_code_ptr + %d) = " + "((*(uint32_t *)(gen_code_ptr + %d)) " + " & ~0x00000000) " + " | ((((%s + %d) >> 32 & 0x3ff)) & 0x00000000);\n", + reloc_offset, reloc_offset, name, addend); + break; + default: error("unsupported sparc64 relocation (%d) for symbol %s", type, name); } diff -ruN qemu-ORIG/elf.h qemu/elf.h --- qemu-ORIG/elf.h 2006-07-30 15:16:29.000000000 -0400 +++ qemu/elf.h 2007-02-02 15:06:56.085548000 -0500 @@ -328,6 +328,9 @@ #define R_SPARC_11 31 #define R_SPARC_64 32 #define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 #define R_SPARC_WDISP16 40 #define R_SPARC_WDISP19 41 #define R_SPARC_7 43 ------=_Part_17652_637953.1170447984431--