Make kernel compile after recent signal changes.

This commit is contained in:
ragge 1998-09-30 14:09:59 +00:00
parent 92c0c6e35b
commit c0b9fc5616
5 changed files with 109 additions and 75 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.35 1998/06/04 15:52:49 ragge Exp $ */
/* $NetBSD: conf.c,v 1.36 1998/09/30 14:09:59 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@ -98,8 +98,9 @@ bdev_decl(ccd);
#include "vnd.h"
bdev_decl(vnd);
#include "hdc.h"
bdev_decl(hdc);
#include "ry.h"
bdev_decl(rd);
bdev_decl(ry);
#include "sd.h"
bdev_decl(sd);
@ -134,11 +135,12 @@ struct bdevsw bdevsw[] =
bdev_notdef(), /* 16: was: KDB50/RA?? */
bdev_disk_init(NCCD,ccd), /* 17: concatenated disk driver */
bdev_disk_init(NVND,vnd), /* 18: vnode disk driver */
bdev_disk_init(NHDC,hdc), /* 19: HDC9224/RD?? */
bdev_disk_init(NRD,rd), /* 19: VS3100 ST506 disk */
bdev_disk_init(NSD,sd), /* 20: SCSI disk */
bdev_tape_init(NST,st), /* 21: SCSI tape */
bdev_disk_init(NCD,cd), /* 22: SCSI CD-ROM */
bdev_disk_init(NMD,md), /* 23: memory disk driver */
bdev_disk_init(NRY,ry), /* 24: VS3100 floppy */
};
int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
@ -165,7 +167,7 @@ cons_decl(smg);
#include "smg.h"
struct consdev constab[]={
#if VAX8600 || VAX780 || VAX750 || VAX650 || VAX630
#if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630
#define NGEN 1
cons_init(gen), /* Generic console type; mtpr/mfpr */
#else
@ -259,7 +261,8 @@ cdev_decl(gencn);
cdev_decl(rx);
cdev_decl(rl);
cdev_decl(ccd);
cdev_decl(hdc);
cdev_decl(rd);
cdev_decl(ry);
cdev_decl(sd);
cdev_decl(st);
@ -436,7 +439,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(NVND,vnd), /* 55: vnode disk driver */
cdev_bpftun_init(NBPFILTER,bpf),/* 56: berkeley packet filter */
cdev_bpftun_init(NTUN,tun), /* 57: tunnel filter */
cdev_disk_init(NHDC,hdc), /* 58: HDC9224/RD?? */
cdev_disk_init(NRD,rd), /* 58: HDC9224/RD?? */
cdev_disk_init(NSD,sd), /* 59: SCSI disk */
cdev_tape_init(NST,st), /* 60: SCSI tape */
cdev_disk_init(NCD,cd), /* 61: SCSI CD-ROM */
@ -452,6 +455,7 @@ struct cdevsw cdevsw[] =
cdev_mouse_init(NWSKBD, wskbd), /* 69: keyboards */
cdev_mouse_init(NWSMOUSE,
wsmouse), /* 70: mice */
cdev_disk_init(NRY,ry), /* 71: VS floppy */
};
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
@ -537,6 +541,10 @@ int chrtoblktbl[] = {
NODEV, /* 65 */
NODEV, /* 66 */
NODEV, /* 67 */
NODEV, /* 68 */
NODEV, /* 69 */
NODEV, /* 70 */
NODEV, /* 71 */
};
dev_t

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.7 1998/08/31 18:43:29 ragge Exp $
# $NetBSD: genassym.cf,v 1.8 1998/09/30 14:09:59 ragge Exp $
#
# Copyright (c) 1997 Ludd, University of Lule}, Sweden.
# All rights reserved.
@ -57,6 +57,8 @@ define IFTRAP offsetof(struct pcb, iftrap)
define MCHK offsetof(struct cpu_dep, cpu_mchk)
define MEMERR offsetof(struct cpu_dep, cpu_memerr)
define KERNBASE KERNBASE
# mtpr register numbers
define PR_KSP PR_KSP
define PR_USP PR_USP
@ -103,7 +105,8 @@ define USPACE USPACE
define ENAMETOOLONG ENAMETOOLONG
define SYS_sigreturn SYS_sigreturn
define SYS___sigreturn14 SYS___sigreturn14
define SYS_exit SYS_exit
define VAX_TYP_UV2 VAX_TYP_UV2
define VAX_TYP_8SS VAX_TYP_8SS

