removed as a consequence of pica -> arc transition
This commit is contained in:
parent
8aad71662b
commit
ce6b22983e
@ -1,3 +0,0 @@
|
||||
/* $NetBSD: machAsmDefs.h,v 1.2 1996/03/25 02:55:21 jonathan Exp $ */
|
||||
|
||||
#include <mips/asm.h>
|
@ -1,4 +0,0 @@
|
||||
/* $NetBSD: machConst.h,v 1.4 1997/06/22 04:09:06 jonathan Exp $ */
|
||||
|
||||
|
||||
#include <mips/cpuregs.h>
|
@ -1,3 +0,0 @@
|
||||
/* $NetBSD: math.h,v 1.1 1999/12/23 10:15:14 kleink Exp $ */
|
||||
|
||||
#include <mips/math.h>
|
@ -1,194 +0,0 @@
|
||||
/* $NetBSD: elf.c,v 1.3 1996/10/13 03:31:41 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Ted Lemon
|
||||
*
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/acct.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <vm/vm.h>
|
||||
#include <sys/exec.h>
|
||||
#include <machine/elf.h>
|
||||
|
||||
/* pmax_elf_makecmds (p, epp)
|
||||
|
||||
Test if an executable is a MIPS ELF executable. If it is,
|
||||
try to load it. */
|
||||
|
||||
pmax_elf_makecmds (p, epp)
|
||||
struct proc *p;
|
||||
struct exec_package *epp;
|
||||
{
|
||||
struct ehdr *ex = (struct ehdr *)epp -> ep_hdr;
|
||||
struct phdr ph;
|
||||
int i, error, resid;
|
||||
|
||||
/* Make sure we got enough data to check magic numbers... */
|
||||
if (epp -> ep_hdrvalid < sizeof (struct ehdr)) {
|
||||
#ifdef DIAGNOSTIC
|
||||
if (epp -> ep_hdrlen < sizeof (struct ehdr))
|
||||
printf ("pmax_elf_makecmds: execsw hdrsize too short!\n");
|
||||
#endif
|
||||
return ENOEXEC;
|
||||
}
|
||||
|
||||
/* See if it's got the basic elf magic number leadin... */
|
||||
if (ex -> elf_magic [0] != 127
|
||||
|| bcmp ("ELF", &ex -> elf_magic [1], 3)) {
|
||||
return ENOEXEC;
|
||||
}
|
||||
/* XXX: Check other magic numbers here. */
|
||||
|
||||
/* See if we got any program header information... */
|
||||
if (!ex -> phoff || !ex -> phcount) {
|
||||
return ENOEXEC;
|
||||
}
|
||||
|
||||
/* Set the entry point... */
|
||||
epp -> ep_entry = ex -> entry;
|
||||
|
||||
/*
|
||||
* Check if vnode is open for writing, because we want to
|
||||
* demand-page out of it. If it is, don't do it.
|
||||
*/
|
||||
if (epp->ep_vp->v_writecount != 0) {
|
||||
#ifdef DIAGNOSTIC
|
||||
if (epp->ep_vp->v_flag & VTEXT)
|
||||
panic("exec: a VTEXT vnode has writecount != 0\n");
|
||||
#endif
|
||||
return ETXTBSY;
|
||||
}
|
||||
epp->ep_vp->v_flag |= VTEXT;
|
||||
|
||||
epp->ep_taddr = 0;
|
||||
epp->ep_tsize = 0;
|
||||
epp->ep_daddr = 0;
|
||||
epp->ep_dsize = 0;
|
||||
|
||||
for (i = 0; i < ex -> phcount; i++) {
|
||||
if (error = vn_rdwr(UIO_READ, epp -> ep_vp, (caddr_t)&ph,
|
||||
sizeof ph, ex -> phoff + i * sizeof ph,
|
||||
UIO_SYSSPACE, IO_NODELOCKED,
|
||||
p->p_ucred, &resid, p))
|
||||
return error;
|
||||
|
||||
if (resid != 0) {
|
||||
return ENOEXEC;
|
||||
}
|
||||
|
||||
/* We only care about loadable sections... */
|
||||
if (ph.type == PT_LOAD) {
|
||||
int prot = VM_PROT_READ | VM_PROT_EXECUTE;
|
||||
int residue;
|
||||
unsigned vaddr, offset, length;
|
||||
|
||||
vaddr = ph.vaddr;
|
||||
offset = ph.offset;
|
||||
length = ph.filesz;
|
||||
residue = ph.memsz - ph.filesz;
|
||||
|
||||
if (ph.flags & PF_W) {
|
||||
prot |= VM_PROT_WRITE;
|
||||
if (!epp->ep_daddr || vaddr < epp -> ep_daddr)
|
||||
epp->ep_daddr = vaddr;
|
||||
epp->ep_dsize += ph.memsz;
|
||||
/* Read the data from the file... */
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_readvn,
|
||||
length, vaddr,
|
||||
epp->ep_vp, offset, prot);
|
||||
if (residue) {
|
||||
vaddr &= ~(NBPG - 1);
|
||||
offset &= ~(NBPG - 1);
|
||||
length = roundup (length + ph.vaddr
|
||||
- vaddr, NBPG);
|
||||
residue = (ph.vaddr + ph.memsz)
|
||||
- (vaddr + length);
|
||||
}
|
||||
} else {
|
||||
vaddr &= ~(NBPG - 1);
|
||||
offset &= ~(NBPG - 1);
|
||||
length = roundup (length + ph.vaddr - vaddr,
|
||||
NBPG);
|
||||
residue = (ph.vaddr + ph.memsz)
|
||||
- (vaddr + length);
|
||||
if (!epp->ep_taddr || vaddr < epp -> ep_taddr)
|
||||
epp->ep_taddr = vaddr;
|
||||
epp->ep_tsize += ph.memsz;
|
||||
/* Map the data from the file... */
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn,
|
||||
length, vaddr,
|
||||
epp->ep_vp, offset, prot);
|
||||
}
|
||||
/* If part of the segment is just zeros (e.g., bss),
|
||||
map that. */
|
||||
if (residue > 0) {
|
||||
NEW_VMCMD (&epp->ep_vmcmds, vmcmd_map_zero,
|
||||
residue, vaddr + length,
|
||||
NULLVP, 0, prot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
epp->ep_maxsaddr = USRSTACK - MAXSSIZ;
|
||||
epp->ep_minsaddr = USRSTACK;
|
||||
epp->ep_ssize = p->p_rlimit[RLIMIT_STACK].rlim_cur;
|
||||
|
||||
/*
|
||||
* set up commands for stack. note that this takes *two*, one to
|
||||
* map the part of the stack which we can access, and one to map
|
||||
* the part which we can't.
|
||||
*
|
||||
* arguably, it could be made into one, but that would require the
|
||||
* addition of another mapping proc, which is unnecessary
|
||||
*
|
||||
* note that in memory, things assumed to be: 0 ....... ep_maxsaddr
|
||||
* <stack> ep_minsaddr
|
||||
*/
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero,
|
||||
((epp->ep_minsaddr - epp->ep_ssize) - epp->ep_maxsaddr),
|
||||
epp->ep_maxsaddr, NULLVP, 0, VM_PROT_NONE);
|
||||
NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, epp->ep_ssize,
|
||||
(epp->ep_minsaddr - epp->ep_ssize), NULLVP, 0,
|
||||
VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/* $NetBSD: genassym.c,v 1.2 1996/07/16 23:24:46 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Ralph Campbell.
|
||||
*
|
||||
* 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. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. 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.
|
||||
*
|
||||
* from: @(#)genassym.c 8.2 (Berkeley) 9/23/93
|
||||
*/
|
||||
|
||||
#define _KERNEL
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/map.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
#include <machine/reg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
register struct proc *p = (struct proc *)0;
|
||||
register struct user *up = (struct user *)0;
|
||||
register struct vmmeter *vm = (struct vmmeter *)0;
|
||||
register int size, s, n;
|
||||
|
||||
printf("#define\tP_FORW %d\n", &p->p_forw);
|
||||
printf("#define\tP_BACK %d\n", &p->p_back);
|
||||
printf("#define\tP_PRIORITY %d\n", &p->p_priority);
|
||||
printf("#define\tP_ADDR %d\n", &p->p_addr);
|
||||
printf("#define\tP_UPTE %d\n", p->p_md.md_upte);
|
||||
printf("#define\tU_PCB_REGS %d\n", up->u_pcb.pcb_regs);
|
||||
printf("#define\tU_PCB_FPREGS %d\n", &up->u_pcb.pcb_regs[F0]);
|
||||
printf("#define\tU_PCB_CONTEXT %d\n", &up->u_pcb.pcb_context);
|
||||
printf("#define\tU_PCB_ONFAULT %d\n", &up->u_pcb.pcb_onfault);
|
||||
printf("#define\tU_PCB_SEGTAB %d\n", &up->u_pcb.pcb_segtab);
|
||||
printf("#define\tVM_MIN_ADDRESS 0x%x\n", VM_MIN_ADDRESS);
|
||||
printf("#define\tVM_MIN_KERNEL_ADDRESS 0x%x\n", VM_MIN_KERNEL_ADDRESS);
|
||||
printf("#define\tV_SWTCH %d\n", &vm->v_swtch);
|
||||
printf("#define\tSIGILL %d\n", SIGILL);
|
||||
printf("#define\tSIGFPE %d\n", SIGFPE);
|
||||
exit(0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user