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. * Copyright (c) 1982, 1986 The Regents of the University of California.
@ -98,8 +98,9 @@ bdev_decl(ccd);
#include "vnd.h" #include "vnd.h"
bdev_decl(vnd); bdev_decl(vnd);
#include "hdc.h" #include "ry.h"
bdev_decl(hdc); bdev_decl(rd);
bdev_decl(ry);
#include "sd.h" #include "sd.h"
bdev_decl(sd); bdev_decl(sd);
@ -134,11 +135,12 @@ struct bdevsw bdevsw[] =
bdev_notdef(), /* 16: was: KDB50/RA?? */ bdev_notdef(), /* 16: was: KDB50/RA?? */
bdev_disk_init(NCCD,ccd), /* 17: concatenated disk driver */ bdev_disk_init(NCCD,ccd), /* 17: concatenated disk driver */
bdev_disk_init(NVND,vnd), /* 18: vnode 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_disk_init(NSD,sd), /* 20: SCSI disk */
bdev_tape_init(NST,st), /* 21: SCSI tape */ bdev_tape_init(NST,st), /* 21: SCSI tape */
bdev_disk_init(NCD,cd), /* 22: SCSI CD-ROM */ bdev_disk_init(NCD,cd), /* 22: SCSI CD-ROM */
bdev_disk_init(NMD,md), /* 23: memory disk driver */ bdev_disk_init(NMD,md), /* 23: memory disk driver */
bdev_disk_init(NRY,ry), /* 24: VS3100 floppy */
}; };
int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]); int nblkdev = sizeof(bdevsw) / sizeof(bdevsw[0]);
@ -165,7 +167,7 @@ cons_decl(smg);
#include "smg.h" #include "smg.h"
struct consdev constab[]={ struct consdev constab[]={
#if VAX8600 || VAX780 || VAX750 || VAX650 || VAX630 #if VAX8600 || VAX8200 || VAX780 || VAX750 || VAX650 || VAX630
#define NGEN 1 #define NGEN 1
cons_init(gen), /* Generic console type; mtpr/mfpr */ cons_init(gen), /* Generic console type; mtpr/mfpr */
#else #else
@ -259,7 +261,8 @@ cdev_decl(gencn);
cdev_decl(rx); cdev_decl(rx);
cdev_decl(rl); cdev_decl(rl);
cdev_decl(ccd); cdev_decl(ccd);
cdev_decl(hdc); cdev_decl(rd);
cdev_decl(ry);
cdev_decl(sd); cdev_decl(sd);
cdev_decl(st); cdev_decl(st);
@ -436,7 +439,7 @@ struct cdevsw cdevsw[] =
cdev_disk_init(NVND,vnd), /* 55: vnode disk driver */ cdev_disk_init(NVND,vnd), /* 55: vnode disk driver */
cdev_bpftun_init(NBPFILTER,bpf),/* 56: berkeley packet filter */ cdev_bpftun_init(NBPFILTER,bpf),/* 56: berkeley packet filter */
cdev_bpftun_init(NTUN,tun), /* 57: tunnel 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_disk_init(NSD,sd), /* 59: SCSI disk */
cdev_tape_init(NST,st), /* 60: SCSI tape */ cdev_tape_init(NST,st), /* 60: SCSI tape */
cdev_disk_init(NCD,cd), /* 61: SCSI CD-ROM */ 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(NWSKBD, wskbd), /* 69: keyboards */
cdev_mouse_init(NWSMOUSE, cdev_mouse_init(NWSMOUSE,
wsmouse), /* 70: mice */ wsmouse), /* 70: mice */
cdev_disk_init(NRY,ry), /* 71: VS floppy */
}; };
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]); int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
@ -537,6 +541,10 @@ int chrtoblktbl[] = {
NODEV, /* 65 */ NODEV, /* 65 */
NODEV, /* 66 */ NODEV, /* 66 */
NODEV, /* 67 */ NODEV, /* 67 */
NODEV, /* 68 */
NODEV, /* 69 */
NODEV, /* 70 */
NODEV, /* 71 */
}; };
dev_t 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. # Copyright (c) 1997 Ludd, University of Lule}, Sweden.
# All rights reserved. # All rights reserved.
@ -57,6 +57,8 @@ define IFTRAP offsetof(struct pcb, iftrap)
define MCHK offsetof(struct cpu_dep, cpu_mchk) define MCHK offsetof(struct cpu_dep, cpu_mchk)
define MEMERR offsetof(struct cpu_dep, cpu_memerr) define MEMERR offsetof(struct cpu_dep, cpu_memerr)
define KERNBASE KERNBASE
# mtpr register numbers # mtpr register numbers
define PR_KSP PR_KSP define PR_KSP PR_KSP
define PR_USP PR_USP define PR_USP PR_USP
@ -103,7 +105,8 @@ define USPACE USPACE
define ENAMETOOLONG ENAMETOOLONG 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_UV2 VAX_TYP_UV2
define VAX_TYP_8SS VAX_TYP_8SS 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. * Copyright (c) 1994, 1997 Ludd, University of Lule}, Sweden.
@ -82,7 +82,8 @@ ENTRY(stray/**/vecnr) ; \
.long label+stack; .long label+stack;
.text .text
.globl _kernbase, _rpb .globl _kernbase, _rpb, _kernel_text
.set _kernel_text,KERNBASE
_kernbase: _kernbase:
_rpb: _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. * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@ -49,6 +49,7 @@
#include "opt_inet.h" #include "opt_inet.h"
#include "opt_atalk.h" #include "opt_atalk.h"
#include "opt_ns.h" #include "opt_ns.h"
#include "opt_compat_netbsd.h"
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -486,13 +487,53 @@ consinit()
#endif #endif
} }
#ifdef COMPAT_13
int int
sys_sigreturn(p, v, retval) compat_13_sys_sigreturn(p, v, retval)
struct proc *p; struct proc *p;
void *v; void *v;
register_t *retval; 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; syscallarg(struct sigcontext *) sigcntxp;
} */ *uap = v; } */ *uap = v;
struct trapframe *scf; struct trapframe *scf;
@ -511,7 +552,8 @@ sys_sigreturn(p, v, retval)
p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK;
else else
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; 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->fp = cntx->sc_fp;
scf->ap = cntx->sc_ap; scf->ap = cntx->sc_ap;
@ -535,40 +577,29 @@ struct trampframe {
void void
sendsig(catcher, sig, mask, code) sendsig(catcher, sig, mask, code)
sig_t catcher; sig_t catcher;
int sig, mask; int sig;
sigset_t *mask;
u_long code; u_long code;
{ {
struct proc *p = curproc; struct proc *p = curproc;
struct sigacts *psp = p->p_sigacts; struct sigacts *psp = p->p_sigacts;
struct trapframe *syscf; struct trapframe *syscf;
struct sigcontext *sigctx; struct sigcontext *sigctx, gsigctx;
struct trampframe *trampf; struct trampframe *trampf, gtrampf;
unsigned cursp; unsigned cursp;
int oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; int 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...
*/
syscf = p->p_addr->u_pcb.framep; syscf = p->p_addr->u_pcb.framep;
/* First check what stack to work on */ onstack =
if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && (psp->ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
(psp->ps_sigonstack & sigmask(sig))) { (psp->ps_sigact[sig].sa_flags & SA_ONSTACK) != 0;
cursp = (int)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size); /* Allocate space for the signal handler context. */
psp->ps_sigstk.ss_flags |= SS_ONSTACK; if (onstack)
} else cursp = ((int)psp->ps_sigstk.ss_sp + psp->ps_sigstk.ss_size);
else
cursp = syscf->sp; 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 */ /* Set up positions for structs on stack */
sigctx = (struct sigcontext *) (cursp - sizeof(struct sigcontext)); sigctx = (struct sigcontext *) (cursp - sizeof(struct sigcontext));
@ -578,45 +609,35 @@ sendsig(catcher, sig, mask, code)
/* Place for pointer to arg list in sigreturn */ /* Place for pointer to arg list in sigreturn */
cursp = (unsigned)sigctx - 8; cursp = (unsigned)sigctx - 8;
#if defined(UVM) gtrampf.arg = (int) sigctx;
if (uvm_useracc((caddr_t) cursp, sizeof(struct sigcontext) + gtrampf.pc = (unsigned) catcher;
sizeof(struct trampframe), B_WRITE) == 0) { gtrampf.scp = (int) sigctx;
#else gtrampf.code = code;
if (useracc((caddr_t) cursp, sizeof(struct sigcontext) + gtrampf.sig = sig;
sizeof(struct trampframe), B_WRITE) == 0) {
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 #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; syscf->pc = (int)psp->ps_sigcode;
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->psl = PSL_U | PSL_PREVU; syscf->psl = PSL_U | PSL_PREVU;
syscf->ap = cursp; syscf->ap = cursp;
syscf->sp = cursp; syscf->sp = cursp;
if (onstack)
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
} }
int waittime = -1; 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. * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -91,7 +91,8 @@ _sigcode: pushr $0x3f
movl 0x24(sp),r0 movl 0x24(sp),r0
calls $3,(r0) calls $3,(r0)
popr $0x3f popr $0x3f
chmk $SYS_sigreturn chmk $SYS___sigreturn14
chmk $SYS_exit
halt halt
.align 2 .align 2
_esigcode: _esigcode: