Nuke a.out support for MIPS.

This commit is contained in:
matt 2009-08-12 23:29:18 +00:00
parent 89ec5e3d9c
commit 9b2fb10da6
34 changed files with 34 additions and 218 deletions

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.11 2007/02/09 21:55:00 ad Exp $
# $NetBSD: Makefile,v 1.12 2009/08/12 23:29:18 matt Exp $
INCSDIR=/usr/include/algor
INCS= ansi.h aout_machdep.h asm.h autoconf.h \
bswap.h bsd-aout.h bus.h \
INCS= ansi.h asm.h autoconf.h \
bswap.h bus.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2001/05/28 16:22:17 thorpej Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.1 2001/05/28 16:22:17 thorpej Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,11 +1,11 @@
# $NetBSD: Makefile,v 1.29 2007/02/09 21:55:02 ad Exp $
# $NetBSD: Makefile,v 1.30 2009/08/12 23:29:18 matt Exp $
INCSDIR= /usr/include/arc
# Header files which are needed from userland.
INCS= ansi.h aout_machdep.h asm.h \
bswap.h bsd-aout.h \
INCS= ansi.h asm.h \
bswap.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.5 2000/01/23 21:01:55 soda Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.5 2001/09/04 07:36:11 simonb Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.18 2008/03/22 18:32:20 tsutsui Exp $
# $NetBSD: Makefile,v 1.19 2009/08/12 23:29:18 matt Exp $
INCSDIR= /usr/include/cobalt
INCS= ansi.h aout_machdep.h asm.h autoconf.h \
bsd-aout.h bswap.h \
INCS= ansi.h asm.h autoconf.h \
bswap.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2000/03/19 23:07:45 soren Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.1 2000/03/19 23:07:45 soren Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.11 2007/02/09 21:55:03 ad Exp $
# $NetBSD: Makefile,v 1.12 2009/08/12 23:29:19 matt Exp $
INCSDIR=/usr/include/evbmips
INCS= ansi.h aout_machdep.h asm.h \
INCS= ansi.h asm.h \
bswap.h bus.h \
cdefs.h cpu.h \
disklabel.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2002/03/07 14:43:59 simonb Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.20 2007/02/09 21:55:04 ad Exp $
# $NetBSD: Makefile,v 1.21 2009/08/12 23:29:19 matt Exp $
INCSDIR= /usr/include/hpcmips
INCS= ansi.h aout_machdep.h apmvar.h asm.h autoconf.h \
bootinfo.h bsd-aout.h bswap.h bus.h \
INCS= ansi.h apmvar.h asm.h autoconf.h \
bootinfo.h bswap.h bus.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1.1.1 1999/09/16 12:23:21 takemura Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.1.1.1 1999/09/16 12:23:21 takemura Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,36 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.8 2005/12/11 12:18:09 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)exec.h 8.1 (Berkeley) 6/10/93
*/
#define AOUT_LDPGSZ 4096
#include <machine/reloc.h>

View File

@ -1,35 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.5 2002/11/30 01:52:31 simonb Exp $ */
/* bsd-aout.h
4.4bsd a.out format, for backwards compatibility... */
#ifndef __MIPS_BSD_AOUT_H__
#define __MIPS_BSD_AOUT_H__
#define BSD_OMAGIC 0407 /* old impure format */
#define BSD_NMAGIC 0410 /* read-only text */
#define BSD_ZMAGIC 0413 /* demand load format */
struct bsd_aouthdr {
#if BYTE_ORDER == BIG_ENDIAN
u_short a_mid; /* machine ID */
u_short a_magic; /* magic number */
#else
u_short a_magic; /* magic number */
u_short a_mid; /* machine ID */
#endif
u_long a_text; /* text segment size */
u_long a_data; /* initialized data size */
u_long a_bss; /* uninitialized data size */
u_long a_syms; /* symbol table size */
u_long a_entry; /* entry point */
u_long a_trsize; /* text relocation size */
u_long a_drsize; /* data relocation size */
};
#ifndef _KERNEL
#define _AOUT_INCLUDE_
#include <nlist.h>
#endif /* _KERNEL */
#endif /* __MIPS_BSD_AOUT_H__ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_exec.c,v 1.55 2009/03/29 01:02:49 mrg Exp $ */
/* $NetBSD: cpu_exec.c,v 1.56 2009/08/12 23:29:19 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.55 2009/03/29 01:02:49 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.56 2009/08/12 23:29:19 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_ultrix.h"
@ -55,65 +55,11 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.55 2009/03/29 01:02:49 mrg Exp $");
#include <sys/exec_ecoff.h>
#endif
#include <sys/exec_elf.h> /* mandatory */
#include <mips/bsd-aout.h>
#include <machine/reg.h>
#include <mips/regnum.h> /* symbolic register indices */
int mips_elf_makecmds(struct lwp *, struct exec_package *);
/*
* cpu_exec_aout_makecmds():
* cpu-dependent a.out format hook for execve().
*
* Determine of the given exec package refers to something which we
* understand and, if so, set up the vmcmds for it.
*
*/
int
cpu_exec_aout_makecmds(struct lwp *l, struct exec_package *epp)
{
int error;
/* If COMPAT_09 is defined, allow loading of old-style 4.4bsd a.out
executables. */
struct bsd_aouthdr *hdr = (struct bsd_aouthdr *)epp->ep_hdr;
/* Only handle paged files (laziness). */
if (hdr->a_magic != BSD_ZMAGIC)
{
/* If that failed, try old NetBSD-1.1 elf format */
error = mips_elf_makecmds (l, epp);
return error;
}
error = vn_marktext(epp->ep_vp);
if (error)
return (error);
epp->ep_taddr = 0x1000;
epp->ep_entry = hdr->a_entry;
epp->ep_tsize = hdr->a_text;
epp->ep_daddr = epp->ep_taddr + hdr->a_text;
epp->ep_dsize = hdr->a_data + hdr->a_bss;
/* set up command for text segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, hdr->a_text,
epp->ep_taddr, epp->ep_vp, 0, VM_PROT_READ|VM_PROT_EXECUTE);
/* set up command for data segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, hdr->a_data,
epp->ep_daddr, epp->ep_vp, hdr->a_text,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
/* set up command for bss segment */
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, hdr->a_bss,
epp->ep_daddr + hdr->a_data, NULLVP, 0,
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
return (*epp->ep_esch->es_setup_stack)(l, epp);
}
#ifdef EXEC_ECOFF
void
cpu_exec_ecoff_setregs(struct lwp *l, struct exec_package *epp, u_long stack)

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.18 2007/02/09 21:55:06 ad Exp $
# $NetBSD: Makefile,v 1.19 2009/08/12 23:29:19 matt Exp $
INCSDIR= /usr/include/mipsco
INCS= ansi.h aout_machdep.h asm.h autoconf.h \
bsd-aout.h bswap.h bus.h \
INCS= ansi.h asm.h autoconf.h \
bswap.h bus.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2000/08/12 22:58:05 wdk Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.2 2001/09/04 07:36:11 simonb Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.107 2009/01/24 05:06:06 mrg Exp $
# $NetBSD: GENERIC,v 1.108 2009/08/12 23:29:19 matt Exp $
#
# GENERIC machine description file
#
@ -22,7 +22,7 @@ include "arch/newsmips/conf/std.newsmips"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.107 $"
#ident "GENERIC-$Revision: 1.108 $"
maxusers 16
@ -69,7 +69,6 @@ options COMPAT_30 # NetBSD 3.0 binary compatibility
options COMPAT_40 # NetBSD 4.0 binary compatibility
options COMPAT_50 # NetBSD 5.0 compatibility.
#options TCP_COMPAT_42 # 4.2BSD TCP/IP bug compat. Not recommended.
#options EXEC_AOUT # exec a.out binaries
#options EXEC_ECOFF # exec ecoff binaries
options COMPAT_BSDPTY # /dev/[pt]ty?? ptys.

