* [Qemu-devel] SPARC ops
@ 2007-02-02 20:26 Ben Taylor
0 siblings, 0 replies; only message in thread
From: Ben Taylor @ 2007-02-02 20:26 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
This patch coded by Martin Bochnig (mb1x@gmx.com) adds
support for a couple of Sparc V9 operations.
[-- Attachment #2: sparc-ops.diff --]
[-- Type: text/x-patch, Size: 1981 bytes --]
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-02 20:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-02 20:26 [Qemu-devel] SPARC ops Ben Taylor
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).