Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k A bit of ELF support. From scw.



details:   https://anonhg.NetBSD.org/src/rev/5ca4c64b550e
branches:  trunk
changeset: 507456:5ca4c64b550e
user:      minoura <minoura%NetBSD.org@localhost>
date:      Thu Mar 22 12:46:19 2001 +0000

description:
A bit of ELF support.  From scw.

diffstat:

 sys/arch/x68k/conf/files.x68k  |   6 +++++-
 sys/arch/x68k/x68k/kgdb_glue.c |  10 +++++-----
 sys/arch/x68k/x68k/machdep.c   |  11 ++++++++++-
 3 files changed, 20 insertions(+), 7 deletions(-)

diffs (91 lines):

diff -r a3adb91317f4 -r 5ca4c64b550e sys/arch/x68k/conf/files.x68k
--- a/sys/arch/x68k/conf/files.x68k     Thu Mar 22 12:27:59 2001 +0000
+++ b/sys/arch/x68k/conf/files.x68k     Thu Mar 22 12:46:19 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.x68k,v 1.36 2001/01/17 00:07:39 fvdl Exp $
+#      $NetBSD: files.x68k,v 1.37 2001/03/22 12:46:19 minoura Exp $
 #
 # new style config file for x68k architecture
 #
@@ -179,6 +179,10 @@
 # RAIDframe
 major  {raid = 16}
 
+# NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
+include "compat/aoutm68k/files.aoutm68k"
+
+# SunOS Binary Compatibility (COMPAT_SUNOS)
 include        "compat/sunos/files.sunos"
 file   arch/m68k/m68k/sunos_machdep.c  compat_sunos
 
diff -r a3adb91317f4 -r 5ca4c64b550e sys/arch/x68k/x68k/kgdb_glue.c
--- a/sys/arch/x68k/x68k/kgdb_glue.c    Thu Mar 22 12:27:59 2001 +0000
+++ b/sys/arch/x68k/x68k/kgdb_glue.c    Thu Mar 22 12:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kgdb_glue.c,v 1.1 1996/05/05 12:17:25 oki Exp $        */
+/*     $NetBSD: kgdb_glue.c,v 1.2 2001/03/22 12:46:20 minoura Exp $    */
 
 /*
  * Copyright (c) 1991, 1993
@@ -56,7 +56,7 @@
 #include <machine/reg.h>
 
 #ifndef lint
-static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.1 1996/05/05 12:17:25 oki Exp $";
+static char rcsid[] = "$NetBSD: kgdb_glue.c,v 1.2 2001/03/22 12:46:20 minoura Exp $";
 #endif
 
 #define KGDB_STACKSIZE 0x800
@@ -64,8 +64,8 @@
 
 u_long kgdb_stack[KGDB_STACKWORDS];
 
-#define getsp(v) asm("movl sp, %0" : "=r" (v))
-#define setsp(v) asm("movl %0, sp" :: "r" (v))
+#define getsp(v) asm("movl %%sp, %0" : "=r" (v))
+#define setsp(v) asm("movl %0, %%sp" :: "r" (v))
 
 static inline void
 copywords(src, dst, nbytes)
@@ -139,7 +139,7 @@
         * unneeded usp (we trapped from kernel mode) and pad word,
         * and return to the trapped thread.
         */
-       asm("moveml sp@+,#0x7FFF; addql #8,sp; rte");
+       asm("moveml %sp@+,#0x7FFF; addql #8,sp; rte");
 }
 
 int kgdb_testval;
diff -r a3adb91317f4 -r 5ca4c64b550e sys/arch/x68k/x68k/machdep.c
--- a/sys/arch/x68k/x68k/machdep.c      Thu Mar 22 12:27:59 2001 +0000
+++ b/sys/arch/x68k/x68k/machdep.c      Thu Mar 22 12:46:19 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.95 2001/03/15 06:10:53 chs Exp $ */
+/*     $NetBSD: machdep.c,v 1.96 2001/03/22 12:46:20 minoura Exp $     */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -75,6 +75,10 @@
 #include <sys/core.h>
 #include <sys/kcore.h>
 
+#if defined(DDB) && defined(__ELF__)
+#include <sys/exec_elf.h>
+#endif
+
 #include <net/netisr.h>
 #undef PS      /* XXX netccitt/pk.h conflict with machine/reg.h? */
 
@@ -189,7 +193,12 @@
        zs_kgdb_init();                 /* XXX */
 #endif
 #ifdef DDB
+#ifndef __ELF__
        ddb_init(*(int *)&end, ((int *)&end) + 1, esym);
+#else
+       ddb_init((int)esym - (int)&end - sizeof(Elf32_Ehdr),
+                (void *)&end, esym);
+#endif
        if (boothowto & RB_KDB)
                Debugger();
 #endif



Home | Main Index | Thread Index | Old Index