Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/sunos Added support for running 68010 SunOS execu...



details:   https://anonhg.NetBSD.org/src/rev/259554698d34
branches:  trunk
changeset: 518224:259554698d34
user:      fredette <fredette%NetBSD.org@localhost>
date:      Mon Nov 26 18:15:16 2001 +0000

description:
Added support for running 68010 SunOS executables.

diffstat:

 sys/compat/sunos/sunos_exec.h      |   9 ++++++---
 sys/compat/sunos/sunos_exec_aout.c |  10 +++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

diffs (71 lines):

diff -r b00e652f0cbf -r 259554698d34 sys/compat/sunos/sunos_exec.h
--- a/sys/compat/sunos/sunos_exec.h     Mon Nov 26 18:09:08 2001 +0000
+++ b/sys/compat/sunos/sunos_exec.h     Mon Nov 26 18:15:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_exec.h,v 1.3 2000/11/24 10:21:30 scw Exp $       */
+/*     $NetBSD: sunos_exec.h,v 1.4 2001/11/26 18:15:16 fredette Exp $  */
 
 /*
  * Copyright (c) 1993 Theo de Raadt
@@ -36,13 +36,16 @@
        u_char  a_machtype;     /* machine type */
        u_short a_magic;        /* magic number */
 };
+#define SUNOS_M_68010  1       /* runs on 68010 and 68020 */
 #define SUNOS_M_68020  2       /* runs only on 68020 */
 #define        SUNOS_M_SPARC   3       /* runs only on SPARC */
 
 #ifdef __sparc__
-#define SUNOS_M_NATIVE SUNOS_M_SPARC
+#define SUNOS_M_NATIVE(m)      ((m) == SUNOS_M_SPARC)
+#elif defined(__mc68010__)
+#define SUNOS_M_NATIVE(m)      ((m) == SUNOS_M_68010)
 #else
-#define SUNOS_M_NATIVE SUNOS_M_68020
+#define SUNOS_M_NATIVE(m)      ((m) == SUNOS_M_68010 || (m) == SUNOS_M_68020)
 #endif
 
 #define SUNOS_AOUT_HDR_SIZE (sizeof(struct exec))
diff -r b00e652f0cbf -r 259554698d34 sys/compat/sunos/sunos_exec_aout.c
--- a/sys/compat/sunos/sunos_exec_aout.c        Mon Nov 26 18:09:08 2001 +0000
+++ b/sys/compat/sunos/sunos_exec_aout.c        Mon Nov 26 18:15:16 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_exec_aout.c,v 1.3 2001/11/13 02:09:18 lukem Exp $        */
+/*     $NetBSD: sunos_exec_aout.c,v 1.4 2001/11/26 18:15:16 fredette Exp $     */
 
 /*
  * Copyright (c) 1993 Theo de Raadt
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_exec_aout.c,v 1.3 2001/11/13 02:09:18 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_exec_aout.c,v 1.4 2001/11/26 18:15:16 fredette Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -72,7 +72,7 @@
        struct sunos_exec *sunmag = epp->ep_hdr;
        int error = ENOEXEC;
 
-       if(sunmag->a_machtype != SUNOS_M_NATIVE)
+       if (!SUNOS_M_NATIVE(sunmag->a_machtype))
                return (ENOEXEC);
 
        switch (sunmag->a_magic) {
@@ -90,13 +90,13 @@
 }
 
 /*
- * the code below is only needed for sun3 emulation.
+ * the code below is only needed for sun2/sun3 emulation.
  */
 #ifndef __sparc__
 
 /* suns keep data seg aligned to SEGSIZ because of sun custom mmu */
 #define SEGSIZ         0x20000
-#define SUNOS_N_TXTADDR(x,m)   __LDPGSZ
+#define SUNOS_N_TXTADDR(x,m)   0x2000
 #define SUNOS_N_DATADDR(x,m)   (((m)==OMAGIC) ? \
        (SUNOS_N_TXTADDR(x,m) + (x).a_text) : \
        (SEGSIZ + ((SUNOS_N_TXTADDR(x,m) + (x).a_text - 1) & ~(SEGSIZ-1))))



Home | Main Index | Thread Index | Old Index