View File

@ -1,4 +1,4 @@
/* $NetBSD: intvec.s,v 1.32 1998/08/31 18:43:30 ragge Exp $ */
/* $NetBSD: intvec.s,v 1.33 1998/09/30 14:10:00 ragge Exp $ */
/*
* Copyright (c) 1994, 1997 Ludd, University of Lule}, Sweden.
@ -82,7 +82,8 @@ ENTRY(stray/**/vecnr) ; \
.long label+stack;
.text
.globl _kernbase, _rpb
.globl _kernbase, _rpb, _kernel_text
.set _kernel_text,KERNBASE
_kernbase:
_rpb:
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.60 1998/07/05 06:49:10 jonathan Exp $ */
/* $NetBSD: machdep.c,v 1.61 1998/09/30 14:10:00 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@ -49,6 +49,7 @@
#include "opt_inet.h"
#include "opt_atalk.h"
#include "opt_ns.h"
#include "opt_compat_netbsd.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -486,13 +487,53 @@ consinit()
#endif
}
#ifdef COMPAT_13
int
sys_sigreturn(p, v, retval)
compat_13_sys_sigreturn(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct sys_sigreturn_args /* {
struct compat_13_sys_sigreturn_args /* {
syscallarg(struct sigcontext13 *) sigcntxp;
} */ *uap = v;
struct trapframe *scf;
struct sigcontext13 *cntx;
sigset_t mask;
scf = p->p_addr->u_pcb.framep;
cntx = SCARG(uap, sigcntxp);
/* Compatibility mode? */
if ((cntx->sc_ps & (PSL_IPL | PSL_IS)) ||
((cntx->sc_ps & (PSL_U | PSL_PREVU)) != (PSL_U | PSL_PREVU)) ||
(cntx->sc_ps & PSL_CM)) {
return (EINVAL);
}
if (cntx->sc_onstack & SS_ONSTACK)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
native_sigset13_to_sigset(&cntx->sc_mask, &mask);
(void) sigprocmask1(p, SIG_SETMASK, &mask, 0);
scf->fp = cntx->sc_fp;
scf->ap = cntx->sc_ap;
scf->pc = cntx->sc_pc;
scf->sp = cntx->sc_sp;
scf->psl = cntx->sc_ps;
return (EJUSTRETURN);
}
#endif
int
sys___sigreturn14(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct sys___sigreturn14_args /* {
syscallarg(struct sigcontext *) sigcntxp;
} */ *uap = v;
struct trapframe *scf;
@ -511,7 +552,8 @@ sys_sigreturn(p, v, retval)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
p->p_sigmask = cntx->sc_mask & ~sigcantmask;
/* Restore signal mask. */
(void) sigprocmask1(p, SIG_SETMASK, &cntx->sc_mask, 0);
scf->fp = cntx->sc_fp;
scf->ap = cntx->sc_ap;
@ -535,40 +577,29 @@ struct trampframe {
void
sendsig(catcher, sig, mask, code)
sig_t catcher;
int sig, mask;
int sig;
sigset_t *mask;
u_long code;
{
struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts;
struct trapframe *syscf;
struct sigcontext *sigctx;
struct trampframe *trampf;
struct sigcontext *sigctx, gsigctx;
struct trampframe *trampf, gtrampf;
unsigned cursp;
int oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
extern char sigcode[], esigcode[];
/*
* Allocate and validate space for the signal handler context. Note
* that if the stack is in P0 space, the call to grow() is a nop, and
* the useracc() check will fail if the process has not already
* allocated the space with a `brk'. We shall allocate space on the
* stack for both struct sigcontext and struct calls...
*/
int onstack;
syscf = p->p_addr->u_pcb.framep;
/* First check what stack to work on */
if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack &&
(psp->ps_sigonstack & sigmask(sig))) {
cursp = (int)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size);
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
} else
onstack =
(psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
/* Allocate space for the signal handler context. */
if (onstack)
cursp = ((int)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size);
else
cursp = syscf->sp;
if (cursp <= USRSTACK - ctob(p->p_vmspace->vm_ssize))
#if !defined(UVM)
(void) grow(p, cursp);
#else
(void) uvm_grow(p, cursp);
#endif
/* Set up positions for structs on stack */
sigctx = (struct sigcontext *) (cursp - sizeof(struct sigcontext));
@ -578,45 +609,35 @@ sendsig(catcher, sig, mask, code)
/* Place for pointer to arg list in sigreturn */
cursp = (unsigned)sigctx - 8;
#if defined(UVM)
if (uvm_useracc((caddr_t) cursp, sizeof(struct sigcontext) +
sizeof(struct trampframe), B_WRITE) == 0) {
#else
if (useracc((caddr_t) cursp, sizeof(struct sigcontext) +
sizeof(struct trampframe), B_WRITE) == 0) {
gtrampf.arg = (int) sigctx;
gtrampf.pc = (unsigned) catcher;
gtrampf.scp = (int) sigctx;
gtrampf.code = code;
gtrampf.sig = sig;
gsigctx.sc_pc = syscf->pc;
gsigctx.sc_ps = syscf->psl;
gsigctx.sc_ap = syscf->ap;
gsigctx.sc_fp = syscf->fp;
gsigctx.sc_sp = syscf->sp;
gsigctx.sc_onstack = psp->ps_sigstk.ss_flags & SS_ONSTACK;
gsigctx.sc_mask = *mask;
#ifdef COMPAT_13
native_sigset_to_sigset13(mask, &gsigctx.__sc_mask13);
#endif
/*
* Process has trashed its stack; give it an illegal
* instruction to halt it in its tracks.
*/
SIGACTION(p, SIGILL) = SIG_DFL;
sig = sigmask(SIGILL);
p->p_sigignore &= ~sig;
p->p_sigcatch &= ~sig;
p->p_sigmask &= ~sig;
psignal(p, SIGILL);
return;
}
/* Set up pointers for sigreturn args */
trampf->arg = (int) sigctx;
trampf->pc = (unsigned) catcher;
trampf->scp = (int) sigctx;
trampf->code = code;
trampf->sig = sig;
if (copyout(&gtrampf, trampf, sizeof(gtrampf)) ||
copyout(&gsigctx, sigctx, sizeof(gsigctx)))
sigexit(p, SIGILL);
sigctx->sc_pc = syscf->pc;
sigctx->sc_ps = syscf->psl;
sigctx->sc_ap = syscf->ap;
sigctx->sc_fp = syscf->fp;
sigctx->sc_sp = syscf->sp;
sigctx->sc_onstack = oonstack;
sigctx->sc_mask = mask;
syscf->pc = (unsigned) (((char *) PS_STRINGS) - (esigcode - sigcode));
syscf->pc = (int)psp->ps_sigcode;
syscf->psl = PSL_U | PSL_PREVU;
syscf->ap = cursp;
syscf->sp = cursp;
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
}
int waittime = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr.s,v 1.26 1998/09/09 00:09:19 thorpej Exp $ */
/* $NetBSD: subr.s,v 1.27 1998/09/30 14:10:00 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -91,7 +91,8 @@ _sigcode: pushr $0x3f
movl 0x24(sp),r0
calls $3,(r0)
popr $0x3f
chmk $SYS_sigreturn
chmk $SYS___sigreturn14
chmk $SYS_exit
halt
.align 2
_esigcode: