Use lwp_getpcb() in compat code, clean from struct user.
This commit is contained in:
parent
02e99d3d5c
commit
eaddd78061
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_sig_43.c,v 1.32 2008/04/28 20:23:41 martin Exp $ */
|
||||
/* $NetBSD: kern_sig_43.c,v 1.33 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.32 2008/04/28 20:23:41 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.33 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -61,8 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_sig_43.c,v 1.32 2008/04/28 20:23:41 martin Exp
|
||||
|
||||
#include <sys/cpu.h>
|
||||
|
||||
#include <sys/user.h> /* for coredump */
|
||||
|
||||
#include <compat/sys/signal.h>
|
||||
|
||||
void compat_43_sigmask_to_sigset(const int *, sigset_t *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: freebsd_ptrace.c,v 1.18 2008/11/12 12:36:10 ad Exp $ */
|
||||
/* $NetBSD: freebsd_ptrace.c,v 1.19 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.18 2008/11/12 12:36:10 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.19 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -79,7 +79,6 @@ __KERNEL_RCSID(0, "$NetBSD: freebsd_ptrace.c,v 1.18 2008/11/12 12:36:10 ad Exp $
|
||||
#include <sys/errno.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/syscallargs.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: irix_signal.c,v 1.51 2009/11/04 21:23:02 rmind Exp $ */
|
||||
/* $NetBSD: irix_signal.c,v 1.52 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994, 2001-2002 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.51 2009/11/04 21:23:02 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.52 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/signal.h>
|
||||
@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: irix_signal.c,v 1.51 2009/11/04 21:23:02 rmind Exp $
|
||||
#include <sys/systm.h>
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/user.h>
|
||||
|
||||
#include <machine/regnum.h>
|
||||
#include <machine/trap.h>
|
||||
@ -370,10 +369,12 @@ irix_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
}
|
||||
|
||||
static void
|
||||
irix_set_sigcontext (struct irix_sigcontext *scp, const sigset_t *mask, int code, struct lwp *l)
|
||||
irix_set_sigcontext (struct irix_sigcontext *scp, const sigset_t *mask,
|
||||
int code, struct lwp *l)
|
||||
{
|
||||
int i;
|
||||
struct frame *f;
|
||||
struct pcb *pcb;
|
||||
int i;
|
||||
|
||||
KASSERT(mutex_owned(l->l_proc->p_lock));
|
||||
|
||||
@ -400,19 +401,19 @@ irix_set_sigcontext (struct irix_sigcontext *scp, const sigset_t *mask, int code
|
||||
/*
|
||||
* Save the floating-pointstate, if necessary, then copy it.
|
||||
*/
|
||||
pcb = lwp_getpcb(l);
|
||||
#ifndef SOFTFLOAT
|
||||
scp->isc_ownedfp = l->l_md.md_flags & MDP_FPUSED;
|
||||
if (scp->isc_ownedfp) {
|
||||
/* if FPU has current state, save it first */
|
||||
if (l == fpcurlwp)
|
||||
savefpregs(l);
|
||||
(void)memcpy(&scp->isc_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
|
||||
memcpy(&scp->isc_fpregs, &pcb->pcb_fpregs,
|
||||
sizeof(scp->isc_fpregs));
|
||||
scp->isc_fpc_csr = l->l_addr->u_pcb.pcb_fpregs.r_regs[32];
|
||||
scp->isc_fpc_csr = pcb->pcb_fpregs.r_regs[32];
|
||||
}
|
||||
#else
|
||||
(void)memcpy(&scp->isc_fpregs, &l->l_addr->u_pcb.pcb_fpregs,
|
||||
sizeof(scp->isc_fpregs));
|
||||
memcpy(&scp->isc_fpregs, &pcb->pcb_fpregs, sizeof(scp->isc_fpregs));
|
||||
#endif
|
||||
/*
|
||||
* Save signal stack
|
||||
@ -424,9 +425,11 @@ irix_set_sigcontext (struct irix_sigcontext *scp, const sigset_t *mask, int code
|
||||
}
|
||||
|
||||
void
|
||||
irix_set_ucontext(struct irix_ucontext *ucp, const sigset_t *mask, int code, struct lwp *l)
|
||||
irix_set_ucontext(struct irix_ucontext *ucp, const sigset_t *mask,
|
||||
int code, struct lwp *l)
|
||||
{
|
||||
struct frame *f;
|
||||
struct pcb *pcb;
|
||||
|
||||
KASSERT(mutex_owned(l->l_proc->p_lock));
|
||||
|
||||
@ -450,21 +453,20 @@ irix_set_ucontext(struct irix_ucontext *ucp, const sigset_t *mask, int code, str
|
||||
/*
|
||||
* Save the floating-pointstate, if necessary, then copy it.
|
||||
*/
|
||||
pcb = lwp_getpcb(l);
|
||||
#ifndef SOFTFLOAT
|
||||
if (l->l_md.md_flags & MDP_FPUSED) {
|
||||
/* if FPU has current state, save it first */
|
||||
if (l == fpcurlwp)
|
||||
savefpregs(l);
|
||||
(void)memcpy(&ucp->iuc_mcontext.svr4___fpregs,
|
||||
&l->l_addr->u_pcb.pcb_fpregs,
|
||||
sizeof(ucp->iuc_mcontext.svr4___fpregs));
|
||||
memcpy(&ucp->iuc_mcontext.svr4___fpregs,
|
||||
&pcb->pcb_fpregs, sizeof(ucp->iuc_mcontext.svr4___fpregs));
|
||||
ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr =
|
||||
l->l_addr->u_pcb.pcb_fpregs.r_regs[32];
|
||||
pcb->pcb_fpregs.r_regs[32];
|
||||
}
|
||||
#else
|
||||
(void)memcpy(&ucp->iuc_mcontext.svr4___fpregs,
|
||||
&l->l_addr->u_pcb.pcb_fpregs,
|
||||
sizeof(ucp->iuc_mcontext.svr4___fpregs));
|
||||
memcpy(&ucp->iuc_mcontext.svr4___fpregs,
|
||||
&pcb->pcb_fpregs, sizeof(ucp->iuc_mcontext.svr4___fpregs));
|
||||
#endif
|
||||
/*
|
||||
* Save signal stack
|
||||
@ -570,20 +572,19 @@ irix_get_ucontext(struct irix_ucontext *ucp, struct lwp *l)
|
||||
}
|
||||
|
||||
if (ucp->iuc_flags & IRIX_UC_MAU) {
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
#ifndef SOFTFLOAT
|
||||
/* Disable the FPU to fault in FP registers. */
|
||||
f->f_regs[_R_SR] &= ~MIPS_SR_COP_1_BIT;
|
||||
if (l == fpcurlwp)
|
||||
fpcurlwp = NULL;
|
||||
(void)memcpy(&l->l_addr->u_pcb.pcb_fpregs,
|
||||
&ucp->iuc_mcontext.svr4___fpregs,
|
||||
sizeof(l->l_addr->u_pcb.pcb_fpregs));
|
||||
l->l_addr->u_pcb.pcb_fpregs.r_regs[32] =
|
||||
memcpy(&pcb->pcb_fpregs, &ucp->iuc_mcontext.svr4___fpregs,
|
||||
sizeof(pcb->pcb_fpregs));
|
||||
pcb->pcb_fpregs.r_regs[32] =
|
||||
ucp->iuc_mcontext.svr4___fpregs.svr4___fp_csr;
|
||||
#else
|
||||
(void)memcpy(&l->l_addr->u_pcb.pcb_fpregs,
|
||||
&ucp->iuc_mcontext.svr4___fpregs,
|
||||
sizeof(l->l_addr->u_pcb.pcb_fpregs));
|
||||
memcpy(&pcb->pcb_fpregs, &ucp->iuc_mcontext.svr4___fpregs,
|
||||
sizeof(pcb->pcb_fpregs));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -620,9 +621,10 @@ irix_get_ucontext(struct irix_ucontext *ucp, struct lwp *l)
|
||||
static void
|
||||
irix_get_sigcontext(struct irix_sigcontext *scp, struct lwp *l)
|
||||
{
|
||||
int i;
|
||||
struct frame *f;
|
||||
struct pcb *pcb;
|
||||
sigset_t mask;
|
||||
int i;
|
||||
|
||||
KASSERT(mutex_owned(l->l_proc->p_lock));
|
||||
|
||||
@ -635,19 +637,19 @@ irix_get_sigcontext(struct irix_sigcontext *scp, struct lwp *l)
|
||||
f->f_regs[_R_MULHI] = scp->isc_mdhi;
|
||||
f->f_regs[_R_PC] = scp->isc_pc;
|
||||
|
||||
pcb = lwp_getpcb(l);
|
||||
#ifndef SOFTFLOAT
|
||||
if (scp->isc_ownedfp) {
|
||||
/* Disable the FPU to fault in FP registers. */
|
||||
f->f_regs[_R_SR] &= ~MIPS_SR_COP_1_BIT;
|
||||
if (l == fpcurlwp)
|
||||
fpcurlwp = NULL;
|
||||
(void)memcpy(&l->l_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs,
|
||||
memcpy(&pcb->pcb_fpregs, &scp->isc_fpregs,
|
||||
sizeof(scp->isc_fpregs));
|
||||
l->l_addr->u_pcb.pcb_fpregs.r_regs[32] = scp->isc_fpc_csr;
|
||||
pcb->pcb_fpregs.r_regs[32] = scp->isc_fpc_csr;
|
||||
}
|
||||
#else
|
||||
(void)memcpy(&l->l_addr->u_pcb.pcb_fpregs, &scp->isc_fpregs,
|
||||
sizeof(l->l_addr->u_pcb.pcb_fpregs));
|
||||
memcpy(&pcb->pcb_fpregs, &scp->isc_fpregs, sizeof(pcb->pcb_fpregs));
|
||||
#endif
|
||||
|
||||
/* Restore signal stack. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.44 2009/03/18 17:06:48 cegger Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.45 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -35,14 +35,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.44 2009/03/18 17:06:48 cegger Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.45 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
@ -256,11 +255,13 @@ void setup_linux_sigframe(tf, sig, mask)
|
||||
sigframe.sf_sc.sc_regs[R_SP] = alpha_pal_rdusp();
|
||||
|
||||
if (l == fpcurlwp) {
|
||||
alpha_pal_wrfen(1);
|
||||
savefpstate(&l->l_addr->u_pcb.pcb_fp);
|
||||
alpha_pal_wrfen(0);
|
||||
sigframe.sf_sc.sc_fpcr = l->l_addr->u_pcb.pcb_fp.fpr_cr;
|
||||
fpcurlwp = NULL;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
|
||||
alpha_pal_wrfen(1);
|
||||
savefpstate(&pcb->pcb_fp);
|
||||
alpha_pal_wrfen(0);
|
||||
sigframe.sf_sc.sc_fpcr = pcb->pcb_fp.fpr_cr;
|
||||
fpcurlwp = NULL;
|
||||
}
|
||||
/* XXX ownedfp ? etc...? */
|
||||
|
||||
@ -374,6 +375,7 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext context,
|
||||
sigset_t *mask)
|
||||
{
|
||||
struct proc *p = l->l_proc;
|
||||
struct pcb *pcb;
|
||||
|
||||
/*
|
||||
* Linux doesn't (yet) have alternate signal stacks.
|
||||
@ -407,7 +409,8 @@ linux_restore_sigcontext(struct lwp *l, struct linux_sigcontext context,
|
||||
fpcurlwp = NULL;
|
||||
|
||||
/* Restore fp regs and fpr_cr */
|
||||
memcpy( &l->l_addr->u_pcb.pcb_fp, (struct fpreg *)context.sc_fpregs,
|
||||
pcb = lwp_getpcb(l);
|
||||
memcpy(&pcb->pcb_fp, (struct fpreg *)context.sc_fpregs,
|
||||
sizeof(struct fpreg));
|
||||
/* XXX sc_ownedfp ? */
|
||||
/* XXX sc_fp_control ? */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.36 2009/05/29 14:19:12 njoly Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.37 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.36 2009/05/29 14:19:12 njoly Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.37 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.36 2009/05/29 14:19:12 njoly Exp
|
||||
#include <sys/exec.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ptrace.h> /* for process_read_fpregs() */
|
||||
#include <sys/user.h>
|
||||
#include <sys/ucontext.h>
|
||||
#include <sys/conf.h>
|
||||
|
||||
@ -82,11 +81,11 @@ static void linux_buildcontext(struct lwp *, void *, void *);
|
||||
void
|
||||
linux_setregs(struct lwp *l, struct exec_package *epp, u_long stack)
|
||||
{
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct trapframe *tf;
|
||||
|
||||
/* If we were using the FPU, forget about it. */
|
||||
if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
|
||||
if (pcb->pcb_fpcpu != NULL)
|
||||
fpusave_lwp(l, 0);
|
||||
|
||||
l->l_md.md_flags &= ~MDP_USEDFPU;
|
||||
@ -133,6 +132,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
{
|
||||
struct lwp *l = curlwp;
|
||||
struct proc *p = l->l_proc;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct sigacts *ps = p->p_sigacts;
|
||||
int onstack, error;
|
||||
int sig = ksi->ksi_signo;
|
||||
@ -220,7 +220,7 @@ linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
sigframe.uc.luc_mcontext.trapno = tf->tf_trapno;
|
||||
native_to_linux_sigset(&lmask, mask);
|
||||
sigframe.uc.luc_mcontext.oldmask = lmask.sig[0];
|
||||
sigframe.uc.luc_mcontext.cr2 = (long)l->l_addr->u_pcb.pcb_onfault;
|
||||
sigframe.uc.luc_mcontext.cr2 = (long)pcb->pcb_onfault;
|
||||
sigframe.uc.luc_mcontext.fpstate = fpsp;
|
||||
native_to_linux_sigset(&sigframe.uc.luc_sigmask, mask);
|
||||
|
||||
@ -482,13 +482,14 @@ linux_sys_rt_sigreturn(struct lwp *l, const void *v, register_t *retval)
|
||||
}
|
||||
|
||||
int
|
||||
linux_sys_arch_prctl(struct lwp *l, const struct linux_sys_arch_prctl_args *uap, register_t *retval)
|
||||
linux_sys_arch_prctl(struct lwp *l,
|
||||
const struct linux_sys_arch_prctl_args *uap, register_t *retval)
|
||||
{
|
||||
/* {
|
||||
syscallarg(int) code;
|
||||
syscallarg(unsigned long) addr;
|
||||
} */
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct trapframe *tf = l->l_md.md_regs;
|
||||
int error;
|
||||
uint64_t taddr;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.27 2008/04/28 20:23:42 martin Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.28 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
|
||||
@ -31,14 +31,13 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.27 2008/04/28 20:23:42 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.28 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_exec_machdep.c,v 1.13 2009/09/20 10:29:30 taca Exp $ */
|
||||
/* $NetBSD: linux_exec_machdep.c,v 1.14 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2004 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.13 2009/09/20 10:29:30 taca Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.14 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_vm86.h"
|
||||
@ -145,7 +145,7 @@ int
|
||||
linux_init_thread_area(struct lwp *l, struct lwp *l2)
|
||||
{
|
||||
struct trapframe *tf = l->l_md.md_regs, *tf2 = l2->l_md.md_regs;
|
||||
struct pcb *pcb2 = &l2->l_addr->u_pcb;
|
||||
struct pcb *pcb2 = lwp_getpcb(l2);
|
||||
struct linux_user_desc info;
|
||||
struct segment_descriptor sd;
|
||||
int error, idx, a[2];
|
||||
@ -195,7 +195,7 @@ int
|
||||
linux_sys_set_thread_area(struct lwp *l,
|
||||
const struct linux_sys_set_thread_area_args *uap, register_t *retval)
|
||||
{
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct linux_user_desc info;
|
||||
struct segment_descriptor sd;
|
||||
int error, idx, a[2];
|
||||
@ -277,7 +277,7 @@ int
|
||||
linux_sys_get_thread_area(struct lwp *l,
|
||||
const struct linux_sys_get_thread_area_args *uap, register_t *retval)
|
||||
{
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct linux_user_desc info;
|
||||
struct linux_desc_struct desc;
|
||||
struct segment_descriptor sd;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.145 2009/05/29 14:19:13 njoly Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.146 2009/11/23 00:46:06 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000, 2008, 2009 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.145 2009/05/29 14:19:13 njoly Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.146 2009/11/23 00:46:06 rmind Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_vm86.h"
|
||||
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.145 2009/05/29 14:19:13 njoly Ex
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
@ -126,7 +125,7 @@ extern char linux_sigcode[], linux_rt_sigcode[];
|
||||
void
|
||||
linux_setregs(struct lwp *l, struct exec_package *epp, u_long stack)
|
||||
{
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct trapframe *tf;
|
||||
|
||||
#if NNPX > 0
|
||||
@ -199,8 +198,11 @@ linux_save_ucontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask, s
|
||||
}
|
||||
|
||||
static void
|
||||
linux_save_sigcontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask, struct linux_sigcontext *sc)
|
||||
linux_save_sigcontext(struct lwp *l, struct trapframe *tf,
|
||||
const sigset_t *mask, struct linux_sigcontext *sc)
|
||||
{
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
|
||||
/* Save register context. */
|
||||
#ifdef VM86
|
||||
if (tf->tf_eflags & PSL_VM) {
|
||||
@ -232,7 +234,7 @@ linux_save_sigcontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask,
|
||||
sc->sc_ss = tf->tf_ss;
|
||||
sc->sc_err = tf->tf_err;
|
||||
sc->sc_trapno = tf->tf_trapno;
|
||||
sc->sc_cr2 = l->l_addr->u_pcb.pcb_cr2;
|
||||
sc->sc_cr2 = pcb->pcb_cr2;
|
||||
sc->sc_387 = NULL;
|
||||
|
||||
/* Save signal stack. */
|
||||
@ -270,7 +272,8 @@ linux_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
fp--;
|
||||
|
||||
DPRINTF(("rt: onstack = %d, fp = %p sig = %d eip = 0x%x cr2 = 0x%x\n",
|
||||
onstack, fp, sig, tf->tf_eip, l->l_addr->u_pcb.pcb_cr2));
|
||||
onstack, fp, sig, tf->tf_eip,
|
||||
((struct pcb *)lwp_getpcb(l))->pcb_cr2));
|
||||
|
||||
/* Build stack frame for signal trampoline. */
|
||||
frame.sf_handler = catcher;
|
||||
@ -377,7 +380,8 @@ linux_old_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
fp--;
|
||||
|
||||
DPRINTF(("old: onstack = %d, fp = %p sig = %d eip = 0x%x cr2 = 0x%x\n",
|
||||
onstack, fp, sig, tf->tf_eip, l->l_addr->u_pcb.pcb_cr2));
|
||||
onstack, fp, sig, tf->tf_eip,
|
||||
((struct pcb *)lwp_getpcb(l))->pcb_cr2));
|
||||
|
||||
/* Build stack frame for signal trampoline. */
|
||||
frame.sf_handler = catcher;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.38 2008/04/28 20:23:43 martin Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.39 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
@ -30,14 +30,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.38 2008/04/28 20:23:43 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.39 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux_machdep.c,v 1.39 2008/04/28 20:23:43 martin Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.40 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
|
||||
@ -30,14 +30,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.39 2008/04/28 20:23:43 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.40 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: linux32_machdep.c,v 1.22 2009/05/29 14:19:13 njoly Exp $ */
|
||||
/* $NetBSD: linux32_machdep.c,v 1.23 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
|
||||
@ -31,14 +31,13 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.22 2009/05/29 14:19:13 njoly Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.23 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/buf.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <sys/conf.h>
|
||||
@ -281,13 +280,13 @@ linux32_rt_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
|
||||
void
|
||||
linux32_setregs(struct lwp *l, struct exec_package *pack, u_long stack)
|
||||
{
|
||||
struct pcb *pcb = &l->l_addr->u_pcb;
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
struct trapframe *tf;
|
||||
struct proc *p = l->l_proc;
|
||||
void **retaddr;
|
||||
|
||||
/* If we were using the FPU, forget about it. */
|
||||
if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
|
||||
if (pcb->pcb_fpcpu != NULL)
|
||||
fpusave_lwp(l, 0);
|
||||
|
||||
#if defined(USER_LDT) && 0
|
||||
@ -340,8 +339,10 @@ linux32_setregs(struct lwp *l, struct exec_package *pack, u_long stack)
|
||||
}
|
||||
|
||||
static void
|
||||
linux32_save_ucontext(struct lwp *l, struct trapframe *tf, const sigset_t *mask, struct sigaltstack *sas, struct linux32_ucontext *uc)
|
||||
linux32_save_ucontext(struct lwp *l, struct trapframe *tf,
|
||||
const sigset_t *mask, struct sigaltstack *sas, struct linux32_ucontext *uc)
|
||||
{
|
||||
|
||||
uc->uc_flags = 0;
|
||||
NETBSD32PTR32(uc->uc_link, NULL);
|
||||
native_to_linux32_sigaltstack(&uc->uc_stack, sas);
|
||||
@ -354,6 +355,8 @@ static void
|
||||
linux32_save_sigcontext(struct lwp *l, struct trapframe *tf,
|
||||
const sigset_t *mask, struct linux32_sigcontext *sc)
|
||||
{
|
||||
struct pcb *pcb = lwp_getpcb(l);
|
||||
|
||||
/* Save register context. */
|
||||
sc->sc_gs = tf->tf_gs;
|
||||
sc->sc_fs = tf->tf_fs;
|
||||
@ -374,7 +377,7 @@ linux32_save_sigcontext(struct lwp *l, struct trapframe *tf,
|
||||
sc->sc_ss = tf->tf_ss;
|
||||
sc->sc_err = tf->tf_err;
|
||||
sc->sc_trapno = tf->tf_trapno;
|
||||
sc->sc_cr2 = l->l_addr->u_pcb.pcb_cr2;
|
||||
sc->sc_cr2 = pcb->pcb_cr2;
|
||||
NETBSD32PTR32(sc->sc_387, NULL);
|
||||
|
||||
/* Save signal stack. */
|
||||
@ -385,7 +388,8 @@ linux32_save_sigcontext(struct lwp *l, struct trapframe *tf,
|
||||
}
|
||||
|
||||
int
|
||||
linux32_sys_sigreturn(struct lwp *l, const struct linux32_sys_sigreturn_args *uap, register_t *retval)
|
||||
linux32_sys_sigreturn(struct lwp *l,
|
||||
const struct linux32_sys_sigreturn_args *uap, register_t *retval)
|
||||
{
|
||||
/* {
|
||||
syscallarg(linux32_sigcontextp_t) scp;
|
||||
@ -400,7 +404,8 @@ linux32_sys_sigreturn(struct lwp *l, const struct linux32_sys_sigreturn_args *ua
|
||||
}
|
||||
|
||||
int
|
||||
linux32_sys_rt_sigreturn(struct lwp *l, const struct linux32_sys_rt_sigreturn_args *uap, register_t *retval)
|
||||
linux32_sys_rt_sigreturn(struct lwp *l,
|
||||
const struct linux32_sys_rt_sigreturn_args *uap, register_t *retval)
|
||||
{
|
||||
/* {
|
||||
syscallarg(linux32_ucontextp_t) ucp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: osf1_misc.c,v 1.83 2009/11/04 21:23:03 rmind Exp $ */
|
||||
/* $NetBSD: osf1_misc.c,v 1.84 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
|
||||
@ -58,7 +58,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.83 2009/11/04 21:23:03 rmind Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.84 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_syscall_debug.h"
|
||||
@ -84,7 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: osf1_misc.c,v 1.83 2009/11/04 21:23:03 rmind Exp $")
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <machine/alpha.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svr4_lwp.c,v 1.18 2008/04/28 20:23:45 martin Exp $ */
|
||||
/* $NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.18 2008/04/28 20:23:45 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.18 2008/04/28 20:23:45 martin Exp $")
|
||||
#include <sys/time.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/syscallargs.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: svr4_32_lwp.c,v 1.16 2008/04/28 20:23:46 martin Exp $ */
|
||||
/* $NetBSD: svr4_32_lwp.c,v 1.17 2009/11/23 00:46:07 rmind Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.16 2008/04/28 20:23:46 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.17 2009/11/23 00:46:07 rmind Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: svr4_32_lwp.c,v 1.16 2008/04/28 20:23:46 martin Exp
|
||||
#include <sys/time.h>
|
||||
#include <sys/resourcevar.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/user.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/socketvar.h>
|
||||
#include <sys/syscallargs.h>
|
||||
|
Loading…
Reference in New Issue
Block a user