Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha - Use lwp_getpcb() on Alpha.
details: https://anonhg.NetBSD.org/src/rev/8974058d8303
branches: trunk
changeset: 749193:8974058d8303
user: rmind <rmind%NetBSD.org@localhost>
date: Sat Nov 21 05:35:40 2009 +0000
description:
- Use lwp_getpcb() on Alpha.
- Replace and clean struct user usage, slightly simplify some code parts.
- Include sys/user.h in MD proc.h .
diffstat:
sys/arch/alpha/a12/a12dc.c | 7 +-
sys/arch/alpha/alpha/compat_13_machdep.c | 11 ++--
sys/arch/alpha/alpha/compat_16_machdep.c | 18 ++++---
sys/arch/alpha/alpha/core_machdep.c | 10 ++--
sys/arch/alpha/alpha/cpu.c | 7 +-
sys/arch/alpha/alpha/db_trace.c | 7 +-
sys/arch/alpha/alpha/linux_syscall.c | 5 +-
sys/arch/alpha/alpha/linux_trap.c | 5 +-
sys/arch/alpha/alpha/machdep.c | 58 ++++++++++++++----------
sys/arch/alpha/alpha/osf1_syscall.c | 5 +-
sys/arch/alpha/alpha/pmap.c | 18 +++---
sys/arch/alpha/alpha/process_machdep.c | 23 +++++----
sys/arch/alpha/alpha/prom.c | 10 ++--
sys/arch/alpha/alpha/promcons.c | 5 +-
sys/arch/alpha/alpha/syscall.c | 5 +-
sys/arch/alpha/alpha/trap.c | 66 ++++++++++++++++------------
sys/arch/alpha/alpha/vm_machdep.c | 74 ++++++++++++++++---------------
sys/arch/alpha/include/proc.h | 3 +-
sys/arch/alpha/jensenio/com_jensenio.c | 5 +-
sys/arch/alpha/jensenio/lpt_jensenio.c | 5 +-
sys/arch/alpha/sableio/com_sableio.c | 5 +-
sys/arch/alpha/sableio/lpt_sableio.c | 5 +-
22 files changed, 185 insertions(+), 172 deletions(-)
diffs (truncated from 1208 to 300 lines):
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/a12/a12dc.c
--- a/sys/arch/alpha/a12/a12dc.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/a12/a12dc.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: a12dc.c,v 1.23 2009/03/18 10:22:22 cegger Exp $ */
+/* $NetBSD: a12dc.c,v 1.24 2009/11/21 05:35:40 rmind Exp $ */
/* [Notice revision 2.2]
* Copyright (c) 1997, 1998 Avalon Computer Systems, Inc.
@@ -64,7 +64,7 @@
#ifndef BSIDE
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.23 2009/03/18 10:22:22 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a12dc.c,v 1.24 2009/11/21 05:35:40 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -73,7 +73,6 @@
#include <sys/tty.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/uio.h>
#include <sys/device.h>
#include <sys/conf.h>
@@ -159,7 +158,7 @@
/* note that we've attached the chipset; can't have 2 A12Cs. */
a12dcfound = 1;
- printf(": driver %s\n", "$Revision: 1.23 $");
+ printf(": driver %s\n", "$Revision: 1.24 $");
tp = a12dc_tty[0] = ttymalloc();
tp->t_oproc = a12dcstart;
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/compat_13_machdep.c
--- a/sys/arch/alpha/alpha/compat_13_machdep.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/compat_13_machdep.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_13_machdep.c,v 1.17 2008/04/24 18:39:20 ad Exp $ */
+/* $NetBSD: compat_13_machdep.c,v 1.18 2009/11/21 05:35:40 rmind Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,14 +29,13 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.17 2008/04/24 18:39:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.18 2009/11/21 05:35:40 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/mount.h>
#include <sys/syscallargs.h>
@@ -66,6 +65,7 @@
} */
struct sigcontext13 *scp, ksc;
struct proc *p = l->l_proc;
+ struct pcb *pcb;
sigset13_t mask13;
sigset_t mask;
@@ -93,9 +93,10 @@
alpha_pal_wrusp(ksc.sc_regs[R_SP]);
/* XXX ksc.sc_ownedfp ? */
- if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
+ pcb = lwp_getpcb(l);
+ if (pcb->pcb_fpcpu != NULL)
fpusave_proc(l, 0);
- memcpy(&l->l_addr->u_pcb.pcb_fp, (struct fpreg *)ksc.sc_fpregs,
+ memcpy(&pcb->pcb_fp, (struct fpreg *)ksc.sc_fpregs,
sizeof(struct fpreg));
/* XXX ksc.sc_fp_control ? */
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/compat_16_machdep.c
--- a/sys/arch/alpha/alpha/compat_16_machdep.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/compat_16_machdep.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_16_machdep.c,v 1.15 2008/11/21 19:48:56 he Exp $ */
+/* $NetBSD: compat_16_machdep.c,v 1.16 2009/11/21 05:35:40 rmind Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -77,7 +77,6 @@
#include <sys/systm.h>
#include <sys/syscall.h>
#include <sys/syscallargs.h>
-#include <sys/user.h>
#if defined(COMPAT_13) || defined(COMPAT_OSF1)
#include <compat/sys/signal.h>
@@ -87,7 +86,7 @@
#include <machine/cpu.h>
#include <machine/reg.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.15 2008/11/21 19:48:56 he Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.16 2009/11/21 05:35:40 rmind Exp $");
#ifdef DEBUG
@@ -106,6 +105,7 @@
{
struct lwp *l = curlwp;
struct proc *p = l->l_proc;
+ struct pcb *pcb = lwp_getpcb(l);
struct sigacts *ps = p->p_sigacts;
int onstack, sig = ksi->ksi_signo, error;
struct sigframe_sigcontext *fp, frame;
@@ -132,10 +132,10 @@
frame.sf_sc.sc_regs[R_SP] = alpha_pal_rdusp();
/* save the floating-point state, if necessary, then copy it. */
- if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
+ if (pcb->pcb_fpcpu != NULL)
fpusave_proc(l, 1);
frame.sf_sc.sc_ownedfp = l->l_md.md_flags & MDP_FPUSED;
- memcpy((struct fpreg *)frame.sf_sc.sc_fpregs, &l->l_addr->u_pcb.pcb_fp,
+ memcpy((struct fpreg *)frame.sf_sc.sc_fpregs, &pcb->pcb_fp,
sizeof(struct fpreg));
frame.sf_sc.sc_fp_control = alpha_read_fp_c(l);
memset(frame.sf_sc.sc_reserved, 0, sizeof frame.sf_sc.sc_reserved);
@@ -252,6 +252,7 @@
} */
struct sigcontext *scp, ksc;
struct proc *p = l->l_proc;
+ struct pcb *pcb;
/*
* The trampoline code hands us the context.
@@ -281,11 +282,12 @@
alpha_pal_wrusp(ksc.sc_regs[R_SP]);
/* XXX ksc.sc_ownedfp ? */
- if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
+ pcb = lwp_getpcb(l);
+ if (pcb->pcb_fpcpu != NULL)
fpusave_proc(l, 0);
- memcpy(&l->l_addr->u_pcb.pcb_fp, (struct fpreg *)ksc.sc_fpregs,
+ memcpy(&pcb->pcb_fp, (struct fpreg *)ksc.sc_fpregs,
sizeof(struct fpreg));
- l->l_addr->u_pcb.pcb_fp.fpr_cr = ksc.sc_fpcr;
+ pcb->pcb_fp.fpr_cr = ksc.sc_fpcr;
l->l_md.md_flags = ksc.sc_fp_control & MDP_FP_C;
mutex_enter(p->p_lock);
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/core_machdep.c
--- a/sys/arch/alpha/alpha/core_machdep.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/core_machdep.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.2 2009/08/15 23:44:57 matt Exp $ */
+/* $NetBSD: core_machdep.c,v 1.3 2009/11/21 05:35:40 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: core_machdep.c,v 1.2 2009/08/15 23:44:57 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.3 2009/11/21 05:35:40 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -37,7 +37,6 @@
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/vnode.h>
-#include <sys/user.h>
#include <sys/core.h>
#include <sys/exec.h>
@@ -72,9 +71,10 @@
cpustate.md_tf = *l->l_md.md_tf;
cpustate.md_tf.tf_regs[FRAME_SP] = alpha_pal_rdusp(); /* XXX */
if (l->l_md.md_flags & MDP_FPUSED) {
- if (l->l_addr->u_pcb.pcb_fpcpu != NULL)
+ struct pcb *pcb = lwp_getpcb(l);
+ if (pcb->pcb_fpcpu != NULL)
fpusave_proc(l, 1);
- cpustate.md_fpstate = l->l_addr->u_pcb.pcb_fp;
+ cpustate.md_fpstate = pcb->pcb_fp;
} else
memset(&cpustate.md_fpstate, 0, sizeof(cpustate.md_fpstate));
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/cpu.c
--- a/sys/arch/alpha/alpha/cpu.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/cpu.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.86 2009/09/06 18:06:24 mhitch Exp $ */
+/* $NetBSD: cpu.c,v 1.87 2009/11/21 05:35:40 rmind Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.86 2009/09/06 18:06:24 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.87 2009/11/21 05:35:40 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -69,7 +69,6 @@
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/atomic.h>
#include <sys/cpu.h>
@@ -425,7 +424,7 @@
struct pcb *pcb;
u_long cpumask;
- pcb = &ci->ci_data.cpu_idlelwp->l_addr->u_pcb;
+ pcb = lwp_getpcb(ci->ci_data.cpu_idlelwp);
primary_pcsp = LOCATE_PCS(hwrpb, hwrpb->rpb_primary_cpu_id);
pcsp = LOCATE_PCS(hwrpb, ci->ci_cpuid);
cpumask = (1UL << ci->ci_cpuid);
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/db_trace.c
--- a/sys/arch/alpha/alpha/db_trace.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/db_trace.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_trace.c,v 1.25 2009/10/21 21:11:58 rmind Exp $ */
+/* $NetBSD: db_trace.c,v 1.26 2009/11/21 05:35:40 rmind Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,12 +35,11 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.25 2009/10/21 21:11:58 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.26 2009/11/21 05:35:40 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <machine/alpha.h>
#include <machine/db_machdep.h>
@@ -230,7 +229,7 @@
KASSERT(l != NULL);
}
(*pr)("lid %d ", l->l_lid);
- pcbp = &l->l_addr->u_pcb;
+ pcbp = lwp_getpcb(l);
addr = (db_expr_t)pcbp->pcb_hw.apcb_ksp;
callpc = pcbp->pcb_context[7];
(*pr)("at 0x%lx\n", addr);
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/linux_syscall.c
--- a/sys/arch/alpha/alpha/linux_syscall.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/linux_syscall.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.c,v 1.29 2008/10/21 12:16:58 ad Exp $ */
+/* $NetBSD: linux_syscall.c,v 1.30 2009/11/21 05:35:40 rmind Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -89,12 +89,11 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.29 2008/10/21 12:16:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.30 2009/11/21 05:35:40 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/signal.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
diff -r 2b1eaf3c5ce3 -r 8974058d8303 sys/arch/alpha/alpha/linux_trap.c
--- a/sys/arch/alpha/alpha/linux_trap.c Sat Nov 21 04:45:39 2009 +0000
+++ b/sys/arch/alpha/alpha/linux_trap.c Sat Nov 21 05:35:40 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_trap.c,v 1.7 2008/04/28 20:23:10 martin Exp $ */
+/* $NetBSD: linux_trap.c,v 1.8 2009/11/21 05:35:40 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,12 +30,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.7 2008/04/28 20:23:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_trap.c,v 1.8 2009/11/21 05:35:40 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
Home |
Main Index |
Thread Index |
Old Index