pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/mips64emul Added a patch that uses the <stdd...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9476ba5bcc79
branches:  trunk
changeset: 490523:9476ba5bcc79
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Mar 14 14:59:36 2005 +0000

description:
Added a patch that uses the <stddef.h> offsetof macro for constant
expressions. Approved by wiz.

diffstat:

 emulators/mips64emul/distinfo         |   3 +-
 emulators/mips64emul/patches/patch-aa |  54 +++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 1 deletions(-)

diffs (69 lines):

diff -r 679c20393f6f -r 9476ba5bcc79 emulators/mips64emul/distinfo
--- a/emulators/mips64emul/distinfo     Mon Mar 14 14:57:30 2005 +0000
+++ b/emulators/mips64emul/distinfo     Mon Mar 14 14:59:36 2005 +0000
@@ -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 -r 679c20393f6f -r 9476ba5bcc79 emulators/mips64emul/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/mips64emul/patches/patch-aa     Mon Mar 14 14:59:36 2005 +0000
@@ -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



Home | Main Index | Thread Index | Old Index