summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfredette <fredette@NetBSD.org>2001-11-26 18:15:16 +0000
committerfredette <fredette@NetBSD.org>2001-11-26 18:15:16 +0000
commit7eac246b749f488b191120f5c19c581f6d4db385 (patch)
tree815b63099477bb7a844f83d602b10983744f3b53
parent8ec81cf263bfd8015e12a8ba388421212bd2ed14 (diff)
Added support for running 68010 SunOS executables.
-rw-r--r--sys/compat/sunos/sunos_exec.h9
-rw-r--r--sys/compat/sunos/sunos_exec_aout.c10
2 files changed, 11 insertions, 8 deletions
diff --git a/sys/compat/sunos/sunos_exec.h b/sys/compat/sunos/sunos_exec.h
index b9313cf75b1..4d9cbdacb91 100644
--- a/sys/compat/sunos/sunos_exec.h
+++ b/sys/compat/sunos/sunos_exec.h
@@ -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 @@ struct sunos_exec {
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 --git a/sys/compat/sunos/sunos_exec_aout.c b/sys/compat/sunos/sunos_exec_aout.c
index 5c396dc9565..286635200e7 100644
--- a/sys/compat/sunos/sunos_exec_aout.c
+++ b/sys/compat/sunos/sunos_exec_aout.c
@@ -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 @@ exec_sunos_aout_makecmds(p, epp)
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 @@ exec_sunos_aout_makecmds(p, epp)
}
/*
- * 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))))