summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-03-14 14:59:36 +0000
committerrillig <rillig@pkgsrc.org>2005-03-14 14:59:36 +0000
commit6818fcbf47a5221ece3aafd296eded4c18fad8bb (patch)
treec93b1be9b30f740e57cd7d695477188834c26fb7 /emulators
parent1129b51ea63fa872a1f3248df4949dab0c5fc4f5 (diff)
downloadpkgsrc-6818fcbf47a5221ece3aafd296eded4c18fad8bb.tar.gz
Added a patch that uses the <stddef.h> offsetof macro for constant
expressions. Approved by wiz.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/mips64emul/distinfo3
-rw-r--r--emulators/mips64emul/patches/patch-aa54
2 files changed, 56 insertions, 1 deletions
diff --git a/emulators/mips64emul/distinfo b/emulators/mips64emul/distinfo
index 1e4877e5d00..e1a31003104 100644
--- a/emulators/mips64emul/distinfo
+++ b/emulators/mips64emul/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.11 2005/02/23 18:49:19 agc Exp $
+$NetBSD: distinfo,v 1.12 2005/03/14 14:59:36 rillig Exp $
SHA1 (mips64emul-0.3.tar.gz) = fc47ce112938436ed1d659af94e1939175205bf7
RMD160 (mips64emul-0.3.tar.gz) = 6b937898aefc12ae1f373b0e69ea843ff1ec207d
Size (mips64emul-0.3.tar.gz) = 944679 bytes
+SHA1 (patch-aa) = 06369c25558662c7dbf11b20993521d8fe79f8aa
diff --git a/emulators/mips64emul/patches/patch-aa b/emulators/mips64emul/patches/patch-aa
new file mode 100644
index 00000000000..eb92f8e46d4
--- /dev/null
+++ b/emulators/mips64emul/patches/patch-aa
@@ -0,0 +1,54 @@
+$NetBSD: patch-aa,v 1.1 2005/03/14 14:59:36 rillig Exp $
+
+The author didn't know the offsetof macro.
+
+--- src/bintrans_i386.c.orig Wed Feb 2 21:12:45 2005
++++ src/bintrans_i386.c Sat Mar 12 02:17:23 2005
+@@ -37,6 +37,7 @@
+ * ebp contains cpu->bintrans_instructions_executed
+ */
+
++#include <stddef.h>
+
+ struct cpu dummy_cpu;
+ struct mips_coproc dummy_coproc;
+@@ -55,9 +56,9 @@ static void bintrans_host_cacheinvalidat
+ }
+
+
+-#define ofs_i (((size_t)&dummy_cpu.cd.mips.bintrans_instructions_executed) - ((size_t)&dummy_cpu))
+-#define ofs_pc (((size_t)&dummy_cpu.cd.mips.pc) - ((size_t)&dummy_cpu))
+-#define ofs_pc_last (((size_t)&dummy_cpu.cd.mips.pc_last) - ((size_t)&dummy_cpu))
++#define ofs_i (offsetof(struct cpu, cd.mips.bintrans_instructions_executed))
++#define ofs_pc (offsetof(struct cpu, cd.mips.pc))
++#define ofs_pc_last (offsetof(struct cpu, cd.mips.pc_last))
+
+
+ unsigned char bintrans_i386_runchunk[41] = {
+@@ -120,7 +121,7 @@ static unsigned char bintrans_i386_jump_
+ *
+ * 8b 8e 34 12 00 00 mov 0x1234(%esi),%ecx
+ */
+-#define ofs_tabl0 (((size_t)&dummy_cpu.cd.mips.vaddr_to_hostaddr_table0) - ((size_t)&dummy_cpu))
++#define ofs_tabl0 (offsetof(struct cpu, cd.mips.vaddr_to_hostaddr_table0))
+ 0x8b, 0x8e,
+ ofs_tabl0 & 255, (ofs_tabl0 >> 8) & 255, (ofs_tabl0 >> 16) & 255, (ofs_tabl0 >> 24) & 255,
+
+@@ -147,7 +148,7 @@ static unsigned char bintrans_i386_jump_
+ *
+ * 8b 8c 19 56 34 12 00 mov 0x123456(%ecx,%ebx,1),%ecx
+ */
+-#define ofs_chunks ((size_t)&dummy_vth32_table.bintrans_chunks[0] - (size_t)&dummy_vth32_table)
++#define ofs_chunks (offsetof(struct vth32_table, bintrans_chunks[0]))
+ 0x8b, 0x8c, 0x19,
+ ofs_chunks & 255, (ofs_chunks >> 8) & 255, (ofs_chunks >> 16) & 255, (ofs_chunks >> 24) & 255,
+
+@@ -182,7 +183,7 @@ static unsigned char bintrans_i386_jump_
+
+ /* 03 86 78 56 34 12 add 0x12345678(%esi),%eax */
+ /* ff e0 jmp *%eax */
+-#define ofs_chunkbase ((size_t)&dummy_cpu.cd.mips.chunk_base_address - (size_t)&dummy_cpu)
++#define ofs_chunkbase (offsetof(struct cpu, cd.mips.chunk_base_address))
+ 0x03, 0x86,
+ ofs_chunkbase & 255, (ofs_chunkbase >> 8) & 255, (ofs_chunkbase >> 16) & 255, (ofs_chunkbase >> 24) & 255,
+ 0xff, 0xe0