clean and up make compile

This commit is contained in:
mrg 1999-03-25 17:49:43 +00:00
parent b476609d5f
commit 54ab2e1e54
6 changed files with 86 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.1 1999/03/25 16:26:19 mrg Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.2 1999/03/25 17:49:43 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -35,7 +35,7 @@
typedef u_int32_t netbsd32_sigcontextp_t;
/* XXX how can this work? */
struct sparc32_sigcontext {
struct netbsd32_sigcontext {
int sc_onstack; /* sigstack state to restore */
int sc_mask; /* signal mask to restore */
/* begin machine dependent portion */

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.34 1999/03/24 05:51:13 mrg Exp $ */
/* $NetBSD: locore.s,v 1.35 1999/03/25 17:49:43 mrg Exp $ */
/*
* Copyright (c) 1996, 1997, 1998 Eduardo Horvath
* Copyright (c) 1996 Paul Kranenburg
@ -65,7 +65,7 @@
#include "opt_ddb.h"
#include "opt_compat_svr4.h"
#include "opt_compat_sparc32.h"
#include "opt_compat_netbsd32.h"
#include "assym.h"
#include <machine/param.h>
@ -85,8 +85,8 @@
#ifdef COMPAT_SVR4
#include <compat/svr4/svr4_syscall.h>
#endif
#ifdef COMPAT_SPARC32
#include <compat/sparc32/sparc32_syscall.h>
#ifdef COMPAT_NETBSD32
#include <compat/netbsd32/netbsd32_syscall.h>
#endif
#include <machine/asm.h>
@ -5603,9 +5603,9 @@ _C_LABEL(esigcode):
* work out.
*/
#ifdef _LP64
.globl _C_LABEL(sparc32_sigcode)
.globl _C_LABEL(sparc32_esigcode)
_C_LABEL(sparc32_sigcode):
.globl _C_LABEL(netbsd32_sigcode)
.globl _C_LABEL(netbsd32_esigcode)
_C_LABEL(netbsd32_sigcode):
#else
.globl _C_LABEL(sigcode)
.globl _C_LABEL(esigcode)
@ -5694,13 +5694,13 @@ _C_LABEL(sigcode):
mov %l7, %g7
#ifdef _LP64
restore %g0, sparc32_SYS_compat_sparc32_sigreturn, %g1 ! get registers back & set syscall #
restore %g0, netbsd32_SYS_compat_netbsd32_sigreturn, %g1 ! get registers back & set syscall #
add %sp, 64 + 16, %o0 ! compute scp
t ST_SYSCALL ! sigreturn(scp)
! sigreturn does not return unless it fails
mov sparc32_SYS_compat_sparc32_exit, %g1 ! exit(errno)
mov netbsd32_SYS_compat_netbsd32_exit, %g1 ! exit(errno)
t ST_SYSCALL
_C_LABEL(sparc32_esigcode):
_C_LABEL(netbsd32_esigcode):
#else
restore %g0, SYS___sigreturn14, %g1 ! get registers back & set syscall #
add %sp, 64 + 16, %o0 ! compute scp

View File

@ -1,3 +1,52 @@
/* $NetBSD: netbsd32_machdep.c,v 1.2 1999/03/25 17:49:44 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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/exec.h>
#include <sys/malloc.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/mount.h>
#include <machine/frame.h>
#include <machine/reg.h>
#include <machine/vmparam.h>
#include <machine/netbsd32_machdep.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
void netbsd32_sendsig __P((sig_t, int, int, u_long));
void netbsd32_setregs __P((struct proc *, struct exec_package *, u_long));
/*
* Set up registers on exec.
*
@ -5,7 +54,7 @@
*/
/* ARGSUSED */
void
sparc32_setregs(p, pack, stack)
netbsd32_setregs(p, pack, stack)
struct proc *p;
struct exec_package *pack;
u_long stack; /* XXX */
@ -54,12 +103,12 @@ sparc32_setregs(p, pack, stack)
* NB: since this is a 32-bit address world, sf_scp and sf_sc
* can't be a pointer since those are 64-bits wide.
*/
struct netbsd32_sigframe {
struct sparc32_sigframe {
int sf_signo; /* signal number */
int sf_code; /* code */
u_int sf_scp; /* SunOS user addr of sigcontext */
int sf_addr; /* SunOS compat, always 0 for now */
struct sparc32_sigcontext sf_sc; /* actual sigcontext */
struct netbsd32_sigcontext sf_sc; /* actual sigcontext */
};
#undef DEBUG
@ -80,8 +129,8 @@ netbsd32_sendsig(catcher, sig, mask, code)
register int addr, onstack;
struct rwindow32 *kwin, *oldsp, *newsp;
struct sparc32_sigframe sf;
extern char sigcode[], esigcode[];
#define szsigcode (esigcode - sigcode)
extern char netbsd32_sigcode[], netbsd32_esigcode[];
#define szsigcode (netbsd32_esigcode - netbsd32_sigcode)
tf = p->p_md.md_tf;
/* Need to attempt to zero extend this 32-bit pointer */
@ -91,7 +140,7 @@ netbsd32_sendsig(catcher, sig, mask, code)
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
if (onstack) {
fp = (struct sparc32_sigframe *)(psp->ps_sigstk.ss_sp +
fp = (struct sparc32_sigframe *)((char *)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
} else
@ -195,16 +244,16 @@ netbsd32_sendsig(catcher, sig, mask, code)
#undef DEBUG
int
compat_sparc32_sigreturn(p, v, retval)
compat_netbsd32_sigreturn(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct compat_sparc32_sigreturn_args /* {
syscallarg(struct sparc32_sigcontext *) sigcntxp;
struct compat_netbsd32_sigreturn_args /* {
syscallarg(struct netbsd32_sigcontext *) sigcntxp;
} */ *uap = v;
struct sparc32_sigcontext *scp;
struct sparc32_sigcontext sc;
struct netbsd32_sigcontext *scp;
struct netbsd32_sigcontext sc;
register struct trapframe *tf;
struct rwindow32 *rwstack, *kstack;
sigset_t mask;
@ -225,7 +274,7 @@ compat_sparc32_sigreturn(p, v, retval)
if (sigdebug & SDB_DDB) Debugger();
}
#endif
scp = (struct sparc32_sigcontext *)(u_long)SCARG(uap, sigcntxp);
scp = (struct netbsd32_sigcontext *)(u_long)SCARG(uap, sigcntxp);
if ((vaddr_t)scp & 3 || (copyin((caddr_t)scp, &sc, sizeof sc) != 0))
#ifdef DEBUG
{
@ -259,7 +308,7 @@ compat_sparc32_sigreturn(p, v, retval)
tf->tf_global[1] = (int64_t)sc.sc_g1;
tf->tf_out[0] = (int64_t)sc.sc_o0;
tf->tf_out[6] = (int64_t)sc.sc_sp;
rwstack = (struct rwindow32 *)tf->tf_out[6];
rwstack = (struct rwindow32 *)(u_long)tf->tf_out[6];
kstack = (struct rwindow32 *)(((caddr_t)tf)-CCFSZ);
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW) {

View File

@ -1,4 +1,4 @@
# $NetBSD: files.netbsd32,v 1.3 1999/03/25 16:22:49 mrg Exp $
# $NetBSD: files.netbsd32,v 1.4 1999/03/25 17:57:21 mrg Exp $
#
# config file description for machine-independent netbsd32 compat code.
# included by ports that need it.
@ -16,3 +16,5 @@ file compat/netbsd32/netbsd32_compat_12.c compat_netbsd32 & compat_12
file compat/netbsd32/netbsd32_compat_13.c compat_netbsd32 & compat_13
file compat/netbsd32/netbsd32_compat_43.c compat_netbsd32 & compat_43
file compat/netbsd32/netbsd32_syscalls.c compat_netbsd32 & syscall_debug
defopt COMPAT_NETBSD32

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32.h,v 1.6 1999/03/25 16:58:39 mrg Exp $ */
/* $NetBSD: netbsd32.h,v 1.7 1999/03/25 17:57:21 mrg Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@ -416,17 +416,20 @@ typedef u_int32_t netbsd32_outsnamep_t;
/*
* machine depedant section; must define:
* struct netbsd32_sigcontext
* - 32bit compatibility sigcontext for this arch.
* - 32bit compatibility sigcontext structure for this arch.
* netbsd32_sigcontextp_t
* - type of pointer to above, normally u_int32_t
* void netbsd32_setregs(struct proc *p, struct exec_package *pack,
* u_long stack /* XXX */);
* u_long stack);
* int compat_netbsd32_sigreturn(struct proc *p, void *v,
* register_t *retval);
* void netbsd32_sendsig(sig_t catcher, int sig, int mask, u_long code);
* - the above are
* char netbsd32_esigcode[], netbsd32_sigcode[]
* - the above are abvious
*
* pull in the netbsd32 machine dependant header, that may help with the
* above, or it may be provided via the MD layer itself.
*/
#include <machine/netbsd32_machdep.h>
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_exec.c,v 1.13 1999/03/25 16:22:49 mrg Exp $ */
/* $NetBSD: netbsd32_exec.c,v 1.14 1999/03/25 17:57:22 mrg Exp $ */
/* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */
/*
@ -59,8 +59,6 @@ extern struct sysent netbsd32_sysent[];
#ifdef SYSCALL_DEBUG
extern char *netbsd32_syscallnames[];
#endif
void netbsd32_sendsig __P((sig_t, int, int, u_long));
void netbsd32_setregs __P((struct proc *, struct exec_package *, u_long));
void *netbsd32_copyargs __P((struct exec_package *, struct ps_strings *,
void *, void *));
int netbsd32_copyinargs __P((struct ps_strings *, void *, size_t,