Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!

Approved by core@.
This commit is contained in:
rmind 2012-02-19 21:05:51 +00:00
parent 81a52e8014
commit ad12c77015
139 changed files with 380 additions and 5935 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1740 2012/02/17 09:44:12 plunky Exp $
# $NetBSD: mi,v 1.1741 2012/02/19 21:05:51 rmind Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -2484,8 +2484,8 @@
./usr/include/sys/rmd160.h comp-c-include
./usr/include/sys/rnd.h comp-c-include
./usr/include/sys/rwlock.h comp-c-include
./usr/include/sys/sa.h comp-c-include
./usr/include/sys/satypes.h comp-c-include
./usr/include/sys/sa.h comp-obsolete obsolete
./usr/include/sys/satypes.h comp-obsolete obsolete
./usr/include/sys/scanio.h comp-c-include
./usr/include/sys/sched.h comp-c-include
./usr/include/sys/scsiio.h comp-c-include

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.27 2011/02/10 14:46:45 pooka Exp $ */
/* $NetBSD: vm_machdep.c,v 1.28 2012/02/19 21:05:58 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* Following is for vmapbuf/vunmapbuf */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
* All rights reserved.
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.27 2011/02/10 14:46:45 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.28 2012/02/19 21:05:58 rmind Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -133,22 +133,12 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
/* Fabricate a new switchframe */
memset(sf, 0, sizeof(*sf));
cpu_setfunc(l2, func, arg);
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf = pcb->pcb_tf;
struct switchframe *sf = (struct switchframe *)tf - 1;
sf->sf_r13 = (register_t)tf; /* Initial stack pointer */
sf->sf_pc = (register_t)lwp_trampoline | R15_MODE_SVC;
pcb->pcb_tf = tf;
pcb->pcb_sf = sf;
pcb->pcb_onfault = NULL;
pcb2->pcb_tf = tf;
pcb2->pcb_sf = sf;
pcb2->pcb_onfault = NULL;
sf->sf_r4 = (register_t)func;
sf->sf_r5 = (register_t)arg;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.121 2011/06/07 00:48:30 matt Exp $ */
/* $NetBSD: locore.s,v 1.122 2012/02/19 21:05:58 rmind Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.121 2011/06/07 00:48:30 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.122 2012/02/19 21:05:58 rmind Exp $");
#include "assym.h"
@ -744,16 +744,6 @@ LEAF_NOPROFILE(lwp_trampoline, 0)
jmp zero, (pv)
END(lwp_trampoline)
/*
* Simplified version of above: don't call lwp_startup()
*/
LEAF_NOPROFILE(setfunc_trampoline, 0)
mov s0, pv
mov s1, ra
mov s2, a0
jmp zero, (pv)
END(setfunc_trampoline)
/**************************************************************************/
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.127 2012/02/06 02:14:12 matt Exp $ */
/* $NetBSD: trap.c,v 1.128 2012/02/19 21:05:59 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -93,13 +93,11 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.127 2012/02/06 02:14:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.128 2012/02/19 21:05:59 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/buf.h>
#include <sys/kauth.h>
@ -407,12 +405,7 @@ trap(const u_long a0, const u_long a1, const u_long a2, const u_long entry,
#endif
}
if (user) {
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)a0;
l->l_pflag |= LP_SA_PAGEFAULT;
}
} else {
if (!user) {
struct cpu_info *ci = curcpu();
if (l == NULL) {
@ -488,8 +481,6 @@ do_fault:
rv = EFAULT;
}
if (rv == 0) {
if (user)
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
@ -518,7 +509,6 @@ do_fault:
ksi.ksi_code = SEGV_ACCERR;
else
ksi.ksi_code = SEGV_MAPERR;
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
@ -1145,14 +1135,3 @@ startlwp(void *arg)
kmem_free(uc, sizeof(ucontext_t));
userret(l);
}
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
KERNEL_UNLOCK_LAST(l);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.111 2012/02/06 02:14:12 matt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.112 2012/02/19 21:06:00 rmind Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.111 2012/02/06 02:14:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.112 2012/02/19 21:06:00 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -159,24 +159,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
}
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
extern void setfunc_trampoline(void);
pcb->pcb_hw.apcb_ksp =
(uint64_t)l->l_md.md_tf;
pcb->pcb_context[0] =
(uint64_t)func; /* s0: pc */
pcb->pcb_context[1] =
(uint64_t)exception_return; /* s1: ra */
pcb->pcb_context[2] =
(uint64_t)arg; /* s2: arg */
pcb->pcb_context[7] =
(uint64_t)setfunc_trampoline; /* ra: assembly magic */
}
/*
* Map a user I/O request into kernel virtual address space.
* Note: the pages are already locked by uvm_vslock(), so we

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.175 2012/01/27 19:48:38 para Exp $ */
/* $NetBSD: machdep.c,v 1.176 2012/02/19 21:06:00 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@ -111,7 +111,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175 2012/01/27 19:48:38 para Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.176 2012/02/19 21:06:00 rmind Exp $");
/* #define XENDEBUG_LOW */
@ -147,8 +147,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.175 2012/01/27 19:48:38 para Exp $");
#include <sys/ucontext.h>
#include <machine/kcore.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallargs.h>
#include <sys/ksyms.h>
#include <sys/device.h>
@ -688,39 +686,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
l->l_sigstk.ss_flags |= SS_ONSTACK;
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
tf = l->l_md.md_regs;
#if 0
printf("proc %d: upcall to lwp %d, type %d ev %d int %d sas %p to %p\n",
(int)l->l_proc->p_pid, (int)l->l_lid, type, nevents, ninterrupted,
sas, (void *)upcall);
#endif
tf->tf_rdi = type;
tf->tf_rsi = (u_int64_t)sas;
tf->tf_rdx = nevents;
tf->tf_rcx = ninterrupted;
tf->tf_r8 = (u_int64_t)ap;
tf->tf_rip = (u_int64_t)upcall;
tf->tf_rsp = ((unsigned long)sp & ~15) - 8;
tf->tf_rbp = 0; /* indicate call-frame-top to debuggers */
tf->tf_gs = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_rflags &= ~(PSL_T|PSL_VM|PSL_AC);
l->l_md.md_flags |= MDP_IRET;
}
int waittime = -1;
struct pcb dumppcb;

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.74 2011/03/04 22:25:24 joerg Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.75 2012/02/19 21:06:01 rmind Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.74 2011/03/04 22:25:24 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.75 2012/02/19 21:06:01 rmind Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -53,8 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.74 2011/03/04 22:25:24 joerg
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/core.h>
#include <sys/mount.h>
#include <sys/buf.h>
@ -1016,42 +1014,6 @@ check_mcontext32(struct lwp *l, const mcontext32_t *mcp)
return 0;
}
void
netbsd32_cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
struct netbsd32_saframe *sf, frame;
tf = l->l_md.md_regs;
frame.sa_type = type;
NETBSD32PTR32(frame.sa_sas, sas);
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
NETBSD32PTR32(frame.sa_arg, ap);
frame.sa_ra = 0;
sf = (struct netbsd32_saframe *)sp - 1;
if (copyout(&frame, sf, sizeof(frame)) != 0) {
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_rip = (uintptr_t)upcall;
tf->tf_rsp = (uintptr_t)sf;
tf->tf_rbp = 0;
tf->tf_gs = GSEL(GUDATA32_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUDATA32_SEL, SEL_UPL);
tf->tf_es = GSEL(GUDATA32_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA32_SEL, SEL_UPL);
tf->tf_cs = GSEL(GUCODE32_SEL, SEL_UPL);
tf->tf_ss = GSEL(GUDATA32_SEL, SEL_UPL);
tf->tf_rflags &= ~(PSL_T|PSL_VM|PSL_AC);
l->l_md.md_flags |= MDP_IRET;
}
vaddr_t
netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.69 2012/02/04 22:45:40 reinoud Exp $ */
/* $NetBSD: trap.c,v 1.70 2012/02/19 21:06:02 rmind Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2012/02/04 22:45:40 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.70 2012/02/19 21:06:02 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -87,8 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.69 2012/02/04 22:45:40 reinoud Exp $");
#include <sys/syscall.h>
#include <sys/cpu.h>
#include <sys/ucontext.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <uvm/uvm_extern.h>
@ -502,10 +500,6 @@ copyfault:
if (p->p_emul->e_usertrap != NULL &&
(*p->p_emul->e_usertrap)(l, cr2, frame) != 0)
return;
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)cr2;
l->l_pflag |= LP_SA_PAGEFAULT;
}
faultcommon:
vm = p->p_vmspace;
if (__predict_false(vm == NULL)) {
@ -594,7 +588,6 @@ faultcommon:
*/
pfail = kpreempt(0);
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
KSI_INIT_TRAP(&ksi);
@ -630,7 +623,6 @@ faultcommon:
ksi.ksi_signo = SIGSEGV;
}
(*p->p_emul->e_trapsignal)(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
@ -704,16 +696,6 @@ startlwp(void *arg)
userret(l);
}
/*
* XXX_SA: This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
KERNEL_UNLOCK_LAST(l);
userret(l);
}
#ifdef TRAP_SIGDEBUG
static void
frame_dump(struct trapframe *tf)

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.16 2008/10/15 06:51:17 wrstuden Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.17 2012/02/19 21:06:02 rmind Exp $ */
#ifndef _MACHINE_NETBSD32_H_
#define _MACHINE_NETBSD32_H_
@ -133,15 +133,6 @@ struct x86_64_set_mtrr_args32 {
uint32_t n;
};
struct netbsd32_saframe {
int sa_ra;
int sa_type;
netbsd32_pointer_t sa_sas;
int sa_events;
int sa_interrupted;
netbsd32_pointer_t sa_arg;
};
struct env87 {
int32_t en_cw;
int32_t en_sw;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.133 2011/02/08 20:20:08 rmind Exp $ */
/* $NetBSD: trap.c,v 1.134 2012/02/19 21:06:03 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -45,7 +45,7 @@
#include "opt_m68k_arch.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.133 2011/02/08 20:20:08 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.134 2012/02/19 21:06:03 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -56,8 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.133 2011/02/08 20:20:08 rmind Exp $");
#include <sys/resourcevar.h>
#include <sys/syslog.h>
#include <sys/syscall.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@ -351,13 +349,8 @@ trapmmufault(int type, u_int code, u_int v, struct frame *fp, struct lwp *l, u_q
mmutype == MMU_68040 ? (code & SSW_TMMASK) == FC_SUPERD :
(code & (SSW_DF|FC_SUPERD)) == (SSW_DF|FC_SUPERD))))
map = kernel_map;
else {
else
map = &vm->vm_map;
if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (
#ifdef M68060
@ -464,7 +457,6 @@ trapmmufault(int type, u_int code, u_int v, struct frame *fp, struct lwp *l, u_q
if (type == T_MMUFLT)
return;
l->l_pflag &= ~LP_SA_PAGEFAULT;
userret(l, fp->f_pc, sticks);
return;
}
@ -497,7 +489,6 @@ nogo:
trapsignal(l, &ksi);
if ((type & T_USER) == 0)
return;
l->l_pflag &= ~LP_SA_PAGEFAULT;
userret(l, fp->f_pc, sticks);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm_machdep.c,v 1.30 2011/03/04 22:25:25 joerg Exp $ */
/* $NetBSD: arm_machdep.c,v 1.31 2012/02/19 21:06:04 rmind Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -75,11 +75,10 @@
#include "opt_cpuoptions.h"
#include "opt_cputypes.h"
#include "opt_arm_debug.h"
#include "opt_sa.h"
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.30 2011/03/04 22:25:25 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.31 2012/02/19 21:06:04 rmind Exp $");
#include <sys/exec.h>
#include <sys/proc.h>
@ -88,7 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.30 2011/03/04 22:25:25 joerg Exp $
#include <sys/ucontext.h>
#include <sys/evcnt.h>
#include <sys/cpu.h>
#include <sys/savar.h>
#ifdef EXEC_AOUT
#include <sys/exec_aout.h>
@ -201,64 +199,6 @@ startlwp(void *arg)
userret(l);
}
#ifdef KERN_SA
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
userret(l);
}
/*
* cpu_upcall:
*
* Send an an upcall to userland.
*/
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas,
void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
struct saframe *sf, frame;
tf = process_frame(l);
/* Finally, copy out the rest of the frame. */
#if 0 /* First 4 args in regs (see below). */
frame.sa_type = type;
frame.sa_sas = sas;
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
#endif
frame.sa_arg = ap;
sf = (struct saframe *)sp - 1;
if (copyout(&frame, sf, sizeof(frame)) != 0) {
/* Copying onto the stack didn't work. Die. */
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_r0 = type;
tf->tf_r1 = (int) sas;
tf->tf_r2 = nevents;
tf->tf_r3 = ninterrupted;
tf->tf_pc = (int) upcall;
#ifdef THUMB_CODE
if (((int) upcall) & 1)
tf->tf_spsr |= PSR_T_bit;
else
tf->tf_spsr &= ~PSR_T_bit;
#endif
tf->tf_usr_sp = (int) sf;
tf->tf_usr_lr = 0; /* no return */
}
#endif /* KERN_SA */
void
cpu_need_resched(struct cpu_info *ci, int flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.52 2012/02/11 23:16:15 martin Exp $ */
/* $NetBSD: syscall.c,v 1.53 2012/02/19 21:06:04 rmind Exp $ */
/*-
* Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@ -71,9 +71,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.52 2012/02/11 23:16:15 martin Exp $");
#include "opt_sa.h"
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.53 2012/02/19 21:06:04 rmind Exp $");
#include <sys/device.h>
#include <sys/errno.h>
@ -87,7 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.52 2012/02/11 23:16:15 martin Exp $");
#include <uvm/uvm_extern.h>
#include <sys/savar.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/pcb.h>
@ -121,12 +118,6 @@ swi_handler(trapframe_t *frame)
frame->tf_pc += INSN_SIZE;
#endif
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
#ifndef THUMB_CODE
/*
* Make sure the program counter is correctly aligned so we

View File

@ -1,4 +1,4 @@
/* $NetBSD: fault.c,v 1.79 2012/02/09 23:32:55 christos Exp $ */
/* $NetBSD: fault.c,v 1.80 2012/02/19 21:06:04 rmind Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@ -79,18 +79,15 @@
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "opt_sa.h"
#include <sys/types.h>
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.79 2012/02/09 23:32:55 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.80 2012/02/19 21:06:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/kernel.h>
#include <sys/kauth.h>
#include <sys/savar.h>
#include <sys/cpu.h>
#include <uvm/uvm_extern.h>
@ -387,12 +384,6 @@ data_abort_handler(trapframe_t *tf)
}
} else {
map = &l->l_proc->p_vmspace->vm_map;
#ifdef KERN_SA
if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)far;
l->l_pflag |= LP_SA_PAGEFAULT;
}
#endif
}
/*
@ -453,10 +444,6 @@ data_abort_handler(trapframe_t *tf)
last_fault_code = fsr;
#endif
if (pmap_fault_fixup(map->pmap, va, ftype, user)) {
#ifdef KERN_SA
if (map != kernel_map)
l->l_pflag &= ~LP_SA_PAGEFAULT;
#endif
UVMHIST_LOG(maphist, " <- ref/mod emul", 0, 0, 0, 0);
goto out;
}
@ -476,11 +463,6 @@ data_abort_handler(trapframe_t *tf)
error = uvm_fault(map, va, ftype);
pcb->pcb_onfault = onfault;
#ifdef KERN_SA
if (map != kernel_map)
l->l_pflag &= ~LP_SA_PAGEFAULT;
#endif
if (__predict_true(error == 0)) {
if (user)
uvm_grow(l->l_proc, va); /* Record any stack growth */
@ -866,21 +848,9 @@ prefetch_abort_handler(trapframe_t *tf)
}
#endif
#ifdef KERN_SA
if (map != kernel_map && (l->l_flag & LW_SA)) {
l->l_savp->savp_faultaddr = fault_pc;
l->l_pflag |= LP_SA_PAGEFAULT;
}
#endif
KASSERT(pcb->pcb_onfault == NULL);
error = uvm_fault(map, va, VM_PROT_READ);
#ifdef KERN_SA
if (map != kernel_map)
l->l_pflag &= ~LP_SA_PAGEFAULT;
#endif
if (__predict_true(error == 0)) {
UVMHIST_LOG (maphist, " <- uvm", 0, 0, 0, 0);
goto out;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.55 2011/02/10 14:46:46 pooka Exp $ */
/* $NetBSD: vm_machdep.c,v 1.56 2012/02/19 21:06:05 rmind Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.55 2011/02/10 14:46:46 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.56 2012/02/19 21:06:05 rmind Exp $");
#include "opt_armfpe.h"
#include "opt_pmap_debug.h"
@ -101,20 +101,6 @@ cpu_proc_fork(struct proc *p1, struct proc *p2)
#endif
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf = pcb->pcb_tf;
struct switchframe *sf = (struct switchframe *)tf - 1;
sf->sf_r4 = (u_int)func;
sf->sf_r5 = (u_int)arg;
sf->sf_sp = (u_int)tf;
sf->sf_pc = (u_int)lwp_trampoline;
pcb->pcb_un.un_32.pcb32_sp = (u_int)sf;
}
/*
* Finish a fork operation, with LWP l2 nearly set up.
*
@ -133,6 +119,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
{
struct pcb *pcb1, *pcb2;
struct trapframe *tf;
struct switchframe *sf;
vaddr_t uv;
pcb1 = lwp_getpcb(l1);
@ -202,7 +189,12 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
if (stack != NULL)
tf->tf_usr_sp = (u_int)stack + stacksize;
cpu_setfunc(l2, func, arg);
sf = (struct switchframe *)tf - 1;
sf->sf_r4 = (u_int)func;
sf->sf_r5 = (u_int)arg;
sf->sf_sp = (u_int)tf;
sf->sf_pc = (u_int)lwp_trampoline;
pcb2->pcb_un.un_32.pcb32_sp = (u_int)sf;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.12 2009/11/21 20:32:27 rmind Exp $ */
/* $NetBSD: frame.h,v 1.13 2012/02/19 21:06:05 rmind Exp $ */
/*
* Copyright (c) 1994-1997 Mark Brinicombe.
@ -44,7 +44,6 @@
#ifndef _LOCORE
#include <sys/signal.h>
#include <sys/sa.h>
#include <sys/ucontext.h>
/*
@ -94,21 +93,6 @@ struct sigframe_siginfo {
ucontext_t sf_uc; /* actual saved ucontext */
};
/*
* Scheduler activations upcall frame. Pushed onto user stack before
* calling an SA upcall.
*/
struct saframe {
#if 0 /* in registers on entry to upcall */
int sa_type;
struct sa_t ** sa_sas;
int sa_events;
int sa_interrupted;
#endif
void * sa_arg;
};
#ifdef _KERNEL
__BEGIN_DECLS
void sendsig_sigcontext(const ksiginfo_t *, const sigset_t *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.111 2011/02/08 20:20:09 rmind Exp $ */
/* $NetBSD: trap.c,v 1.112 2012/02/19 21:06:05 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.111 2011/02/08 20:20:09 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.112 2012/02/19 21:06:05 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -57,8 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.111 2011/02/08 20:20:09 rmind Exp $");
#include <sys/resourcevar.h>
#include <sys/syslog.h>
#include <sys/syscall.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@ -597,11 +595,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -644,7 +637,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -663,7 +655,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
type, code);
panictrap(type, code, v, fp);
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.55 2011/02/08 20:20:10 rmind Exp $ */
/* $NetBSD: trap.c,v 1.56 2012/02/19 21:06:06 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.55 2011/02/08 20:20:10 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.56 2012/02/19 21:06:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -56,8 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.55 2011/02/08 20:20:10 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -550,11 +548,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -600,7 +593,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -617,7 +609,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.148 2011/02/08 20:20:13 rmind Exp $ */
/* $NetBSD: trap.c,v 1.149 2012/02/19 21:06:07 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.148 2011/02/08 20:20:13 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.149 2012/02/19 21:06:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -56,8 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.148 2011/02/08 20:20:13 rmind Exp $");
#include <sys/signalvar.h>
#include <sys/ras.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@ -544,11 +542,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -594,7 +587,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -611,7 +603,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: hppa_machdep.c,v 1.26 2011/12/08 21:00:49 skrll Exp $ */
/* $NetBSD: hppa_machdep.c,v 1.27 2012/02/19 21:06:07 rmind Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -27,13 +27,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.26 2011/12/08 21:00:49 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.27 2012/02/19 21:06:07 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sa.h>
#include <sys/lwp.h>
#include <sys/savar.h>
#include <sys/proc.h>
#include <sys/ras.h>
#include <sys/cpu.h>
@ -56,87 +54,6 @@ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */
* that there's related code already in hppa/hppa/trap.S.
*/
/*
* Scheduler activations upcall frame. Pushed onto user stack before
* calling an SA upcall.
*/
struct saframe {
/* first 4 arguments passed in registers on entry to upcallcode */
void * sa_arg;
int sa_interrupted; /* arg3 */
int sa_events; /* arg2 */
struct sa_t ** sa_sas; /* arg1 */
int sa_type; /* arg0 */
};
/*
* cpu_upcall:
*
* Send an an upcall to userland.
*/
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct saframe *sf, frame;
struct proc *p = l->l_proc;
struct trapframe *tf;
uintptr_t upva;
vaddr_t va;
tf = (struct trapframe *)l->l_md.md_regs;
frame.sa_type = type;
frame.sa_sas = sas;
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
frame.sa_arg = ap;
pmap_activate(l);
va = HPPA_FRAME_ROUND((uintptr_t)sp + sizeof(frame) + HPPA_FRAME_SIZE);
sf = (void *)(va - 32 - sizeof(frame));
if (copyout(&frame, sf, sizeof(frame)) != 0) {
/* Copying onto the stack didn't work. Die. */
mutex_enter(p->p_lock);
sigexit(l, SIGILL);
/* NOTREACHED */
}
/*
* Deal with the upcall function pointer being a PLABEL.
*/
upva = (uintptr_t)upcall;
if (upva & 2) {
upva &= ~3;
if (copyin((void *)(upva + 4), &tf->tf_t4, 4)) {
printf("copyin t4 failed\n");
mutex_enter(p->p_lock);
sigexit(l, SIGILL);
/* NOTREACHED */
}
if (copyin((void *)upva, &upcall, 4)) {
printf("copyin upcall failed\n");
mutex_enter(p->p_lock);
sigexit(l, SIGILL);
/* NOTREACHED */
}
}
tf->tf_iioq_head = (uintptr_t)upcall | HPPA_PC_PRIV_USER;
tf->tf_iioq_tail = tf->tf_iioq_head + 4;
tf->tf_sp = va;
tf->tf_arg0 = type;
tf->tf_arg1 = (uintptr_t)sas;
tf->tf_arg2 = nevents;
tf->tf_arg3 = ninterrupted;
tf->tf_rp = 0;
}
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.97 2012/02/13 01:07:37 martin Exp $ */
/* $NetBSD: trap.c,v 1.98 2012/02/19 21:06:08 rmind Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.97 2012/02/13 01:07:37 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.98 2012/02/19 21:06:08 rmind Exp $");
/* #define INTRDEBUG */
/* #define TRAPDEBUG */
@ -66,15 +66,12 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.97 2012/02/13 01:07:37 martin Exp $");
#include "opt_kgdb.h"
#include "opt_ptrace.h"
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/mutex.h>
#include <sys/ktrace.h>
#include <sys/proc.h>
@ -853,11 +850,6 @@ do_onfault:
map = kernel_map;
else {
map = &vm->vm_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = va;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
va = trunc_page(va);
@ -884,9 +876,6 @@ do_onfault:
map, (u_int)va, vftype, ret);
#endif
if (map != kernel_map)
l->l_pflag &= ~LP_SA_PAGEFAULT;
/*
* If this was a stack access we keep track of the maximum
* accessed stack size. Also, if uvm_fault gets a protection
@ -1155,12 +1144,6 @@ syscall(struct trapframe *frame, int *args)
code = frame->tf_t1;
LWP_CACHE_CREDS(l, p);
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
/*
* Restarting a system call is touchy on the HPPA, because syscall
* arguments are passed in registers and the program counter of the
@ -1332,12 +1315,3 @@ startlwp(void *arg)
kmem_free(uc, sizeof(ucontext_t));
userret(l, l->l_md.md_regs->tf_iioq_head, 0);
}
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
userret(l, l->l_md.md_regs->tf_iioq_head, 0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.49 2011/02/24 04:28:45 joerg Exp $ */
/* $NetBSD: vm_machdep.c,v 1.50 2012/02/19 21:06:08 rmind Exp $ */
/* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.49 2011/02/24 04:28:45 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.50 2012/02/19 21:06:08 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -182,44 +182,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
fdcache(HPPA_SID_KERNEL, uv, sp - uv);
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
vaddr_t uv = uvm_lwp_getuarea(l);
struct trapframe *tf;
register_t sp, osp;
sp = (register_t)pcb + PAGE_SIZE;
l->l_md.md_regs = tf = (struct trapframe *)sp;
sp += sizeof(struct trapframe);
cpu_activate_pcb(l);
/*
* Build stack frames for the cpu_switchto & co.
*/
osp = sp;
/* setfunc_trampoline's frame */
sp += HPPA_FRAME_SIZE;
*(register_t *)(sp) = 0; /* previous frame pointer */
*(register_t *)(sp + HPPA_FRAME_PSP) = osp;
*(register_t *)(sp + HPPA_FRAME_CRP) = (register_t)lwp_trampoline;
*HPPA_FRAME_CARG(2, sp) = KERNMODE(func);
*HPPA_FRAME_CARG(3, sp) = (register_t)arg;
/*
* cpu_switchto's frame
* stack usage is std frame + callee-save registers
*/
sp += HPPA_FRAME_SIZE + 16*4;
pcb->pcb_ksp = sp;
fdcache(HPPA_SID_KERNEL, uv, sp - uv);
}
void
cpu_lwp_free(struct lwp *l, int proc)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $ */
/* $NetBSD: machdep.c,v 1.718 2012/02/19 21:06:08 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.718 2012/02/19 21:06:08 rmind Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -109,8 +109,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.717 2012/01/12 19:49:37 cherry Exp $")
#include <sys/kcore.h>
#include <sys/ucontext.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/ksyms.h>
#include <sys/device.h>
@ -810,44 +808,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
l->l_sigstk.ss_flags |= SS_ONSTACK;
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas,
void *ap, void *sp, sa_upcall_t upcall)
{
struct pmap *pmap = vm_map_pmap(&l->l_proc->p_vmspace->vm_map);
struct saframe *sf, frame;
struct trapframe *tf;
tf = l->l_md.md_regs;
/* Finally, copy out the rest of the frame. */
frame.sa_type = type;
frame.sa_sas = sas;
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
frame.sa_arg = ap;
frame.sa_ra = 0;
sf = (struct saframe *)sp - 1;
if (copyout(&frame, sf, sizeof(frame)) != 0) {
/* Copying onto the stack didn't work. Die. */
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_eip = (int) upcall;
tf->tf_esp = (int) sf;
tf->tf_ebp = 0; /* indicate call-frame-top to debuggers */
tf->tf_gs = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_fs = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_cs = pmap->pm_hiexec > I386_MAX_EXE_ADDR ?
GSEL(GUCODEBIG_SEL, SEL_UPL) : GSEL(GUCODE_SEL, SEL_UPL);
tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL);
tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
}
static void
maybe_dump(int howto)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.262 2011/09/07 09:24:55 reinoud Exp $ */
/* $NetBSD: trap.c,v 1.263 2012/02/19 21:06:11 rmind Exp $ */
/*-
* Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.262 2011/09/07 09:24:55 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.263 2012/02/19 21:06:11 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -92,8 +92,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.262 2011/09/07 09:24:55 reinoud Exp $");
#include <sys/syscall.h>
#include <sys/cpu.h>
#include <sys/ucontext.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <uvm/uvm_extern.h>
@ -636,10 +634,6 @@ kernelfault:
extern struct vm_map *kernel_map;
cr2 = rcr2();
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)cr2;
l->l_pflag |= LP_SA_PAGEFAULT;
}
faultcommon:
vm = p->p_vmspace;
if (__predict_false(vm == NULL)) {
@ -728,7 +722,6 @@ faultcommon:
*/
pfail = kpreempt(0);
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
KSI_INIT_TRAP(&ksi);
@ -759,7 +752,6 @@ faultcommon:
ksi.ksi_signo = SIGSEGV;
}
(*p->p_emul->e_trapsignal)(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
@ -832,13 +824,3 @@ startlwp(void *arg)
kmem_free(uc, sizeof(ucontext_t));
userret(l);
}
/*
* XXX_SA: This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
KERNEL_UNLOCK_LAST(l);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.34 2011/06/02 18:46:51 dsl Exp $ */
/* $NetBSD: frame.h,v 1.35 2012/02/19 21:06:11 rmind Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -67,7 +67,6 @@
#define _I386_FRAME_H_
#include <sys/signal.h>
#include <sys/sa.h>
/*
* System stack frames.
@ -170,18 +169,6 @@ struct sigframe_siginfo {
ucontext_t sf_uc; /* actual saved ucontext */
};
/*
* Scheduler activations upcall frame
*/
struct saframe {
int sa_ra;
int sa_type;
struct sa_t** sa_sas;
int sa_events;
int sa_interrupted;
void* sa_arg;
};
#ifdef _KERNEL
void *getframe(struct lwp *, int, int *);
void buildcontext(struct lwp *, int, void *, void *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.30 2011/10/01 15:59:28 chs Exp $ */
/* $NetBSD: machdep.c,v 1.31 2012/02/19 21:06:12 rmind Exp $ */
/*-
* Copyright (c) 2003,2004 Marcel Moolenaar
@ -93,8 +93,6 @@
#include <sys/cpu.h>
#include <sys/exec.h>
#include <sys/ksyms.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/msgbuf.h>
#include <sys/mutex.h>
#include <sys/proc.h>
@ -777,12 +775,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
return;
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
return;
}
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.9 2009/07/20 04:41:37 kiyohara Exp $ */
/* $NetBSD: trap.c,v 1.10 2012/02/19 21:06:12 rmind Exp $ */
/*-
* Copyright (c) 2005 Marcel Moolenaar
@ -61,13 +61,11 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.9 2009/07/20 04:41:37 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.10 2012/02/19 21:06:12 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/userret.h>
@ -325,13 +323,6 @@ printf("%s: not yet\n", __func__);
return;
}
void
upcallret(struct lwp *l)
{
printf("%s: not yet\n", __func__);
return;
}
#ifdef DDB
int call_debugger = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.67 2011/02/08 20:20:16 rmind Exp $ */
/* $NetBSD: trap.c,v 1.68 2012/02/19 21:06:13 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.67 2011/02/08 20:20:16 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.68 2012/02/19 21:06:13 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -53,8 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.67 2011/02/08 20:20:16 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -499,11 +497,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -549,7 +542,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -566,7 +558,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: m68k.h,v 1.21 2011/12/22 15:50:37 tsutsui Exp $ */
/* $NetBSD: m68k.h,v 1.22 2012/02/19 21:06:13 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -112,7 +112,6 @@ void lwp_trampoline(void);
void m68881_save(struct fpframe *);
void m68881_restore(struct fpframe *);
void savectx(struct pcb *);
void setfunc_trampoline(void);
/* w16copy.s */
void w16zero(void *, u_int);

View File

@ -1,53 +0,0 @@
/* $NetBSD: saframe.h,v 1.7 2008/10/15 06:52:38 wrstuden Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _M68K_SAFRAME_H
#define _M68K_SAFRAME_H
#include <sys/sa.h>
/*
* Scheduler activations upcall frame
*/
struct saframe {
int sa_ra;
int sa_type;
struct sa_t** sa_sas;
int sa_events;
int sa_interrupted;
void* sa_arg;
};
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: m68k_syscall.c,v 1.47 2012/02/11 23:16:15 martin Exp $ */
/* $NetBSD: m68k_syscall.c,v 1.48 2012/02/19 21:06:14 rmind Exp $ */
/*-
* Portions Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -65,12 +65,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: m68k_syscall.c,v 1.47 2012/02/11 23:16:15 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: m68k_syscall.c,v 1.48 2012/02/19 21:06:14 rmind Exp $");
#include "opt_execfmt.h"
#include "opt_compat_netbsd.h"
#include "opt_compat_aout_m68k.h"
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/systm.h>
@ -78,8 +77,6 @@ __KERNEL_RCSID(0, "$NetBSD: m68k_syscall.c,v 1.47 2012/02/11 23:16:15 martin Exp
#include <sys/kmem.h>
#include <sys/acct.h>
#include <sys/kernel.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
#include <sys/syslog.h>
@ -124,12 +121,6 @@ syscall(register_t code, struct frame frame)
l->l_md.md_regs = frame.f_regs;
LWP_CACHE_CREDS(l, p);
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
(p->p_md.md_syscall)(code, l, &frame);
machine_userret(l, &frame, sticks);
@ -436,17 +427,6 @@ startlwp(void *arg)
machine_userret(l, f, 0);
}
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
struct frame *f = (struct frame *)l->l_md.md_regs;
machine_userret(l, f, 0);
}
/*
* Process the tail end of a posix_spawn() for the child.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.47 2011/12/22 15:47:15 tsutsui Exp $ */
/* $NetBSD: sig_machdep.c,v 1.48 2012/02/19 21:06:14 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -40,7 +40,7 @@
#include "opt_m68k_arch.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.47 2011/12/22 15:47:15 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.48 2012/02/19 21:06:14 rmind Exp $");
#define __M68K_SIGNAL_PRIVATE
@ -51,8 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.47 2011/12/22 15:47:15 tsutsui Exp
#include <sys/pool.h>
#include <sys/proc.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <sys/ucontext.h>
@ -64,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.47 2011/12/22 15:47:15 tsutsui Exp
#include <machine/frame.h>
#include <m68k/m68k.h>
#include <m68k/saframe.h>
#include <m68k/fpreg.h>
extern short exframesize[];
@ -195,36 +192,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
l->l_sigstk.ss_flags |= SS_ONSTACK;
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas,
void *ap, void *sp, sa_upcall_t upcall)
{
struct saframe *sfp, sf;
struct frame *frame;
frame = (struct frame *)l->l_md.md_regs;
/* Finally, copy out the rest of the frame */
sf.sa_ra = 0;
sf.sa_type = type;
sf.sa_sas = sas;
sf.sa_events = nevents;
sf.sa_interrupted = ninterrupted;
sf.sa_arg = ap;
sfp = (struct saframe *)sp - 1;
if (copyout(&sf, sfp, sizeof(sf)) != 0) {
/* Copying onto the stack didn't work. Die. */
sigexit(l, SIGILL);
/* NOTREACHED */
}
frame->f_pc = (int)upcall;
frame->f_regs[SP] = (int) sfp;
frame->f_regs[A6] = 0; /* indicate call-frame-top to debuggers */
frame->f_sr &= ~PSL_T;
}
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, u_int *flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: switch_subr.s,v 1.28 2011/12/22 15:33:29 tsutsui Exp $ */
/* $NetBSD: switch_subr.s,v 1.29 2012/02/19 21:06:15 rmind Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation.
@ -425,16 +425,3 @@ ENTRY_NOPROFILE(lwp_trampoline)
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Very similar to lwp_trampoline, but do not call lwp_startup
*/
ENTRY_NOPROFILE(setfunc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.37 2011/02/10 14:46:46 pooka Exp $ */
/* $NetBSD: vm_machdep.c,v 1.38 2012/02/19 21:06:15 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.37 2011/02/10 14:46:46 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.38 2012/02/19 21:06:15 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -127,19 +127,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
pcb2->pcb_ps = PSL_LOWIPL; /* start kthreads at IPL 0 */
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf = (struct trapframe *)l->l_md.md_regs;
struct switchframe *sf = (struct switchframe *)tf - 1;
sf->sf_pc = (u_int)setfunc_trampoline;
pcb->pcb_regs[6] = (int)func; /* A2 */
pcb->pcb_regs[7] = (int)arg; /* A3 */
pcb->pcb_regs[11] = (int)sf; /* SSP */
}
void
cpu_lwp_free(struct lwp *l, int proc)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.145 2011/02/08 20:20:18 rmind Exp $ */
/* $NetBSD: trap.c,v 1.146 2012/02/19 21:06:15 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.145 2011/02/08 20:20:18 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.146 2012/02/19 21:06:15 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -55,8 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.145 2011/02/08 20:20:18 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -544,11 +542,6 @@ copyfault:
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
ftype = VM_PROT_WRITE;
@ -590,7 +583,6 @@ copyfault:
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -607,7 +599,6 @@ copyfault:
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.8 2008/10/15 06:51:18 wrstuden Exp $ */
/* $NetBSD: frame.h,v 1.9 2012/02/19 21:06:16 rmind Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -40,22 +40,6 @@
#endif
#include <sys/signal.h>
#include <sys/sa.h>
/*
* Scheduler activations upcall frame. Pushed onto user stack before
* calling an SA upcall.
*/
struct saframe {
/* first 4 arguments passed in registers on entry to upcallcode */
int sa_type; /* A0 */
struct sa_t ** sa_sas; /* A1 */
int sa_events; /* A2 */
int sa_interrupted; /* A3 */
void * sa_arg;
sa_upcall_t sa_upcall;
};
void *getframe(struct lwp *, int, int *);
#if defined(COMPAT_16) || defined(COMPAT_ULTRIX)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.h,v 1.92 2011/08/17 14:39:59 matt Exp $ */
/* $NetBSD: locore.h,v 1.93 2012/02/19 21:06:16 rmind Exp $ */
/*
* This file should not be included by MI code!!!
@ -324,7 +324,6 @@ mips3_sw_a64(uint64_t addr, uint32_t val)
typedef struct {
void (*ljv_cpu_switch_resume)(struct lwp *);
intptr_t ljv_lwp_trampoline;
intptr_t ljv_setfunc_trampoline;
void (*ljv_wbflush)(void);
void (*ljv_tlb_set_asid)(uint32_t pid);
void (*ljv_tlb_invalidate_asids)(uint32_t, uint32_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.h,v 1.2 2009/12/14 00:46:05 matt Exp $ */
/* $NetBSD: netbsd32_machdep.h,v 1.3 2012/02/19 21:06:16 rmind Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -51,12 +51,10 @@ typedef netbsd32_pointer_t netbsd32_sigcontextp_t;
#define netbsd32_esigcode esigcode
/*
* cpu_upcall knows about COMPAT_NETBSD32
* syscall_intern and setregs don't about COMPAT_NETBSD32.
* Note: syscall_intern and setregs do not care about COMPAT_NETBSD32.
*/
#define netbsd32_syscall_intern syscall_intern
#define netbsd32_setregs setregs
#define netbsd32_cpu_upcall cpu_upcall
/* <mips/sysarch.h> */
struct mips_cacheflush_args32 {
@ -71,15 +69,4 @@ struct mips_cachectl_args32 {
int ctl;
};
/* <mips/frame.h> */
struct saframe32 {
/* first 4 arguments passed in registers on entry to upcallcode */
int sa_type; /* A0 */
netbsd32_pointer_t sa_sas; /* A1 */
int sa_events; /* A2 */
int sa_interrupted; /* A3 */
netbsd32_pointer_t sa_arg;
netbsd32_pointer_t sa_upcall;
};
#endif /* _MACHINE_NETBSD32_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_subr.c,v 1.14 2011/08/16 06:58:15 matt Exp $ */
/* $NetBSD: cpu_subr.c,v 1.15 2012/02/19 21:06:16 rmind Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -30,11 +30,10 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.14 2011/08/16 06:58:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.15 2012/02/19 21:06:16 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/cpu.h>
@ -47,10 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.14 2011/08/16 06:58:15 matt Exp $");
#include <sys/bitops.h>
#include <sys/idle.h>
#include <sys/xcall.h>
#ifdef KERN_SA
#include <sys/sa.h>
#include <sys/savar.h>
#endif
#include <uvm/uvm.h>
@ -315,75 +310,6 @@ cpu_startup_common(void)
printf("avail memory = %s\n", pbuf);
}
#ifdef KERN_SA
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
userret(l);
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf = l->l_md.md_utf;
struct saframe frame;
#ifdef COMPAT_NETBSD32
struct saframe32 frame32;
#endif
void *ksf, *usf;
size_t sfsz;
#if 0 /* First 4 args in regs (see below). */
frame.sa_type = type;
frame.sa_sas = sas;
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
#endif
#ifdef COMPAT_NETBSD32
switch (l->l_proc->p_md.md_abi) {
case _MIPS_BSD_API_O32:
case _MIPS_BSD_API_N32:
NETBSD32PTR32(frame32.sa_arg, ap);
NETBSD32PTR32(frame32.sa_upcall, upcall);
ksf = &frame32;
usf = (struct saframe32 *)sp - 1;
sfsz = sizeof(frame32);
break;
default:
#endif
frame.sa_arg = ap;
frame.sa_upcall = upcall;
ksf = &frame;
usf = (struct saframe *)sp - 1;
sfsz = sizeof(frame);
#ifdef COMPAT_NETBSD32
break;
}
#endif
if (copyout(ksf, usf, sfsz) != 0) {
/* Copying onto the stack didn't work. Die. */
mutex_enter(l->l_proc->p_lock);
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_regs[_R_PC] = (intptr_t)upcall;
tf->tf_regs[_R_SP] = (intptr_t)usf;
tf->tf_regs[_R_A0] = type;
tf->tf_regs[_R_A1] = (intptr_t)sas;
tf->tf_regs[_R_A2] = nevents;
tf->tf_regs[_R_A3] = ninterrupted;
tf->tf_regs[_R_S8] = 0;
tf->tf_regs[_R_RA] = 0;
tf->tf_regs[_R_T9] = (intptr_t)upcall; /* t9=Upcall function*/
}
#endif /* KERN_SA */
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_mips1.S,v 1.83 2011/12/23 10:01:33 tsutsui Exp $ */
/* $NetBSD: locore_mips1.S,v 1.84 2012/02/19 21:06:17 rmind Exp $ */
/*
* Copyright (c) 1992, 1993
@ -1465,12 +1465,12 @@ END(MIPSX(tlb_enter))
LEAF(MIPSX(lwp_trampoline))
PTR_ADDU sp, -CALLFRAME_SIZ
# Call lwp_startup(), with args from cpu_switchto()/cpu_setfunc()
# Call lwp_startup(), with args from cpu_switchto()/cpu_lwp_fork()
move a0, v0
jal _C_LABEL(lwp_startup)
move a1, MIPS_CURLWP
# Call the routine specified by cpu_setfunc()
# Call the routine specified by cpu_lwp_fork()
jalr s0
move a0, s1
@ -1522,18 +1522,6 @@ MIPSX(user_intr_return):
.set at
END(MIPSX(lwp_trampoline))
/*
* Like lwp_trampoline, but do not call lwp_startup
*/
LEAF(MIPSX(setfunc_trampoline))
PTR_ADDU sp, -CALLFRAME_SIZ
# Call the routine specified by cpu_setfunc()
PTR_LA ra, MIPSX(user_return)
jr s0
move a0, s1
END(MIPSX(setfunc_trampoline))
/*
* void mipsN_cpu_switch_resume(struct lwp *newlwp)
*
@ -1690,7 +1678,6 @@ END(MIPSX(wbflush))
_C_LABEL(MIPSX(locore_vec)):
PTR_WORD _C_LABEL(MIPSX(cpu_switch_resume))
PTR_WORD _C_LABEL(MIPSX(lwp_trampoline))
PTR_WORD _C_LABEL(MIPSX(setfunc_trampoline))
PTR_WORD _C_LABEL(MIPSX(wbflush)) # wbflush
PTR_WORD _C_LABEL(MIPSX(tlb_set_asid))
PTR_WORD _C_LABEL(MIPSX(tlb_invalidate_asids))

View File

@ -1,4 +1,4 @@
/* $NetBSD: mipsX_subr.S,v 1.55 2011/11/03 18:27:07 matt Exp $ */
/* $NetBSD: mipsX_subr.S,v 1.56 2012/02/19 21:06:18 rmind Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -2337,12 +2337,12 @@ END(MIPSX(tlb_enter))
LEAF(MIPSX(lwp_trampoline))
PTR_ADDU sp, -CALLFRAME_SIZ
# Call lwp_startup(), with args from cpu_switchto()/cpu_setfunc()
# Call lwp_startup(), with args from cpu_switchto()/cpu_lwp_fork()
move a0, v0
jal _C_LABEL(lwp_startup)
move a1, MIPS_CURLWP
# Call the routine specified by cpu_setfunc()
# Call the routine specified by cpu_lwp_fork()
jalr s0
move a0, s1
@ -2416,21 +2416,6 @@ MIPSX(user_intr_return):
.set at
END(MIPSX(lwp_trampoline))
/*
* Like lwp_trampoline, but do not call lwp_startup
*/
LEAF(MIPSX(setfunc_trampoline))
PTR_ADDU sp, -CALLFRAME_SIZ
# Call the routine specified by cpu_setfunc()
# and return directly to user_return
PTR_LA ra, MIPSX(user_return)
move t9, s0
jr t9
move a0, s1
END(MIPSX(setfunc_trampoline))
/*
* void mipsN_cpu_switch_resume(struct lwp *newlwp)
*
@ -2686,7 +2671,6 @@ END(MIPSX(pagezero))
_C_LABEL(MIPSX(locore_vec)):
PTR_WORD _C_LABEL(MIPSX(cpu_switch_resume))
PTR_WORD _C_LABEL(MIPSX(lwp_trampoline))
PTR_WORD _C_LABEL(MIPSX(setfunc_trampoline))
PTR_WORD _C_LABEL(MIPSX(wbflush)) # wbflush
PTR_WORD _C_LABEL(MIPSX(tlb_set_asid))
PTR_WORD _C_LABEL(MIPSX(tlb_invalidate_asids))

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_machdep.c,v 1.252 2012/02/11 23:16:15 martin Exp $ */
/* $NetBSD: mips_machdep.c,v 1.253 2012/02/19 21:06:18 rmind Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -112,7 +112,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.252 2012/02/11 23:16:15 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.253 2012/02/19 21:06:18 rmind Exp $");
#define __INTR_PRIVATE
#include "opt_cputype.h"
@ -134,8 +134,6 @@ __KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.252 2012/02/11 23:16:15 martin Ex
#include <sys/kcore.h>
#include <sys/kmem.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/cpu.h>
#include <sys/atomic.h>
#include <sys/ucontext.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.7 2011/05/02 00:29:54 rmind Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.8 2012/02/19 21:06:19 rmind Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -30,10 +30,9 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.7 2011/05/02 00:29:54 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.8 2012/02/19 21:06:19 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_sa.h"
#include "opt_coredump.h"
#include <sys/param.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.46 2011/09/27 01:02:34 jym Exp $ */
/* $NetBSD: syscall.c,v 1.47 2012/02/19 21:06:19 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -68,18 +68,12 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.46 2011/09/27 01:02:34 jym Exp $");
#if defined(_KERNEL_OPT)
#include "opt_sa.h"
#endif
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.47 2012/02/19 21:06:19 rmind Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
#include <sys/endian.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/signal.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
@ -159,12 +153,6 @@ EMULNAME(syscall)(struct lwp *l, u_int status, u_int cause, vaddr_t pc)
code -= SYSCALL_SHIFT;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
if (code == SYS_syscall
|| (code == SYS___syscall && abi != _MIPS_BSD_API_O32)) {
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.234 2011/11/24 04:17:46 matt Exp $ */
/* $NetBSD: trap.c,v 1.235 2012/02/19 21:06:20 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.234 2011/11/24 04:17:46 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.235 2012/02/19 21:06:20 rmind Exp $");
#include "opt_cputype.h" /* which mips CPU levels do we support? */
#include "opt_ddb.h"
@ -56,8 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.234 2011/11/24 04:17:46 matt Exp $");
#include <sys/syscall.h>
#include <sys/buf.h>
#include <sys/ktrace.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/kauth.h>
#include <sys/atomic.h>
@ -413,11 +411,6 @@ trap(uint32_t status, uint32_t cause, vaddr_t vaddr, vaddr_t pc,
}
#endif /* PMAP_FAULTINFO */
if ((l->l_flag & LW_SA) && (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)vaddr;
l->l_pflag |= LP_SA_PAGEFAULT;
}
onfault = pcb->pcb_onfault;
pcb->pcb_onfault = NULL;
if (p->p_emul->e_fault)
@ -445,7 +438,6 @@ trap(uint32_t status, uint32_t cause, vaddr_t vaddr, vaddr_t pc,
else if (rv == EACCES)
rv = EFAULT;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
if (rv == 0) {
#ifdef PMAP_FAULTINFO
if (pfi->pfi_repeats == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.141 2011/09/27 01:02:34 jym Exp $ */
/* $NetBSD: vm_machdep.c,v 1.142 2012/02/19 21:06:20 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.141 2011/09/27 01:02:34 jym Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.142 2012/02/19 21:06:20 rmind Exp $");
#include "opt_ddb.h"
#include "opt_coredump.h"
@ -53,8 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.141 2011/09/27 01:02:34 jym Exp $")
#include <sys/vnode.h>
#include <sys/core.h>
#include <sys/exec.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <uvm/uvm.h>
@ -129,18 +127,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
}
}
#endif
cpu_setfunc(l2, func, arg);
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb * const pcb = lwp_getpcb(l);
struct trapframe * const tf = l->l_md.md_utf;
KASSERT(tf == (struct trapframe *)(uvm_lwp_getuarea(l) + USPACE) - 1);
/*
* Rig kernel stack so that it would start out in lwp_trampoline()
* and call child_return() with l as an argument. This causes the
@ -149,16 +135,16 @@ cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
* returns normally.
*/
pcb->pcb_context.val[_L_S0] = (intptr_t)func; /* S0 */
pcb->pcb_context.val[_L_S1] = (intptr_t)arg; /* S1 */
pcb->pcb_context.val[MIPS_CURLWP_LABEL] = (intptr_t)l; /* T8 */
pcb->pcb_context.val[_L_SP] = (intptr_t)tf; /* SP */
pcb->pcb_context.val[_L_RA] =
pcb2->pcb_context.val[_L_S0] = (intptr_t)func; /* S0 */
pcb2->pcb_context.val[_L_S1] = (intptr_t)arg; /* S1 */
pcb2->pcb_context.val[MIPS_CURLWP_LABEL] = (intptr_t)l2; /* T8 */
pcb2->pcb_context.val[_L_SP] = (intptr_t)tf; /* SP */
pcb2->pcb_context.val[_L_RA] =
mips_locore_jumpvec.ljv_lwp_trampoline; /* RA */
#ifdef _LP64
KASSERT(pcb->pcb_context.val[_L_SR] & MIPS_SR_KX);
KASSERT(pcb2->pcb_context.val[_L_SR] & MIPS_SR_KX);
#endif
KASSERT(pcb->pcb_context.val[_L_SR] & MIPS_SR_INT_IE);
KASSERT(pcb2->pcb_context.val[_L_SR] & MIPS_SR_INT_IE);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.105 2011/02/08 20:20:20 rmind Exp $ */
/* $NetBSD: trap.c,v 1.106 2012/02/19 21:06:21 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2011/02/08 20:20:20 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.106 2012/02/19 21:06:21 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -54,8 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2011/02/08 20:20:20 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syslog.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@ -559,11 +557,6 @@ trap(struct frame *fp, int type, unsigned int code, unsigned int v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -618,7 +611,6 @@ trap(struct frame *fp, int type, unsigned int code, unsigned int v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -635,7 +627,6 @@ trap(struct frame *fp, int type, unsigned int code, unsigned int v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.67 2011/02/08 20:20:21 rmind Exp $ */
/* $NetBSD: trap.c,v 1.68 2012/02/19 21:06:21 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.67 2011/02/08 20:20:21 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.68 2012/02/19 21:06:21 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -51,8 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.67 2011/02/08 20:20:21 rmind Exp $");
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/acct.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@ -515,11 +513,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -565,7 +558,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -582,7 +574,6 @@ trap(struct frame *fp, int type, u_int code, u_int v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.84 2011/02/08 20:20:21 rmind Exp $ */
/* $NetBSD: trap.c,v 1.85 2012/02/19 21:06:22 rmind Exp $ */
/*
* This file was taken from mvme68k/mvme68k/trap.c
@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2011/02/08 20:20:21 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2012/02/19 21:06:22 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -61,8 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2011/02/08 20:20:21 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -553,11 +551,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -610,7 +603,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -627,7 +619,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.13 2011/09/27 01:02:35 jym Exp $ */
/* $NetBSD: trap.c,v 1.14 2012/02/19 21:06:22 rmind Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@ -35,11 +35,10 @@
*/
#include "opt_ddb.h"
#include "opt_sa.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.13 2011/09/27 01:02:35 jym Exp $");
__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.14 2012/02/19 21:06:22 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -47,9 +46,6 @@ __KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.13 2011/09/27 01:02:35 jym Exp $");
#include <sys/lwp.h>
#include <sys/proc.h>
#include <sys/cpu.h>
#ifdef KERN_SA
#include <sys/savar.h>
#endif
#include <sys/kauth.h>
#include <sys/ras.h>
@ -167,20 +163,11 @@ pagefault(struct vm_map *map, vaddr_t va, vm_prot_t ftype, bool usertrap)
// printf("%s(%p,%#lx,%u,%u)\n", __func__, map, va, ftype, usertrap);
if (usertrap) {
#ifdef KERN_SA
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = va;
l->l_pflag |= LP_SA_PAGEFAULT;
}
#endif
rv = uvm_fault(map, trunc_page(va), ftype);
if (rv == 0)
uvm_grow(l->l_proc, trunc_page(va));
if (rv == EACCES)
rv = EFAULT;
#ifdef KERN_SA
l->l_pflag &= ~LP_SA_PAGEFAULT;
#endif
} else {
if (cpu_intr_p())
return EFAULT;
@ -193,9 +180,6 @@ pagefault(struct vm_map *map, vaddr_t va, vm_prot_t ftype, bool usertrap)
if (map != kernel_map) {
if (rv == 0)
uvm_grow(l->l_proc, trunc_page(va));
#ifdef KERN_SA
l->l_pflag &= ~LP_SA_PAGEFAULT;
#endif
}
if (rv == EACCES)
rv = EFAULT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.63 2011/12/13 11:03:53 kiyohara Exp $ */
/* $NetBSD: trap.c,v 1.64 2012/02/19 21:06:22 rmind Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63 2011/12/13 11:03:53 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.64 2012/02/19 21:06:22 rmind Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -78,8 +78,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.63 2011/12/13 11:03:53 kiyohara Exp $");
#include <sys/reboot.h>
#include <sys/syscall.h>
#include <sys/systm.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/userret.h>
#include <sys/kauth.h>
#include <sys/cpu.h>
@ -191,11 +189,6 @@ trap(struct trapframe *tf)
map = kernel_map;
} else {
map = &p->p_vmspace->vm_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = va;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (tf->tf_esr & (ESR_DST|ESR_DIZ))
@ -212,9 +205,6 @@ trap(struct trapframe *tf)
pcb->pcb_onfault = NULL;
rv = uvm_fault(map, trunc_page(va), ftype);
pcb->pcb_onfault = fb;
if (map != kernel_map) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
}
if (rv == 0)
goto done;
if (fb != NULL) {
@ -243,15 +233,10 @@ trap(struct trapframe *tf)
tf->tf_srr0, (ftype & VM_PROT_WRITE) ? "write" : "read",
tf->tf_dear, tf->tf_esr));
KASSERT(l == curlwp && (l->l_stat == LSONPROC));
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)tf->tf_dear;
l->l_pflag |= LP_SA_PAGEFAULT;
}
// KASSERT(curpcb->pcb_onfault == NULL);
rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(tf->tf_dear),
ftype);
if (rv == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
KSI_INIT_TRAP(&ksi);
@ -267,15 +252,10 @@ trap(struct trapframe *tf)
ksi.ksi_signo = SIGKILL;
}
trapsignal(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
case EXC_ITMISS|EXC_USER:
case EXC_ISI|EXC_USER:
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)tf->tf_srr0;
l->l_pflag |= LP_SA_PAGEFAULT;
}
ftype = VM_PROT_EXECUTE;
DBPRINTF(TDB_ALL,
("trap(EXC_ISI|EXC_USER) at %lx execute fault tf %p\n",
@ -284,7 +264,6 @@ trap(struct trapframe *tf)
rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(tf->tf_srr0),
ftype);
if (rv == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
KSI_INIT_TRAP(&ksi);
@ -293,7 +272,6 @@ trap(struct trapframe *tf)
ksi.ksi_addr = (void *)tf->tf_srr0;
ksi.ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
trapsignal(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
case EXC_AST|EXC_USER:

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.23 2011/06/20 07:31:18 matt Exp $ */
/* $NetBSD: frame.h,v 1.24 2012/02/19 21:06:23 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -160,12 +160,4 @@ struct callframe {
register_t cf_r31;
};
struct saframe {
register_t saf_r1; /* stack pointer */
register_t saf_lr; /* Callee lr save area */
#ifndef _LP64
register_t saf_fill[2]; /* Pad to multiple of 16 bytes */
#endif
};
#endif /* _POWERPC_FRAME_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_subr.S,v 1.47 2011/12/13 11:03:52 kiyohara Exp $ */
/* $NetBSD: locore_subr.S,v 1.48 2012/02/19 21:06:23 rmind Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -497,13 +497,6 @@ _ENTRY(cpu_lwp_bootstrap)
*/
bl _C_LABEL(lwp_startup)
/*
* Fall through into setfunc_trampoline
*/
.globl _C_LABEL(setfunc_trampoline)
_ENTRY(setfunc_trampoline)
mtlr %r31
mr %r3,%r30
blrl /* jump indirect to r31 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc_machdep.c,v 1.62 2012/02/11 23:16:16 martin Exp $ */
/* $NetBSD: powerpc_machdep.c,v 1.63 2012/02/19 21:06:24 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.62 2012/02/11 23:16:16 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.63 2012/02/19 21:06:24 rmind Exp $");
#include "opt_altivec.h"
#include "opt_modular.h"
@ -46,8 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.62 2012/02/11 23:16:16 martin
#include <sys/kauth.h>
#include <sys/pool.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/signal.h>
#include <sys/sysctl.h>
#include <sys/ucontext.h>
@ -334,35 +332,6 @@ cpu_spawn_return(struct lwp *l)
userret(l, tf);
}
void
upcallret(struct lwp *l)
{
struct trapframe * const tf = l->l_md.md_utf;
KERNEL_UNLOCK_LAST(l);
userret(l, tf);
}
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe * const tf = l->l_md.md_utf;
/*
* Build context to run handler in.
*/
tf->tf_fixreg[1] = (register_t)((struct saframe *)sp - 1);
tf->tf_lr = 0;
tf->tf_fixreg[3] = (register_t)type;
tf->tf_fixreg[4] = (register_t)sas;
tf->tf_fixreg[5] = (register_t)nevents;
tf->tf_fixreg[6] = (register_t)ninterrupted;
tf->tf_fixreg[7] = (register_t)ap;
tf->tf_srr0 = (register_t)upcall;
tf->tf_srr1 &= ~PSL_SE;
}
bool
cpu_intr_p(void)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.49 2011/12/13 11:03:51 kiyohara Exp $ */
/* $NetBSD: syscall.c,v 1.50 2012/02/19 21:06:24 rmind Exp $ */
/*
* Copyright (C) 2002 Matt Thomas
@ -34,7 +34,6 @@
#include "opt_altivec.h"
#include "opt_multiprocessor.h"
#include "opt_sa.h"
/* DO NOT INCLUDE opt_compat_XXX.h */
/* If needed, they will be included by file that includes this one */
@ -44,8 +43,6 @@
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallvar.h>
#include <uvm/uvm_extern.h>
@ -64,7 +61,7 @@
#define EMULNAME(x) (x)
#define EMULNAMEU(x) (x)
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.49 2011/12/13 11:03:51 kiyohara Exp $");
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.50 2012/02/19 21:06:24 rmind Exp $");
void
child_return(void *arg)
@ -107,12 +104,6 @@ EMULNAME(syscall_plain)(struct trapframe *tf)
params = tf->tf_fixreg + FIRSTARG;
n = NARGREG;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
{
switch (code) {
case EMULNAMEU(SYS_syscall):
@ -206,12 +197,6 @@ EMULNAME(syscall_fancy)(struct trapframe *tf)
params = tf->tf_fixreg + FIRSTARG;
n = NARGREG;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
realcode = code;
{
switch (code) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.145 2011/09/27 01:02:36 jym Exp $ */
/* $NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.145 2011/09/27 01:02:36 jym Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.146 2012/02/19 21:06:25 rmind Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -43,8 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.145 2011/09/27 01:02:36 jym Exp $");
#include <sys/proc.h>
#include <sys/ras.h>
#include <sys/reboot.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/systm.h>
#include <sys/kauth.h>
#include <sys/cpu.h>
@ -153,11 +151,6 @@ trap(struct trapframe *tf)
trunc_page(va), false)) {
return;
}
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = va;
l->l_pflag |= LP_SA_PAGEFAULT;
}
#if defined(DIAGNOSTIC) && !defined(PPC_OEA64) && !defined (PPC_IBM4XX)
} else if ((va >> ADDR_SR_SHFT) == USER_SR) {
printf("trap: kernel %s DSI trap @ %#lx by %#lx"
@ -186,7 +179,6 @@ trap(struct trapframe *tf)
*/
if (rv == 0)
uvm_grow(p, trunc_page(va));
l->l_pflag &= ~LP_SA_PAGEFAULT;
}
if (rv == 0)
return;
@ -243,10 +235,6 @@ trap(struct trapframe *tf)
break;
}
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)tf->tf_dar;
l->l_pflag |= LP_SA_PAGEFAULT;
}
KASSERT(pcb->pcb_onfault == NULL);
rv = uvm_fault(map, trunc_page(tf->tf_dar), ftype);
if (rv == 0) {
@ -254,7 +242,6 @@ trap(struct trapframe *tf)
* Record any stack growth...
*/
uvm_grow(p, trunc_page(tf->tf_dar));
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
ci->ci_ev_udsi_fatal.ev_count++;
@ -280,7 +267,6 @@ trap(struct trapframe *tf)
ksi.ksi_signo = SIGKILL;
}
(*p->p_emul->e_trapsignal)(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
case EXC_ISI:
@ -313,15 +299,10 @@ trap(struct trapframe *tf)
break;
}
if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)tf->tf_srr0;
l->l_pflag |= LP_SA_PAGEFAULT;
}
ftype = VM_PROT_EXECUTE;
KASSERT(pcb->pcb_onfault == NULL);
rv = uvm_fault(map, trunc_page(tf->tf_srr0), ftype);
if (rv == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
}
ci->ci_ev_isi_fatal.ev_count++;
@ -336,7 +317,6 @@ trap(struct trapframe *tf)
ksi.ksi_addr = (void *)tf->tf_srr0;
ksi.ksi_code = (rv == EACCES ? SEGV_ACCERR : SEGV_MAPERR);
(*p->p_emul->e_trapsignal)(l, &ksi);
l->l_pflag &= ~LP_SA_PAGEFAULT;
break;
case EXC_FPU|EXC_USER:

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.94 2012/02/13 13:44:14 phx Exp $ */
/* $NetBSD: vm_machdep.c,v 1.95 2012/02/19 21:06:25 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.94 2012/02/13 13:44:14 phx Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.95 2012/02/19 21:06:25 rmind Exp $");
#include "opt_altivec.h"
#include "opt_multiprocessor.h"
@ -117,15 +117,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
/*
* Now deal setting up the initial function and its argument.
*/
cpu_setfunc(l2, func, arg);
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
extern void setfunc_trampoline(void);
struct pcb * const pcb = lwp_getpcb(l);
struct ktrapframe * const ktf = ktrapframe(l);
struct ktrapframe * const ktf = ktrapframe(l2);
struct callframe * const cf = ((struct callframe *)ktf) - 1;
struct switchframe * const sf = ((struct switchframe *)cf) - 1;
@ -150,11 +142,11 @@ cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
#if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE)
sf->sf_user_sr = pmap_kernel()->pm_sr[USER_SR]; /* again, just in case */
#endif
pcb->pcb_sp = (register_t)sf;
pcb->pcb_kmapsr = 0;
pcb->pcb_umapsr = 0;
pcb2->pcb_sp = (register_t)sf;
pcb2->pcb_kmapsr = 0;
pcb2->pcb_umapsr = 0;
#ifdef PPC_HAVE_FPU
pcb->pcb_flags = PSL_FE_DFLT;
pcb2->pcb_flags = PSL_FE_DFLT;
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.19 2008/11/22 01:53:41 uwe Exp $ */
/* $NetBSD: frame.h,v 1.20 2012/02/19 21:06:26 rmind Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -161,19 +161,6 @@ struct sigframe_sigcontext {
};
#endif
/*
* Scheduler activations upcall frame
*/
struct saframe {
#if 0 /* in registers on entry to upcallcode */
int sa_type; /* r4 */
struct sa_t ** sa_sas; /* r5 */
int sa_events; /* r6 */
int sa_interrupted; /* r7 */
#endif
void * sa_arg;
};
#ifdef _KERNEL
void *getframe(const struct lwp *, int, int *);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: exception.c,v 1.61 2011/01/28 21:06:08 uwe Exp $ */
/* $NetBSD: exception.c,v 1.62 2012/02/19 21:06:26 rmind Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.61 2011/01/28 21:06:08 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: exception.c,v 1.62 2012/02/19 21:06:26 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -483,16 +483,3 @@ ast(struct lwp *l, struct trapframe *tf)
userret(l);
}
}
/*
* void upcallret(struct lwp *l):
*
* Perform userret() for an LWP.
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sh3_machdep.c,v 1.97 2012/02/12 16:34:10 matt Exp $ */
/* $NetBSD: sh3_machdep.c,v 1.98 2012/02/19 21:06:27 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.97 2012/02/12 16:34:10 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.98 2012/02/19 21:06:27 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -84,8 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.97 2012/02/12 16:34:10 matt Exp $"
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallargs.h>
#include <sys/ucontext.h>
#include <sys/cpu.h>
@ -329,47 +327,6 @@ dumpsys(void)
{
}
/*
* void cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
* void *sas, void *ap, void *sp, sa_upcall_t upcall):
*
* Send an upcall to userland.
*/
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas,
void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
struct saframe *sf, frame;
tf = l->l_md.md_regs;
/* Build the stack frame. */
#if 0 /* First 4 args in regs (see below). */
frame.sa_type = type;
frame.sa_sas = sas;
frame.sa_events = nevents;
frame.sa_interrupted = ninterrupted;
#endif
frame.sa_arg = ap;
sf = (struct saframe *)sp - 1;
if (copyout(&frame, sf, sizeof(frame)) != 0) {
/* Copying onto the stack didn't work. Die. */
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_r4 = type;
tf->tf_r5 = (int) sas;
tf->tf_r6 = nevents;
tf->tf_r7 = ninterrupted;
tf->tf_spc = (int) upcall;
tf->tf_pr = 0; /* no return */
tf->tf_r15 = (int) sf;
}
/*
* Get the base address of the signal frame either on the lwp's stack
* or on the signal stack and set *onstack accordingly. Caller then

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.13 2010/12/20 00:25:43 matt Exp $ */
/* $NetBSD: syscall.c,v 1.14 2012/02/19 21:06:27 rmind Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -78,13 +78,9 @@
* T.Horiuchi 1998.06.8
*/
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
@ -92,11 +88,9 @@
#include <uvm/uvm_extern.h>
static void syscall_plain(struct lwp *, struct trapframe *);
static void syscall_fancy(struct lwp *, struct trapframe *);
void
syscall_intern(struct proc *p)
{
@ -130,13 +124,6 @@ syscall_plain(struct lwp *l, struct trapframe *tf)
nsys = p->p_emul->e_nsysent;
callp = p->p_emul->e_sysent;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
params = (void *)tf->tf_r15;
switch (code) {
@ -269,13 +256,6 @@ syscall_fancy(struct lwp *l, struct trapframe *tf)
nsys = p->p_emul->e_nsysent;
callp = p->p_emul->e_sysent;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
params = (void *)tf->tf_r15;
switch (code) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.74 2012/02/13 01:04:26 martin Exp $ */
/* $NetBSD: vm_machdep.c,v 1.75 2012/02/19 21:06:27 rmind Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@ -81,7 +81,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.74 2012/02/13 01:04:26 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.75 2012/02/19 21:06:27 rmind Exp $");
#include "opt_kstack_debug.h"
@ -162,28 +162,6 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack,
sf->sf_r12 = (int)func;
}
/*
* Reset the stack pointer for the lwp and arrange for it to call the
* specified function with the specified argument on next switch.
*/
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
struct switchframe *sf = &pcb->pcb_sf;
sh3_setup_uarea(l);
l->l_md.md_regs->tf_ssr = PSL_USERSET;
/* When lwp is switched to, jump to the trampoline */
sf->sf_pr = (int)lwp_trampoline;
sf->sf_r10 = (int)l; /* "new" lwp for lwp_startup() */
sf->sf_r11 = (int)arg; /* hook function/argument */
sf->sf_r12 = (int)func;
}
static void
sh3_setup_uarea(struct lwp *l)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.92 2011/07/30 19:29:12 martin Exp $ */
/* $NetBSD: cpu.h,v 1.93 2012/02/19 21:06:28 rmind Exp $ */
/*
* Copyright (c) 1992, 1993
@ -203,7 +203,6 @@ int probeget(void *, int);
void write_all_windows(void);
void write_user_windows(void);
void lwp_trampoline(void);
void lwp_setfunc_trampoline(void);
struct pcb;
void snapshot(struct pcb *);
struct frame *getfp(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.265 2011/08/15 02:19:44 mrg Exp $ */
/* $NetBSD: locore.s,v 1.266 2012/02/19 21:06:28 rmind Exp $ */
/*
* Copyright (c) 1996 Paul Kranenburg
@ -5003,9 +5003,6 @@ ENTRY(snapshot)
*
* If were setting up a kernel thread, the function *(%l0) will not
* return.
*
* For KERN_SA applications, we provide an alternate entry point for
* cpu_setfunc() to use.
*/
ENTRY(lwp_trampoline)
/*
@ -5018,7 +5015,6 @@ ENTRY(lwp_trampoline)
call lwp_startup
mov %l2, %o1
_ENTRY(lwp_setfunc_trampoline)
call %l0
mov %l1, %o0

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.316 2012/02/12 16:34:10 matt Exp $ */
/* $NetBSD: machdep.c,v 1.317 2012/02/19 21:06:29 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.316 2012/02/12 16:34:10 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.317 2012/02/19 21:06:29 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_compat_sunos.h"
@ -84,7 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.316 2012/02/12 16:34:10 matt Exp $");
#include <sys/signalvar.h>
#include <sys/proc.h>
#include <sys/extent.h>
#include <sys/savar.h>
#include <sys/cpu.h>
#include <sys/buf.h>
#include <sys/device.h>
@ -598,41 +597,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
#endif
}
/*
* cpu_upcall:
*
* Send an an upcall to userland.
*/
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
vaddr_t addr;
tf = l->l_md.md_tf;
addr = (vaddr_t) upcall;
/* Arguments to the upcall... */
tf->tf_out[0] = type;
tf->tf_out[1] = (vaddr_t) sas;
tf->tf_out[2] = nevents;
tf->tf_out[3] = ninterrupted;
tf->tf_out[4] = (vaddr_t) ap;
/*
* Ensure the stack is double-word aligned, and provide a
* C call frame.
*/
sp = (void *)(((vaddr_t)sp & ~0x7) - CCFSZ);
/* Arrange to begin execution at the upcall handler. */
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
tf->tf_out[6] = (vaddr_t) sp;
tf->tf_out[7] = -1; /* "you lose" if upcall returns */
}
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{
@ -649,7 +613,7 @@ cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
* registers into the pcb; we need them in the process's memory.
*/
write_user_windows();
if ((l->l_flag & LW_SA_SWITCHING) == 0 && rwindow_save(l)) {
if (rwindow_save(l)) {
mutex_enter(l->l_proc->p_lock);
sigexit(l, SIGILL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.26 2012/02/11 23:16:16 martin Exp $ */
/* $NetBSD: syscall.c,v 1.27 2012/02/19 21:06:29 rmind Exp $ */
/*
* Copyright (c) 1996
@ -49,18 +49,15 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.26 2012/02/11 23:16:16 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.27 2012/02/19 21:06:29 rmind Exp $");
#include "opt_sparc_arch.h"
#include "opt_multiprocessor.h"
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
#include <sys/ktrace.h>
@ -235,12 +232,6 @@ syscall_plain(register_t code, struct trapframe *tf, register_t pc)
rval.o[0] = 0;
rval.o[1] = tf->tf_out[1];
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
error = sy_call(callp, l, &args, rval.o);
switch (error) {
@ -325,12 +316,6 @@ syscall_fancy(register_t code, struct trapframe *tf, register_t pc)
rval.o[0] = 0;
rval.o[1] = tf->tf_out[1];
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
error = sy_call(callp, l, &args, rval.o);
out:

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.188 2011/07/30 19:29:12 martin Exp $ */
/* $NetBSD: trap.c,v 1.189 2012/02/19 21:06:29 rmind Exp $ */
/*
* Copyright (c) 1996
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.188 2011/07/30 19:29:12 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.189 2012/02/19 21:06:29 rmind Exp $");
#include "opt_ddb.h"
#include "opt_compat_svr4.h"
@ -65,8 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.188 2011/07/30 19:29:12 martin Exp $");
#include <sys/resource.h>
#include <sys/signal.h>
#include <sys/wait.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/kauth.h>
@ -882,16 +880,6 @@ mem_access_fault(unsigned type, int ser, u_int v, int pc, int psr,
}
} else {
l->l_md.md_tf = tf;
/*
* WRS: Can drop LP_SA_NOBLOCK test iff can only get
* here from a usermode-initiated access. LP_SA_NOBLOCK
* should never be set there - it's kernel-only.
*/
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
/*
@ -979,7 +967,6 @@ kfault:
}
out:
if ((psr & PSR_PS) == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
userret(l, pc, sticks);
share_fpu(l, tf);
}
@ -1207,16 +1194,6 @@ mem_access_fault4m(unsigned type, u_int sfsr, u_int sfva, struct trapframe *tf)
}
} else {
l->l_md.md_tf = tf;
/*
* WRS: Can drop LP_SA_NOBLOCK test iff can only get
* here from a usermode-initiated access. LP_SA_NOBLOCK
* should never be set there - it's kernel-only.
*/
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)sfva;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
vm = p->p_vmspace;
@ -1277,7 +1254,6 @@ kfault:
}
out:
if ((psr & PSR_PS) == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
out_nounlock:
userret(l, pc, sticks);
share_fpu(l, tf);
@ -1285,17 +1261,6 @@ out_nounlock:
}
#endif /* SUN4M */
/*
* XXX This is a terrible name.
*/
void
upcallret(struct lwp *l)
{
KERNEL_UNLOCK_LAST(l);
userret(l, l->l_md.md_tf->tf_pc, 0);
}
/*
* Start a new LWP
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.106 2011/04/18 00:26:12 rmind Exp $ */
/* $NetBSD: vm_machdep.c,v 1.107 2012/02/19 21:06:30 rmind Exp $ */
/*
* Copyright (c) 1996
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.106 2011/04/18 00:26:12 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.107 2012/02/19 21:06:30 rmind Exp $");
#include "opt_multiprocessor.h"
@ -327,24 +327,6 @@ cpu_lwp_free2(struct lwp *l)
kmem_free(fs, sizeof(struct fpstate));
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
/*struct trapframe *tf = l->l_md.md_tf;*/
struct rwindow *rp;
/* Construct kernel frame to return to in cpu_switch() */
rp = (struct rwindow *)((u_int)pcb + TOPFRAMEOFF);
rp->rw_local[0] = (int)func; /* Function to call */
rp->rw_local[1] = (int)arg; /* and its argument */
pcb->pcb_pc = (int)lwp_setfunc_trampoline - 8;
pcb->pcb_sp = (int)rp;
pcb->pcb_psr &= ~PSR_CWP; /* Run in window #0 */
pcb->pcb_wim = 1; /* Fence at window #1 */
}
int
cpu_lwp_setprivate(lwp_t *l, void *addr)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.338 2011/09/04 12:17:13 nakayama Exp $ */
/* $NetBSD: locore.s,v 1.339 2012/02/19 21:06:30 rmind Exp $ */
/*
* Copyright (c) 2006-2010 Matthew R. Green
@ -5381,16 +5381,6 @@ ENTRY(lwp_trampoline)
ba,a,pt %icc, return_from_trap
nop
/*
* Like lwp_trampoline, but for cpu_setfunc(), i.e. without newlwp
* arguement and will not call lwp_startup.
*/
ENTRY(setfunc_trampoline)
call %l0 ! re-use current frame
mov %l1, %o0
ba,a,pt %icc, return_from_trap
nop
/*
* pmap_zero_page_phys(pa)
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.265 2012/02/06 10:40:26 martin Exp $ */
/* $NetBSD: machdep.c,v 1.266 2012/02/19 21:06:31 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.265 2012/02/06 10:40:26 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.266 2012/02/19 21:06:31 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -85,8 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.265 2012/02/06 10:40:26 martin Exp $")
#include <sys/signal.h>
#include <sys/signalvar.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/buf.h>
#include <sys/device.h>
#include <sys/ras.h>
@ -526,45 +524,6 @@ sendsig_siginfo(const ksiginfo_t *ksi, const sigset_t *mask)
l->l_sigstk.ss_flags |= SS_ONSTACK;
}
/*
* Set the lwp to begin execution in the upcall handler. The upcall
* handler will then simply call the upcall routine and then exit.
*
* Because we have a bunch of different signal trampolines, the first
* two instructions in the signal trampoline call the upcall handler.
* Signal dispatch should skip the first two instructions in the signal
* trampolines.
*/
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe64 *tf;
vaddr_t addr;
tf = l->l_md.md_tf;
addr = (vaddr_t) upcall;
/* Arguments to the upcall... */
tf->tf_out[0] = type;
tf->tf_out[1] = (vaddr_t) sas;
tf->tf_out[2] = nevents;
tf->tf_out[3] = ninterrupted;
tf->tf_out[4] = (vaddr_t) ap;
/*
* Ensure the stack is double-word aligned, and provide a
* valid C call frame.
*/
sp = (void *)(((vaddr_t)sp & ~0xf) - CCFSZ);
/* Arrange to begin execution at the upcall handler. */
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
tf->tf_out[6] = (vaddr_t)sp - STACK_OFFSET;
tf->tf_out[7] = -1; /* "you lose" if upcall returns */
}
struct pcb dumppcb;
static void
@ -2496,7 +2455,7 @@ cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
/* First ensure consistent stack state (see sendsig). */ /* XXX? */
write_user_windows();
if ((l->l_flag & LW_SA_SWITCHING) == 0 && rwindow_save(l)) {
if (rwindow_save(l)) {
mutex_enter(l->l_proc->p_lock);
sigexit(l, SIGILL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.96 2012/02/12 16:34:10 matt Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.97 2012/02/19 21:06:31 rmind Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.96 2012/02/12 16:34:10 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.97 2012/02/19 21:06:31 rmind Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -45,8 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.96 2012/02/12 16:34:10 matt E
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/core.h>
#include <sys/mount.h>
#include <sys/buf.h>
@ -418,46 +416,6 @@ netbsd32_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
netbsd32_sendsig_siginfo(ksi, mask);
}
/*
* Set the lwp to begin execution in the upcall handler. The upcall
* handler will then simply call the upcall routine and then exit.
*
* Because we have a bunch of different signal trampolines, the first
* two instructions in the signal trampoline call the upcall handler.
* Signal dispatch should skip the first two instructions in the signal
* trampolines.
*/
void
netbsd32_cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe *tf;
vaddr_t addr;
tf = l->l_md.md_tf;
addr = (vaddr_t) upcall;
/* Arguments to the upcall... */
tf->tf_out[0] = type;
tf->tf_out[1] = (vaddr_t) sas;
tf->tf_out[2] = nevents;
tf->tf_out[3] = ninterrupted;
tf->tf_out[4] = (vaddr_t) ap;
/*
* Ensure the stack is double-word aligned, and provide a
* C call frame.
*/
sp = (void *)(((vaddr_t)sp & ~0x7) - CCFSZ);
/* Arrange to begin execution at the upcall handler. */
tf->tf_pc = addr;
tf->tf_npc = addr + 4;
tf->tf_out[6] = (vaddr_t) sp;
tf->tf_out[7] = -1; /* "you lose" if upcall returns */
}
#undef DEBUG
#ifdef COMPAT_13

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.40 2012/02/11 23:16:16 martin Exp $ */
/* $NetBSD: syscall.c,v 1.41 2012/02/19 21:06:31 rmind Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -79,15 +79,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.40 2012/02/11 23:16:16 martin Exp $");
#include "opt_sa.h"
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.41 2012/02/19 21:06:31 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/signal.h>
#include <sys/kmem.h>
#include <sys/ktrace.h>
@ -313,12 +309,6 @@ syscall_plain(struct trapframe64 *tf, register_t code, register_t pc)
if ((error = getargs(p, tf, &code, &callp, &args, &s64)) != 0)
goto bad;
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
rval[0] = 0;
rval[1] = tf->tf_out[1];
@ -407,11 +397,6 @@ syscall_fancy(struct trapframe64 *tf, register_t code, register_t pc)
#else
ap = &args;
#endif
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
if ((error = trace_enter(code, ap->r, callp->sy_narg)) != 0) {
goto out;
@ -507,11 +492,3 @@ startlwp(void *arg)
kmem_free(uc, sizeof(ucontext_t));
userret(l, 0, 0);
}
void
upcallret(struct lwp *l)
{
KERNEL_UNLOCK_LAST(l);
userret(l, 0, 0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.168 2011/07/30 19:29:12 martin Exp $ */
/* $NetBSD: trap.c,v 1.169 2012/02/19 21:06:31 rmind Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.168 2011/07/30 19:29:12 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.169 2012/02/19 21:06:31 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -62,8 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.168 2011/07/30 19:29:12 martin Exp $");
#include <sys/pool.h>
#include <sys/proc.h>
#include <sys/ras.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/kernel.h>
#include <sys/resource.h>
#include <sys/signal.h>
@ -1102,16 +1100,6 @@ data_access_fault(struct trapframe64 *tf, unsigned int type, vaddr_t pc,
}
} else {
l->l_md.md_tf = tf;
/*
* WRS: Can drop LP_SA_NOBLOCK test iff can only get
* here from a usermode-initiated access. LP_SA_NOBLOCK
* should never be set there - it's kernel-only.
*/
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = addr;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
vm = p->p_vmspace;
@ -1208,7 +1196,6 @@ kfault:
trapsignal(l, &ksi);
}
if ((tstate & TSTATE_PRIV) == 0) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
userret(l, pc, sticks);
share_fpu(l, tf);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.98 2011/10/08 08:49:07 nakayama Exp $ */
/* $NetBSD: vm_machdep.c,v 1.99 2012/02/19 21:06:32 rmind Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved.
@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.98 2011/10/08 08:49:07 nakayama Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.99 2012/02/19 21:06:32 rmind Exp $");
#include "opt_multiprocessor.h"
@ -160,21 +160,6 @@ cpu_proc_fork(struct proc *p1, struct proc *p2)
char cpu_forkname[] = "cpu_lwp_fork()";
#endif
void setfunc_trampoline(void);
inline void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *npcb = lwp_getpcb(l);
struct rwindow *rp;
rp = (struct rwindow *)((u_long)npcb + TOPFRAMEOFF);
rp->rw_local[0] = (long)func; /* Function to call */
rp->rw_local[1] = (long)arg; /* and its argument */
npcb->pcb_pc = (long)setfunc_trampoline - 8;
npcb->pcb_sp = (long)rp - STACK_OFFSET;
}
/*
* Finish a fork operation, with lwp l2 nearly set up.
* Copy and update the pcb and trap frame, making the child ready to run.

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.42 2011/01/17 14:36:33 tsutsui Exp $ */
/* $NetBSD: trap.c,v 1.43 2012/02/19 21:06:32 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.42 2011/01/17 14:36:33 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.43 2012/02/19 21:06:32 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -94,8 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.42 2011/01/17 14:36:33 tsutsui Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -516,9 +514,6 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
/* supervisor mode fault */
if (onfault == NULL || KDFAULT(code))
map = kernel_map;
} else if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
if (WRFAULT(code))
@ -561,9 +556,7 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
if (map != kernel_map && (void *)va >= vm->vm_maxsaddr)
uvm_grow(p, va);
if ((type & T_USER) != 0)
l->l_pflag &= ~LP_SA_PAGEFAULT;
else if (ucas_ras_check(tf)) {
if ((type & T_USER) == 0 && ucas_ras_check(tf)) {
return;
}
goto finish;
@ -588,7 +581,6 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
map, va, ftype, rv);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.141 2011/01/17 14:36:33 tsutsui Exp $ */
/* $NetBSD: trap.c,v 1.142 2012/02/19 21:06:32 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.141 2011/01/17 14:36:33 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.142 2012/02/19 21:06:32 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -94,8 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.141 2011/01/17 14:36:33 tsutsui Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -524,9 +522,6 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
/* supervisor mode fault */
if (onfault == NULL || KDFAULT(code))
map = kernel_map;
} else if (l->l_flag & LW_SA) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
if (WRFAULT(code))
@ -570,9 +565,7 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
if (map != kernel_map && (void *)va >= vm->vm_maxsaddr)
uvm_grow(p, va);
if ((type & T_USER) != 0)
l->l_pflag &= ~LP_SA_PAGEFAULT;
else if (ucas_ras_check(tf)) {
if ((type & T_USER) == 0 && ucas_ras_check(tf)) {
return;
}
goto finish;
@ -597,7 +590,6 @@ trap(struct trapframe *tf, int type, u_int code, u_int v)
map, va, ftype, rv);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.185 2012/01/27 18:53:05 para Exp $ */
/* $NetBSD: machdep.c,v 1.186 2012/02/19 21:06:33 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.185 2012/01/27 18:53:05 para Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.186 2012/02/19 21:06:33 rmind Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@ -109,7 +109,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.185 2012/01/27 18:53:05 para Exp $");
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/kauth.h>
#include <sys/savar.h> /* for cpu_upcall */
#include <sys/sysctl.h>
#include <sys/time.h>
@ -616,52 +615,6 @@ krnunlock(void)
}
#endif
void
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
struct trapframe * const tf = l->l_md.md_utf;
uint32_t saframe[11], *fp = saframe;
sp = (void *)((uintptr_t)sp - sizeof(saframe));
/*
* We don't bother to save the callee's register mask
* since the function is never expected to return.
*/
/*
* Fake a CALLS stack frame.
*/
*fp++ = 0; /* condition handler */
*fp++ = 0x20000000; /* saved regmask & PSW */
*fp++ = 0; /* saved AP */
*fp++ = 0; /* saved FP, new call stack */
*fp++ = 0; /* saved PC, new call stack */
/*
* Now create the argument list.
*/
*fp++ = 5; /* argc = 5 */
*fp++ = type;
*fp++ = (uintptr_t) sas;
*fp++ = nevents;
*fp++ = ninterrupted;
*fp++ = (uintptr_t) ap;
if (copyout(&saframe, sp, sizeof(saframe)) != 0) {
/* Copying onto the stack didn't work, die. */
sigexit(l, SIGILL);
/* NOTREACHED */
}
tf->tf_ap = (uintptr_t) sp + 20;
tf->tf_sp = (long) sp;
tf->tf_fp = (long) sp;
tf->tf_pc = (long) upcall + 2;
tf->tf_psl = (long) PSL_U | PSL_PREVU;
}
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.20 2012/02/11 23:16:16 martin Exp $ */
/* $NetBSD: syscall.c,v 1.21 2012/02/19 21:06:33 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -33,18 +33,15 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.20 2012/02/11 23:16:16 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.21 2012/02/19 21:06:33 rmind Exp $");
#include "opt_multiprocessor.h"
#include "opt_sa.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/cpu.h>
#include <sys/ktrace.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
@ -102,12 +99,6 @@ syscall(struct trapframe *tf)
goto bad;
}
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
/*
* Only trace if tracing is enabled and the syscall isn't indirect
* (SYS_syscall or SYS___syscall)

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.129 2012/02/02 14:30:48 matt Exp $ */
/* $NetBSD: trap.c,v 1.130 2012/02/19 21:06:33 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -33,7 +33,7 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2012/02/02 14:30:48 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.130 2012/02/19 21:06:33 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@ -44,8 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.129 2012/02/02 14:30:48 matt Exp $");
#include <sys/exec.h>
#include <sys/kauth.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/signalvar.h>
#include <uvm/uvm_extern.h>
@ -221,11 +219,6 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n",
else
ftype = VM_PROT_READ;
if ((usermode) && (l->l_flag & LW_SA)) {
l->l_savp->savp_faultaddr = (vaddr_t)tf->tf_code;
l->l_pflag |= LP_SA_PAGEFAULT;
}
pcb->pcb_onfault = NULL;
rv = uvm_fault(map, addr, ftype);
pcb->pcb_onfault = onfault;
@ -270,9 +263,6 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n",
&& (void *)addr >= vm->vm_maxsaddr)
uvm_grow(p, addr);
}
if (usermode) {
l->l_pflag &= ~LP_SA_PAGEFAULT;
}
break;
case T_BPTFLT|T_USER:
@ -401,12 +391,3 @@ startlwp(void *arg)
/* XXX - profiling spoiled here */
userret(l, l->l_md.md_utf, l->l_proc->p_sticks);
}
void
upcallret(struct lwp *l)
{
/* XXX - profiling */
userret(l, l->l_md.md_utf, l->l_proc->p_sticks);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.116 2011/07/03 02:18:21 matt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.117 2012/02/19 21:06:34 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -31,12 +31,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.116 2011/07/03 02:18:21 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.117 2012/02/19 21:06:34 rmind Exp $");
#include "opt_execfmt.h"
#include "opt_compat_ultrix.h"
#include "opt_multiprocessor.h"
#include "opt_sa.h"
#include "opt_cputype.h"
#include <sys/param.h>
@ -175,32 +174,6 @@ cpu_lwp_pc(struct lwp *l)
return l->l_md.md_utf->tf_pc;
}
#if KERN_SA > 0
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct trapframe * const tf = l->l_md.md_utf;
struct callsframe *cf;
extern int sret;
panic("cpu_setfunc() called\n");
cf = (struct callsframe *)tf - 1;
cf->ca_cond = 0;
cf->ca_maskpsw = 0x20000000; /* CALLS, no saved registers */
cf->ca_pc = (unsigned)&sret;
cf->ca_argno = 1;
cf->ca_arg1 = (long)arg;
struct pcb * const pcb = lwp_getpcb(l);
pcb->KSP = (long)cf;
pcb->FP = (long)cf;
pcb->AP = (long)&cf->ca_argno;
pcb->PC = (long)func + 2;
}
#endif
void
cpu_lwp_free(struct lwp *l, int proc)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.104 2011/02/08 20:20:26 rmind Exp $ */
/* $NetBSD: trap.c,v 1.105 2012/02/19 21:06:34 rmind Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2011/02/08 20:20:26 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2012/02/19 21:06:34 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -55,8 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2011/02/08 20:20:26 rmind Exp $");
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/resourcevar.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
#include <sys/syslog.h>
#include <sys/userret.h>
@ -569,11 +567,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
if ((l->l_flag & LW_SA)
&& (~l->l_pflag & LP_SA_NOBLOCK)) {
l->l_savp->savp_faultaddr = (vaddr_t)v;
l->l_pflag |= LP_SA_PAGEFAULT;
}
}
if (WRFAULT(code))
@ -619,7 +612,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
#endif
return;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@ -636,7 +628,6 @@ trap(struct frame *fp, int type, unsigned code, unsigned v)
type, code);
goto dopanic;
}
l->l_pflag &= ~LP_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_trap.c,v 1.10 2010/07/07 01:30:32 chs Exp $ */
/* $NetBSD: linux_trap.c,v 1.11 2012/02/19 21:06:35 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -34,13 +34,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.10 2010/07/07 01:30:32 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.11 2012/02/19 21:06:35 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/acct.h>
#include <sys/kernel.h>
#include <sys/signal.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: syscall.c,v 1.9 2012/02/11 23:16:16 martin Exp $ */
/* $NetBSD: syscall.c,v 1.10 2012/02/19 21:06:35 rmind Exp $ */
/*-
* Copyright (c) 1998, 2000, 2009 The NetBSD Foundation, Inc.
@ -30,16 +30,12 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.9 2012/02/11 23:16:16 martin Exp $");
#include "opt_sa.h"
__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.10 2012/02/19 21:06:35 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/ktrace.h>
#include <sys/mman.h>
#include <sys/syscall.h>
@ -144,12 +140,6 @@ syscall(struct trapframe *frame)
SYSCALL_COUNT(syscall_counts, code);
SYSCALL_TIME_SYS_ENTRY(l, syscall_times, code);
#ifdef KERN_SA
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
#ifdef __x86_64__
/*
* The first 6 syscall args are passed in rdi, rsi, rdx, r10, r8 and r9
@ -226,13 +216,6 @@ syscall_vm86(struct trapframe *frame)
l = curlwp;
p = l->l_proc;
#ifdef KERN_SA
/* While this is probably not needed, it's probably better to include than not */
if (__predict_false((l->l_savp)
&& (l->l_savp->savp_pflags & SAVP_FLAG_DELIVERING)))
l->l_savp->savp_pflags &= ~SAVP_FLAG_DELIVERING;
#endif
(*p->p_emul->e_trapsignal)(l, &ksi);
userret(l);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.14 2012/01/21 16:48:57 chs Exp $ */
/* $NetBSD: vm_machdep.c,v 1.15 2012/02/19 21:06:35 rmind Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.14 2012/01/21 16:48:57 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.15 2012/02/19 21:06:35 rmind Exp $");
#include "opt_mtrr.h"
@ -138,6 +138,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
{
struct pcb *pcb1, *pcb2;
struct trapframe *tf;
struct switchframe *sf;
vaddr_t uv;
pcb1 = lwp_getpcb(l1);
@ -218,31 +219,23 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
l2->l_md.md_flags = l1->l_md.md_flags;
l2->l_md.md_astpending = 0;
cpu_setfunc(l2, func, arg);
}
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf = l->l_md.md_regs;
struct switchframe *sf = (struct switchframe *)tf - 1;
sf = (struct switchframe *)tf - 1;
#ifdef __x86_64__
sf->sf_r12 = (uint64_t)func;
sf->sf_r13 = (uint64_t)arg;
if (func == child_return && !(l->l_proc->p_flag & PK_32))
if (func == child_return && !(l2->l_proc->p_flag & PK_32))
sf->sf_rip = (uint64_t)child_trampoline;
else
sf->sf_rip = (uint64_t)lwp_trampoline;
pcb->pcb_rsp = (uint64_t)sf;
pcb->pcb_rbp = (uint64_t)l;
pcb2->pcb_rsp = (uint64_t)sf;
pcb2->pcb_rbp = (uint64_t)l2;
#else
sf->sf_esi = (int)func;
sf->sf_ebx = (int)arg;
sf->sf_eip = (int)lwp_trampoline;
pcb->pcb_esp = (int)sf;
pcb->pcb_ebp = (int)l;
pcb2->pcb_esp = (int)sf;
pcb2->pcb_ebp = (int)l2;
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: aoutm68k_exec.c,v 1.26 2010/10/15 16:51:09 tsutsui Exp $ */
/* $NetBSD: aoutm68k_exec.c,v 1.27 2012/02/19 21:06:36 rmind Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.26 2010/10/15 16:51:09 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.27 2012/02/19 21:06:36 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_syscall_debug.h"
@ -84,7 +84,6 @@ struct emul emul_netbsd_aoutm68k = {
.e_fault = NULL,
.e_vm_default_addr = uvm_default_mapaddr,
.e_usertrap = NULL,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig_16.c,v 1.1 2008/11/14 23:10:57 ad Exp $ */
/* $NetBSD: kern_sig_16.c,v 1.2 2012/02/19 21:06:36 rmind Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -66,23 +66,21 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.1 2008/11/14 23:10:57 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.2 2012/02/19 21:06:36 rmind Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/proc.h>
#include <sys/pool.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallargs.h>
#include <sys/kauth.h>
#include <sys/wait.h>
#include <sys/kmem.h>
/* ARGSUSED */
int
compat_16_sys___sigaction14(struct lwp *l, const struct compat_16_sys___sigaction14_args *uap, register_t *retval)
compat_16_sys___sigaction14(struct lwp *l,
const struct compat_16_sys___sigaction14_args *uap, register_t *retval)
{
/* {
syscallarg(int) signum;

View File

@ -1,4 +1,4 @@
/* $NetBSD: freebsd_exec.c,v 1.37 2010/07/07 01:30:32 chs Exp $ */
/* $NetBSD: freebsd_exec.c,v 1.38 2012/02/19 21:06:36 rmind Exp $ */
/*
* Copyright (c) 1993, 1994 Christopher G. Demetriou
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.37 2010/07/07 01:30:32 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: freebsd_exec.c,v 1.38 2012/02/19 21:06:36 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_syscall_debug.h"
@ -98,7 +98,6 @@ struct emul emul_freebsd = {
.e_fault = NULL,
.e_vm_default_addr = uvm_default_mapaddr,
.e_usertrap = NULL,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_exec.c,v 1.75 2010/07/22 03:18:30 christos Exp $ */
/* $NetBSD: ibcs2_exec.c,v 1.76 2012/02/19 21:06:37 rmind Exp $ */
/*
* Copyright (c) 1994, 1995, 1998 Scott Bartram
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.75 2010/07/22 03:18:30 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec.c,v 1.76 2012/02/19 21:06:37 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_syscall_debug.h"
@ -112,7 +112,6 @@ struct emul emul_ibcs2 = {
.e_fault = NULL,
.e_vm_default_addr = uvm_default_mapaddr,
.e_usertrap = NULL,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_exec.c,v 1.115 2011/08/18 02:21:02 christos Exp $ */
/* $NetBSD: linux_exec.c,v 1.116 2012/02/19 21:06:37 rmind Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.115 2011/08/18 02:21:02 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.116 2012/02/19 21:06:37 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -112,7 +112,6 @@ struct emul emul_linux = {
.e_fault = NULL,
.e_vm_default_addr = uvm_default_mapaddr,
.e_usertrap = linux_usertrap,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux32_exec.c,v 1.20 2010/07/07 01:30:35 chs Exp $ */
/* $NetBSD: linux32_exec.c,v 1.21 2012/02/19 21:06:38 rmind Exp $ */
/*-
* Copyright (c) 1994-2007 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.20 2010/07/07 01:30:35 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.21 2012/02/19 21:06:38 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -92,7 +92,6 @@ struct emul emul_linux32 = {
.e_fault = NULL,
.e_vm_default_addr = netbsd32_vm_default_addr,
.e_usertrap = NULL,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

View File

@ -1,4 +1,4 @@
# $NetBSD: files.netbsd32,v 1.30 2011/01/04 10:59:28 matt Exp $
# $NetBSD: files.netbsd32,v 1.31 2012/02/19 21:06:38 rmind Exp $
#
# config file description for machine-independent netbsd32 compat code.
# included by ports that need it.
@ -17,7 +17,6 @@ file compat/netbsd32/netbsd32_ioctl.c compat_netbsd32
file compat/netbsd32/netbsd32_ipc.c compat_netbsd32
file compat/netbsd32/netbsd32_lwp.c compat_netbsd32
file compat/netbsd32/netbsd32_mod.c compat_netbsd32
file compat/netbsd32/netbsd32_sa.c compat_netbsd32
file compat/netbsd32/netbsd32_select.c compat_netbsd32
file compat/netbsd32/netbsd32_sem.c compat_netbsd32 & p1003_1b_semaphore
file compat/netbsd32/netbsd32_signal.c compat_netbsd32

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32.h,v 1.92 2012/02/01 05:46:46 dholland Exp $ */
/* $NetBSD: netbsd32.h,v 1.93 2012/02/19 21:06:39 rmind Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@ -472,13 +472,6 @@ struct netbsd32_msqid_ds14 {
netbsd32_long msg_pad4[4];
};
/* from <sys/sa.h> */
typedef netbsd32_pointer_t netbsd32_sa_upcall_t;
typedef netbsd32_pointer_t netbsd32_sa_upcallp_t;
void netbsd32_cpu_upcall(struct lwp *, int, int, int, void *, void *,
void *, sa_upcall_t);
/* from <sys/sem.h> */
typedef netbsd32_pointer_t netbsd32_semp_t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_netbsd.c,v 1.179 2012/02/01 05:43:54 dholland Exp $ */
/* $NetBSD: netbsd32_netbsd.c,v 1.180 2012/02/19 21:06:39 rmind Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.179 2012/02/01 05:43:54 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.180 2012/02/19 21:06:39 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -36,7 +36,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.179 2012/02/01 05:43:54 dholla
#include "opt_compat_43.h"
#include "opt_sysv.h"
#include "opt_syscall_debug.h"
#include "opt_sa.h"
#endif
/*
@ -74,8 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.179 2012/02/01 05:43:54 dholla
#include <uvm/uvm_extern.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallargs.h>
#include <sys/proc.h>
#include <sys/acct.h>
@ -88,7 +85,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.179 2012/02/01 05:43:54 dholla
#include <compat/netbsd32/netbsd32_syscall.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/netbsd32/netbsd32_conv.h>
#include <compat/netbsd32/netbsd32_sa.h>
#if defined(DDB)
#include <ddb/ddbvar.h>
@ -155,11 +151,6 @@ struct emul emul_netbsd32 = {
.e_fault = NULL,
.e_vm_default_addr = netbsd32_vm_default_addr,
.e_usertrap = NULL,
#if defined(COMPAT_40) && defined(KERN_SA)
.e_sa = &saemul_netbsd32,
#else
.e_sa = NULL,
#endif
.e_ucsize = sizeof(ucontext32_t),
.e_startlwp = startlwp32
};

View File

@ -1,250 +0,0 @@
/* $NetBSD: netbsd32_sa.c,v 1.13 2011/01/04 20:23:40 pgoyette Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation.
* All rights reserved.
*
* This code is derived from software contributed to the NetBSD Foundation
* by Quentin Garnier.
*
* 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 NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sa.c,v 1.13 2011/01/04 20:23:40 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
#include "opt_sa.h"
#endif
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/dirent.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscallargs.h>
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/netbsd32/netbsd32_conv.h>
#include <compat/netbsd32/netbsd32_sa.h>
#ifdef KERN_SA
const struct sa_emul saemul_netbsd32 = {
.sae_ucsize = sizeof(ucontext32_t),
.sae_sasize = sizeof(struct netbsd32_sa_t),
.sae_sapsize = sizeof(netbsd32_sa_tp),
.sae_sacopyout = netbsd32_sacopyout,
.sae_upcallconv = netbsd32_upcallconv,
.sae_upcall = netbsd32_cpu_upcall,
.sae_getucontext = (void (*)(struct lwp *, void *))getucontext32_sa,
.sae_ucsp = netbsd32_sa_ucsp
};
/* SA emulation helpers */
int
netbsd32_sacopyout(int type, const void *src, void *dst)
{
switch (type) {
case SAOUT_UCONTEXT:
{
const ucontext_t *u = src;
ucontext32_t u32;
memset(&u32, 0, sizeof(u32));
u32.uc_flags = u->uc_flags;
u32.uc_stack.ss_sp = (uintptr_t)u->uc_stack.ss_sp;
u32.uc_stack.ss_size = u->uc_stack.ss_size;
u32.uc_stack.ss_flags = u->uc_stack.ss_flags;
return copyout(&u32, dst, sizeof(u32));
} break;
case SAOUT_SA_T:
{
const struct sa_t *sa = src;
struct netbsd32_sa_t sa32;
sa32.sa_id = sa->sa_id;
sa32.sa_cpu = sa->sa_cpu;
NETBSD32PTR32(sa32.sa_context, sa->sa_context);
return copyout(&sa32, dst, sizeof(sa32));
} break;
case SAOUT_SAP_T:
{
void * const *p = src;
netbsd32_pointer_t p32;
NETBSD32PTR32(p32, *p);
return copyout(&p32, dst, sizeof(p32));
} break;
}
return EINVAL;
}
int
netbsd32_upcallconv(struct lwp *l, int type, size_t *pargsize, void **parg,
void (**pfunc)(void *))
{
switch (type & SA_UPCALL_TYPE_MASK) {
case SA_UPCALL_SIGNAL:
case SA_UPCALL_SIGEV:
{
siginfo32_t si32;
siginfo_t *si = *parg;
netbsd32_si_to_si32(&si32, si);
/*
* This is so wrong, but assuming
* sizeof(siginfo32_t) < sizeof(siginfo_t) is not
* very dangerous.
*/
memcpy(*parg, &si32, sizeof(si32));
*pargsize = sizeof(si32);
}
}
return 0;
}
void *
netbsd32_sa_ucsp(void *arg)
{
ucontext32_t *uc32 = arg;
return NETBSD32IPTR64(_UC_MACHINE32_SP(uc32));
}
#endif /* KERN_SA */
/* Sycalls conversion */
int
netbsd32_sa_register(struct lwp *l,
const struct netbsd32_sa_register_args *uap, register_t *retval)
{
#if defined(COMPAT_40) && defined(KERN_SA)
/* {
syscallarg(netbsd32_sa_upcall_t) new;
syscallarg(netbsd32_sa_upcallp_t) old;
syscallarg(int) flags;
syscallarg(netbsd32_ssize_t) stackinfo_offset;
} */
sa_upcall_t prev;
int error;
error = dosa_register(l, NETBSD32PTR64(SCARG(uap, new)), &prev,
SCARG(uap, flags), SCARG(uap, stackinfo_offset));
if (error)
return error;
if (NETBSD32PTR64(SCARG(uap, old))) {
netbsd32_sa_upcall_t old;
NETBSD32PTR32(old, prev);
return copyout(&old, NETBSD32PTR64(SCARG(uap, old)),
sizeof(old));
}
return 0;
#else
return ENOSYS;
#endif
}
#if defined(COMPAT_40) && defined(KERN_SA)
static int
netbsd32_sa_copyin_stack(stack_t *stacks, int index, stack_t *dest)
{
stack32_t s32, *stacks32;
int error;
stacks32 = (stack32_t *)stacks;
error = copyin(stacks32 + index, &s32, sizeof(s32));
if (error)
return error;
dest->ss_sp = NETBSD32IPTR64(s32.ss_sp);
dest->ss_size = s32.ss_size;
dest->ss_flags = s32.ss_flags;
return 0;
}
#endif
int
netbsd32_sa_stacks(struct lwp *l, const struct netbsd32_sa_stacks_args *uap,
register_t *retval)
{
#if defined(COMPAT_40) && defined(KERN_SA)
/* {
syscallarg(int) num;
syscallarg(netbsd32_stackp_t) stacks;
} */
return sa_stacks1(l, retval, SCARG(uap, num),
NETBSD32PTR64(SCARG(uap, stacks)), netbsd32_sa_copyin_stack);
#else
return ENOSYS;
#endif
}
int
netbsd32_sa_setconcurrency(struct lwp *l,
const struct netbsd32_sa_setconcurrency_args *uap, register_t *retval)
{
#ifdef KERN_SA
/* {
syscallarg(int) concurrency;
} */
struct sys_sa_setconcurrency_args ua;
NETBSD32TO64_UAP(concurrency);
return sys_sa_setconcurrency(l, &ua, retval);
#else
return ENOSYS;
#endif
}
int
netbsd32_sa_preempt(struct lwp *l, const struct netbsd32_sa_preempt_args *uap,
register_t *retval)
{
#ifdef KERN_SA
/* {
syscallarg(int) sa_id;
} */
struct sys_sa_preempt_args ua;
NETBSD32TO64_UAP(sa_id);
return sys_sa_preempt(l, &ua, retval);
#else
return ENOSYS;
#endif
}

View File

@ -1,54 +0,0 @@
/* $NetBSD: netbsd32_sa.h,v 1.6 2009/12/10 14:10:35 matt Exp $ */
/*
* Copyright (c) 2006 The NetBSD Foundation.
* All rights reserved.
*
* This code is derived from software contributed to the NetBSD Foundation
* by Quentin Garnier.
*
* 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 NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#ifndef _COMPAT_NETBSD32_SA_H_
#define _COMPAT_NETBSD32_SA_H_
struct netbsd32_sa_t {
netbsd32_ucontextp sa_context;
int sa_id;
int sa_cpu;
};
typedef netbsd32_pointer_t netbsd32_sa_tp;
extern const struct sa_emul saemul_netbsd32;
int netbsd32_sacopyout(int, const void *, void *);
int netbsd32_upcallconv(struct lwp *, int, size_t *, void **,
void (**)(void *));
void *netbsd32_sa_ucsp(void *);
void getucontext32_sa(struct lwp *, ucontext32_t *);
#endif /* !_COMPAT_NETBSD32_SA_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_signal.c,v 1.36 2011/11/18 03:34:13 christos Exp $ */
/* $NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.36 2011/11/18 03:34:13 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.37 2012/02/19 21:06:41 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -36,8 +36,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.36 2011/11/18 03:34:13 christo
#include <sys/time.h>
#include <sys/signalvar.h>
#include <sys/proc.h>
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/wait.h>
#include <sys/dirent.h>
@ -46,7 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.36 2011/11/18 03:34:13 christo
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_conv.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/netbsd32/netbsd32_sa.h>
#include <compat/sys/signal.h>
#include <compat/sys/signalvar.h>
@ -284,11 +281,7 @@ getucontext32(struct lwp *l, ucontext32_t *ucp)
ucp->uc_flags = 0;
ucp->uc_link = (uint32_t)(intptr_t)l->l_ctxlink;
if (p->p_sa != NULL)
ucp->uc_sigmask = p->p_sa->sa_sigmask;
else
ucp->uc_sigmask = l->l_sigmask;
ucp->uc_sigmask = l->l_sigmask;
ucp->uc_flags |= _UC_SIGMASK;
/*
@ -313,45 +306,6 @@ getucontext32(struct lwp *l, ucontext32_t *ucp)
mutex_enter(p->p_lock);
}
/*
* getucontext32_sa:
* Get a ucontext32_t for use in SA upcall generation.
* Tweaked version of getucontext32. We 1) do not take p_lock, 2)
* fudge things with uc_link (which is usually NULL for libpthread
* code), and 3) we report an empty signal mask.
*/
void
getucontext32_sa(struct lwp *l, ucontext32_t *ucp)
{
struct proc *p = l->l_proc;
ucp->uc_flags = 0;
ucp->uc_link = (uint32_t)(intptr_t)l->l_ctxlink;
sigemptyset(&ucp->uc_sigmask);
ucp->uc_flags |= _UC_SIGMASK;
/*
* The (unsupplied) definition of the `current execution stack'
* in the System V Interface Definition appears to allow returning
* the main context stack.
*/
if ((l->l_sigstk.ss_flags & SS_ONSTACK) == 0) {
ucp->uc_stack.ss_sp = USRSTACK32;
ucp->uc_stack.ss_size = ctob(p->p_vmspace->vm_ssize);
ucp->uc_stack.ss_flags = 0; /* XXX, def. is Very Fishy */
} else {
/* Simply copy alternate signal execution stack. */
ucp->uc_stack.ss_sp =
(uint32_t)(intptr_t)l->l_sigstk.ss_sp;
ucp->uc_stack.ss_size = l->l_sigstk.ss_size;
ucp->uc_stack.ss_flags = l->l_sigstk.ss_flags;
}
ucp->uc_flags |= _UC_STACK;
cpu_getmcontext32(l, &ucp->uc_mcontext, &ucp->uc_flags);
}
/* ARGSUSED */
int
netbsd32_getcontext(struct lwp *l, const struct netbsd32_getcontext_args *uap, register_t *retval)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_syscall.h,v 1.99 2012/02/01 05:42:17 dholland Exp $ */
/* $NetBSD: netbsd32_syscall.h,v 1.100 2012/02/19 21:06:41 rmind Exp $ */
/*
* System call numbers.
@ -894,24 +894,12 @@
/* syscall: "netbsd32__lwp_ctl" ret: "int" args: "int" "netbsd32_pointer_t" */
#define NETBSD32_SYS_netbsd32__lwp_ctl 325
/* syscall: "netbsd32_sa_register" ret: "int" args: "netbsd32_sa_upcall_t" "netbsd32_sa_upcallp_t" "int" "netbsd32_ssize_t" */
#define NETBSD32_SYS_netbsd32_sa_register 330
/* syscall: "netbsd32_sa_stacks" ret: "int" args: "int" "netbsd32_stackp_t" */
#define NETBSD32_SYS_netbsd32_sa_stacks 331
/* syscall: "sa_enable" ret: "int" args: */
#define NETBSD32_SYS_sa_enable 332
/* syscall: "netbsd32_sa_setconcurrency" ret: "int" args: "int" */
#define NETBSD32_SYS_netbsd32_sa_setconcurrency 333
/* syscall: "sa_yield" ret: "int" args: */
#define NETBSD32_SYS_sa_yield 334
/* syscall: "netbsd32_sa_preempt" ret: "int" args: "int" */
#define NETBSD32_SYS_netbsd32_sa_preempt 335
/* 330 is obsolete netbsd32_sa_register */
/* 331 is obsolete netbsd32_sa_stacks */
/* 332 is obsolete sa_enable */
/* 333 is obsolete netbsd32_sa_setconcurrency */
/* 334 is obsolete sa_yield */
/* 335 is obsolete netbsd32_sa_preempt */
/* 336 is obsolete sys_sa_unblockyield */
/* syscall: "netbsd32___sigaction_sigtramp" ret: "int" args: "int" "netbsd32_sigactionp_t" "netbsd32_sigactionp_t" "netbsd32_voidp" "int" */
#define NETBSD32_SYS_netbsd32___sigaction_sigtramp 340

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_syscallargs.h,v 1.99 2012/02/01 05:42:17 dholland Exp $ */
/* $NetBSD: netbsd32_syscallargs.h,v 1.100 2012/02/19 21:06:42 rmind Exp $ */
/*
* System call argument lists.
@ -1637,30 +1637,6 @@ struct netbsd32__lwp_ctl_args {
};
check_syscall_args(netbsd32__lwp_ctl)
struct netbsd32_sa_register_args {
syscallarg(netbsd32_sa_upcall_t) new;
syscallarg(netbsd32_sa_upcallp_t) old;
syscallarg(int) flags;
syscallarg(netbsd32_ssize_t) stackinfo_offset;
};
check_syscall_args(netbsd32_sa_register)
struct netbsd32_sa_stacks_args {
syscallarg(int) num;
syscallarg(netbsd32_stackp_t) stacks;
};
check_syscall_args(netbsd32_sa_stacks)
struct netbsd32_sa_setconcurrency_args {
syscallarg(int) concurrency;
};
check_syscall_args(netbsd32_sa_setconcurrency)
struct netbsd32_sa_preempt_args {
syscallarg(int) sa_id;
};
check_syscall_args(netbsd32_sa_preempt)
struct netbsd32___sigaction_sigtramp_args {
syscallarg(int) signum;
syscallarg(netbsd32_sigactionp_t) nsa;
@ -3034,18 +3010,6 @@ int netbsd32__lwp_getname(struct lwp *, const struct netbsd32__lwp_getname_args
int netbsd32__lwp_ctl(struct lwp *, const struct netbsd32__lwp_ctl_args *, register_t *);
int netbsd32_sa_register(struct lwp *, const struct netbsd32_sa_register_args *, register_t *);
int netbsd32_sa_stacks(struct lwp *, const struct netbsd32_sa_stacks_args *, register_t *);
int sys_sa_enable(struct lwp *, const void *, register_t *);
int netbsd32_sa_setconcurrency(struct lwp *, const struct netbsd32_sa_setconcurrency_args *, register_t *);
int sys_sa_yield(struct lwp *, const void *, register_t *);
int netbsd32_sa_preempt(struct lwp *, const struct netbsd32_sa_preempt_args *, register_t *);
int netbsd32___sigaction_sigtramp(struct lwp *, const struct netbsd32___sigaction_sigtramp_args *, register_t *);
int netbsd32_rasctl(struct lwp *, const struct netbsd32_rasctl_args *, register_t *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_syscalls.c,v 1.98 2012/02/01 05:42:17 dholland Exp $ */
/* $NetBSD: netbsd32_syscalls.c,v 1.99 2012/02/19 21:06:42 rmind Exp $ */
/*
* System call names.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.98 2012/02/01 05:42:17 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.99 2012/02/19 21:06:42 rmind Exp $");
#if defined(_KERNEL_OPT)
#if defined(_KERNEL_OPT)
@ -421,12 +421,12 @@ const char *const netbsd32_syscallnames[] = {
/* 327 */ "#327 (unimplemented)",
/* 328 */ "#328 (unimplemented)",
/* 329 */ "#329 (unimplemented)",
/* 330 */ "netbsd32_sa_register",
/* 331 */ "netbsd32_sa_stacks",
/* 332 */ "sa_enable",
/* 333 */ "netbsd32_sa_setconcurrency",
/* 334 */ "sa_yield",
/* 335 */ "netbsd32_sa_preempt",
/* 330 */ "#330 (obsolete netbsd32_sa_register)",
/* 331 */ "#331 (obsolete netbsd32_sa_stacks)",
/* 332 */ "#332 (obsolete sa_enable)",
/* 333 */ "#333 (obsolete netbsd32_sa_setconcurrency)",
/* 334 */ "#334 (obsolete sa_yield)",
/* 335 */ "#335 (obsolete netbsd32_sa_preempt)",
/* 336 */ "#336 (obsolete sys_sa_unblockyield)",
/* 337 */ "#337 (unimplemented)",
/* 338 */ "#338 (unimplemented)",

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_sysent.c,v 1.98 2012/02/01 05:42:17 dholland Exp $ */
/* $NetBSD: netbsd32_sysent.c,v 1.99 2012/02/19 21:06:42 rmind Exp $ */
/*
* System call switch table.
@ -8,7 +8,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.98 2012/02/01 05:42:17 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.99 2012/02/19 21:06:42 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -861,18 +861,18 @@ struct sysent netbsd32_sysent[] = {
sys_nosys }, /* 328 = unimplemented */
{ 0, 0, 0,
sys_nosys }, /* 329 = unimplemented */
{ ns(struct netbsd32_sa_register_args), 0,
(sy_call_t *)netbsd32_sa_register },/* 330 = netbsd32_sa_register */
{ ns(struct netbsd32_sa_stacks_args), 0,
(sy_call_t *)netbsd32_sa_stacks }, /* 331 = netbsd32_sa_stacks */
{ 0, 0, 0,
(sy_call_t *)sys_sa_enable }, /* 332 = sa_enable */
{ ns(struct netbsd32_sa_setconcurrency_args), 0,
(sy_call_t *)netbsd32_sa_setconcurrency },/* 333 = netbsd32_sa_setconcurrency */
sys_nosys }, /* 330 = obsolete netbsd32_sa_register */
{ 0, 0, 0,
(sy_call_t *)sys_sa_yield }, /* 334 = sa_yield */
{ ns(struct netbsd32_sa_preempt_args), 0,
(sy_call_t *)netbsd32_sa_preempt }, /* 335 = netbsd32_sa_preempt */
sys_nosys }, /* 331 = obsolete netbsd32_sa_stacks */
{ 0, 0, 0,
sys_nosys }, /* 332 = obsolete sa_enable */
{ 0, 0, 0,
sys_nosys }, /* 333 = obsolete netbsd32_sa_setconcurrency */
{ 0, 0, 0,
sys_nosys }, /* 334 = obsolete sa_yield */
{ 0, 0, 0,
sys_nosys }, /* 335 = obsolete netbsd32_sa_preempt */
{ 0, 0, 0,
sys_nosys }, /* 336 = obsolete sys_sa_unblockyield */
{ 0, 0, 0,

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_exec.c,v 1.43 2010/07/07 01:30:36 chs Exp $ */
/* $NetBSD: osf1_exec.c,v 1.44 2012/02/19 21:06:43 rmind Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: osf1_exec.c,v 1.43 2010/07/07 01:30:36 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: osf1_exec.c,v 1.44 2012/02/19 21:06:43 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_syscall_debug.h"
@ -96,7 +96,6 @@ struct emul emul_osf1 = {
.e_fault = NULL,
.e_vm_default_addr = uvm_default_mapaddr,
.e_usertrap = NULL,
.e_sa = NULL,
.e_ucsize = 0,
.e_startlwp = NULL
};

Some files were not shown because too many files have changed in this diff Show More