diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2001-08-23 08:47:35 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2001-08-23 08:47:35 +0000 |
commit | 1c11a2950c584ecf9a41484e7242a0cf26aeb03b (patch) | |
tree | a8be5aa13462669fcac228a1f2376deaa547742a /sys/arch/mvme88k | |
parent | 3963f170e3b10d46be5b1bf58019f9e54dda17e5 (diff) |
Provide temporary compatibility with old machine ID binaries for some time.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/include/param.h | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 28 |
2 files changed, 31 insertions, 3 deletions
diff --git a/sys/arch/mvme88k/include/param.h b/sys/arch/mvme88k/include/param.h index 5dac521f562..c100bfcecdc 100644 --- a/sys/arch/mvme88k/include/param.h +++ b/sys/arch/mvme88k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.19 2001/07/06 02:07:42 provos Exp $ */ +/* $OpenBSD: param.h,v 1.20 2001/08/23 08:47:32 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1988 University of Utah. @@ -40,7 +40,7 @@ * from: Utah $Hdr: machparam.h 1.11 89/08/14$ * * @(#)param.h 7.8 (Berkeley) 6/28/91 - * $Id: param.h,v 1.19 2001/07/06 02:07:42 provos Exp $ + * $Id: param.h,v 1.20 2001/08/23 08:47:32 miod Exp $ */ #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ @@ -57,6 +57,8 @@ #define _MACHINE_ARCH m88k #define MACHINE_ARCH "m88k" #define MID_MACHINE MID_M88K +/* Older value for MID_MACHINE */ +#define OLD_MID_MACHINE 151 /* * Round p (pointer or byte index) down to a correctly-aligned value diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 2889635317c..b9693766961 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.50 2001/08/11 23:21:13 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.51 2001/08/23 08:47:34 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -1858,6 +1858,32 @@ cpu_exec_aout_makecmds(p, epp) struct proc *p; struct exec_package *epp; { +#if 1 + /* + * Keep compatibility with older OpenBSD/mvme88k binaries + * for a while, to make transition easier. + */ + u_long midmag, magic; + u_short mid; + int error; + struct exec *execp = epp->ep_hdr; + + midmag = ntohl(execp->a_midmag); + mid = (midmag >> 16) & 0x3ff; + magic = midmag & 0xffff; + + midmag = mid << 16 | magic; + + switch (midmag) { + case (OLD_MID_MACHINE << 16) | ZMAGIC: + return exec_aout_prep_zmagic(p, epp); + case (OLD_MID_MACHINE << 16) | NMAGIC: + return exec_aout_prep_nmagic(p, epp); + case (OLD_MID_MACHINE << 16) | OMAGIC: + return exec_aout_prep_omagic(p, epp); + } +#endif + return ENOEXEC; } |