Added support for running 68010 SunOS executables.

This commit is contained in:
fredette 2001-11-26 18:15:16 +00:00
parent 8ec81cf263
commit 7eac246b74
2 changed files with 11 additions and 8 deletions

View File

@ -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))

View File

@ -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))))