View File

@ -1,7 +1,7 @@
#
# NEWS3400 config file
#
# $NetBSD: WAPIKO,v 1.38 2007/10/17 19:55:54 garbled Exp $
# $NetBSD: WAPIKO,v 1.39 2009/08/12 23:29:19 matt Exp $
#
include "arch/newsmips/conf/std.newsmips"
@ -38,7 +38,6 @@ options COMPAT_16 # NetBSD 1.6 binary compatibility
options COMPAT_20 # NetBSD 2.0 binary compatibility
options COMPAT_30 # NetBSD 3.0 binary compatibility
options COMPAT_40 # NetBSD 4.0 binary compatibility
#options EXEC_AOUT # exec a.out binaries
#options EXEC_ECOFF # exec ecoff binaries
options COMPAT_BSDPTY # /dev/[pt]ty?? ptys.

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.32 2007/02/18 02:45:31 tsutsui Exp $
# $NetBSD: Makefile,v 1.33 2009/08/12 23:29:20 matt Exp $
INCSDIR= /usr/include/newsmips
INCS= adrsmap.h ansi.h asm.h aout_machdep.h autoconf.h \
bswap.h bsd-aout.h \
INCS= adrsmap.h ansi.h asm.h autoconf.h \
bswap.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 1998/02/18 13:48:15 tsubai Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.2 2001/09/04 07:36:11 simonb Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.33 2007/02/18 16:18:25 ad Exp $
# $NetBSD: Makefile,v 1.34 2009/08/12 23:29:20 matt Exp $
INCSDIR= /usr/include/pmax
INCS= ansi.h aout_machdep.h asm.h autoconf.h \
bswap.h bsd-aout.h bus.h \
INCS= ansi.h asm.h autoconf.h \
bswap.h bus.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.7 1996/10/08 13:07:36 cgd Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.4 2000/01/09 15:12:31 ad Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,12 +1,12 @@
# $NetBSD: Makefile,v 1.10 2007/02/18 16:24:31 ad Exp $
# $NetBSD: Makefile,v 1.11 2009/08/12 23:29:20 matt Exp $
INCSDIR= /usr/include/sbmips
# XXXcgd need local: bus.h pci_machdep.h
# XXXcgd need export: intr.h
INCS= ansi.h aout_machdep.h asm.h \
bsd-aout.h bswap.h \
INCS= ansi.h asm.h \
bswap.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2002/03/06 02:13:40 simonb Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.1 2002/03/06 02:13:40 simonb Exp $ */
#include <mips/bsd-aout.h>

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.19 2008/11/25 09:47:40 he Exp $
# $NetBSD: Makefile,v 1.20 2009/08/12 23:29:20 matt Exp $
INCSDIR= /usr/include/sgimips
INCS= asm.h ansi.h aout_machdep.h autoconf.h \
bsd-aout.h bswap.h \
INCS= asm.h ansi.h autoconf.h \
bswap.h \
cdefs.h cpu.h \
disklabel.h \
ecoff_machdep.h elf_machdep.h endian.h endian_machdep.h \

View File

@ -1,3 +0,0 @@
/* $NetBSD: aout_machdep.h,v 1.1 2000/06/14 15:39:55 soren Exp $ */
#include <mips/aout_machdep.h>

View File

@ -1,3 +0,0 @@
/* $NetBSD: bsd-aout.h,v 1.1 2000/06/14 15:39:56 soren Exp $ */
#include <mips/bsd-aout.h>