Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Use lwp_getpcb() on m68k ports, clean from struct u...
details: https://anonhg.NetBSD.org/src/rev/df222006f696
branches: trunk
changeset: 749247:df222006f696
user: rmind <rmind%NetBSD.org@localhost>
date: Mon Nov 23 00:11:42 2009 +0000
description:
Use lwp_getpcb() on m68k ports, clean from struct user usage.
diffstat:
sys/arch/amiga/amiga/amiga_init.c | 5 +--
sys/arch/amiga/amiga/genassym.cf | 3 +-
sys/arch/amiga/amiga/machdep.c | 18 +++++++++-------
sys/arch/amiga/amiga/pmap.c | 5 +--
sys/arch/amiga/amiga/pmap_bootstrap.c | 5 +--
sys/arch/amiga/amiga/trap.c | 28 ++++++++++++++------------
sys/arch/amiga/dev/bzivsc.c | 5 +--
sys/arch/amiga/dev/bzsc.c | 5 +--
sys/arch/amiga/dev/bztzsc.c | 5 +--
sys/arch/amiga/dev/cbiisc.c | 5 +--
sys/arch/amiga/dev/cbsc.c | 5 +--
sys/arch/amiga/dev/com_supio.c | 5 +--
sys/arch/amiga/dev/flsc.c | 5 +--
sys/arch/amiga/dev/lpt_supio.c | 5 +--
sys/arch/amiga/include/cpu.h | 3 +-
sys/arch/atari/atari/genassym.cf | 3 +-
sys/arch/atari/atari/machdep.c | 17 ++++++++-------
sys/arch/atari/atari/pmap.c | 5 +--
sys/arch/atari/atari/pmap_bootstrap.c | 3 +-
sys/arch/atari/atari/trap.c | 35 ++++++++++++++++-----------------
sys/arch/atari/dev/lpt.c | 5 +--
sys/arch/atari/dev/ser.c | 5 +--
sys/arch/atari/include/cpu.h | 3 +-
sys/arch/cesfic/cesfic/genassym.cf | 3 +-
sys/arch/cesfic/cesfic/machdep.c | 15 +++++++------
sys/arch/cesfic/cesfic/trap.c | 29 ++++++++++++---------------
sys/arch/luna68k/dev/siotty.c | 5 +--
sys/arch/luna68k/luna68k/genassym.cf | 3 +-
sys/arch/luna68k/luna68k/machdep.c | 15 +++++++------
sys/arch/luna68k/luna68k/trap.c | 29 ++++++++++++---------------
sys/arch/m68k/m68k/compat_13_machdep.c | 5 +--
sys/arch/m68k/m68k/compat_16_machdep.c | 5 +--
sys/arch/m68k/m68k/core_machdep.c | 5 +--
sys/arch/m68k/m68k/db_trace.c | 18 +++++++---------
sys/arch/m68k/m68k/linux_syscall.c | 5 +--
sys/arch/m68k/m68k/linux_trap.c | 5 +--
sys/arch/m68k/m68k/m68k_syscall.c | 5 +--
sys/arch/m68k/m68k/pmap_motorola.c | 5 +--
sys/arch/m68k/m68k/process_machdep.c | 8 +++---
sys/arch/m68k/m68k/sig_machdep.c | 11 +++++----
sys/arch/m68k/m68k/sunos_machdep.c | 5 +--
sys/arch/m68k/m68k/sunos_syscall.c | 5 +--
sys/arch/m68k/m68k/svr4_machdep.c | 5 +--
sys/arch/m68k/m68k/vm_machdep.c | 32 ++++++++++++++++--------------
sys/arch/mac68k/dev/sbc.c | 5 +--
sys/arch/mac68k/mac68k/genassym.cf | 3 +-
sys/arch/mac68k/mac68k/machdep.c | 15 +++++++------
sys/arch/mac68k/mac68k/trap.c | 33 +++++++++++++------------------
sys/arch/mac68k/obio/esp.c | 5 +--
sys/arch/mac68k/obio/sbc_obio.c | 5 +--
sys/arch/mvme68k/mvme68k/genassym.cf | 3 +-
sys/arch/mvme68k/mvme68k/machdep.c | 15 +++++++------
sys/arch/mvme68k/mvme68k/trap.c | 29 ++++++++++++---------------
sys/arch/news68k/news68k/genassym.cf | 3 +-
sys/arch/news68k/news68k/machdep.c | 15 +++++++------
sys/arch/news68k/news68k/trap.c | 29 ++++++++++++---------------
sys/arch/next68k/dev/esp.c | 5 +--
sys/arch/next68k/next68k/genassym.cf | 3 +-
sys/arch/next68k/next68k/machdep.c | 15 +++++++------
sys/arch/next68k/next68k/trap.c | 29 ++++++++++++---------------
sys/arch/x68k/dev/com.c | 5 +--
sys/arch/x68k/dev/mha.c | 5 +--
sys/arch/x68k/x68k/genassym.cf | 3 +-
sys/arch/x68k/x68k/machdep.c | 16 ++++++++------
sys/arch/x68k/x68k/trap.c | 32 +++++++++++++-----------------
65 files changed, 310 insertions(+), 364 deletions(-)
diffs (truncated from 2872 to 300 lines):
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/amiga_init.c
--- a/sys/arch/amiga/amiga/amiga_init.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/amiga_init.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: amiga_init.c,v 1.110 2009/10/26 19:16:54 cegger Exp $ */
+/* $NetBSD: amiga_init.c,v 1.111 2009/11/23 00:11:42 rmind Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -36,13 +36,12 @@
#include "opt_devreload.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.110 2009/10/26 19:16:54 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.111 2009/11/23 00:11:42 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <uvm/uvm_extern.h>
-#include <sys/user.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/tty.h>
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/genassym.cf
--- a/sys/arch/amiga/amiga/genassym.cf Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/genassym.cf Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.26 2008/09/20 18:29:04 tsutsui Exp $
+# $NetBSD: genassym.cf,v 1.27 2009/11/23 00:11:42 rmind Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -41,7 +41,6 @@
include <sys/mbuf.h>
include <sys/msgbuf.h>
include <sys/syscall.h>
-include <sys/user.h>
include <uvm/uvm_extern.h>
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/machdep.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.220 2009/05/19 18:39:26 phx Exp $ */
+/* $NetBSD: machdep.c,v 1.221 2009/11/23 00:11:42 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -86,7 +86,7 @@
#include "opt_panicbutton.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.220 2009/05/19 18:39:26 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.221 2009/11/23 00:11:42 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -101,7 +101,6 @@
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
-#include <sys/user.h>
#include <sys/vnode.h>
#include <sys/device.h>
#include <sys/queue.h>
@@ -334,6 +333,7 @@
setregs(struct lwp *l, struct exec_package *pack, u_long stack)
{
struct frame *frame = (struct frame *)l->l_md.md_regs;
+ struct pcb *pcb = lwp_getpcb(l);
frame->f_sr = PSL_USERSET;
frame->f_pc = pack->ep_entry & ~1;
@@ -355,13 +355,13 @@
frame->f_regs[SP] = stack;
/* restore a null state frame */
- l->l_addr->u_pcb.pcb_fpregs.fpf_null = 0;
+ pcb->pcb_fpregs.fpf_null = 0;
#ifdef FPU_EMULATE
if (!fputype)
- memset(&l->l_addr->u_pcb.pcb_fpregs, 0, sizeof(struct fpframe));
+ memset(&pcb->pcb_fpregs, 0, sizeof(struct fpframe));
else
#endif
- m68881_restore(&l->l_addr->u_pcb.pcb_fpregs);
+ m68881_restore(&pcb->pcb_fpregs);
}
/*
@@ -489,9 +489,11 @@
void
cpu_reboot(register int howto, char *bootstr)
{
+ struct pcb *pcb = lwp_getpcb(curlwp);
+
/* take a snap shot before clobbering any registers */
- if (curlwp->l_addr)
- savectx(&curlwp->l_addr->u_pcb);
+ if (pcb != NULL)
+ savectx(pcb);
boothowto = howto;
if ((howto & RB_NOSYNC) == 0)
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/pmap.c
--- a/sys/arch/amiga/amiga/pmap.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/pmap.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.156 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.157 2009/11/23 00:11:42 rmind Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -100,13 +100,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.156 2009/11/07 07:27:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.157 2009/11/23 00:11:42 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
-#include <sys/user.h>
#include <uvm/uvm.h>
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/pmap_bootstrap.c
--- a/sys/arch/amiga/amiga/pmap_bootstrap.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/pmap_bootstrap.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_bootstrap.c,v 1.6 2009/03/14 15:36:00 dsl Exp $ */
+/* $NetBSD: pmap_bootstrap.c,v 1.7 2009/11/23 00:11:42 rmind Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -65,13 +65,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.6 2009/03/14 15:36:00 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.7 2009/11/23 00:11:42 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/malloc.h>
-#include <sys/user.h>
#include <uvm/uvm.h>
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/amiga/trap.c
--- a/sys/arch/amiga/amiga/trap.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/amiga/trap.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.126 2009/05/19 18:39:26 phx Exp $ */
+/* $NetBSD: trap.c,v 1.127 2009/11/23 00:11:43 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
#include "opt_fpu_emulate.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.126 2009/05/19 18:39:26 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.127 2009/11/23 00:11:43 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -96,7 +96,6 @@
#include <sys/syscall.h>
#include <sys/sa.h>
#include <sys/savar.h>
-#include <sys/user.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@@ -290,6 +289,8 @@
void
trapcpfault(struct lwp *l, struct frame *fp)
{
+ struct pcb *pcb = lwp_getpcb(l);
+
/*
* We have arranged to catch this fault in one of the
* copy to/from user space routines, set PC to return to
@@ -298,7 +299,7 @@
*/
fp->f_stackadj = exframesize[fp->f_format];
fp->f_format = fp->f_vector = 0;
- fp->f_pc = (int) l->l_addr->u_pcb.pcb_onfault;
+ fp->f_pc = (int)pcb->pcb_onfault;
}
int donomore = 0;
@@ -313,6 +314,7 @@
extern struct vm_map *kernel_map;
struct proc *p = l->l_proc;
struct vmspace *vm = NULL;
+ struct pcb *pcb;
vm_prot_t ftype;
vaddr_t va;
struct vm_map *map;
@@ -375,8 +377,8 @@
if (p)
vm = p->p_vmspace;
- if (type == T_MMUFLT &&
- (l == &lwp0 || !l->l_addr || l->l_addr->u_pcb.pcb_onfault == 0 || (
+ pcb = lwp_getpcb(l);
+ if (type == T_MMUFLT && (l == &lwp0 || !pcb|| pcb->pcb_onfault == 0 || (
#ifdef M68060
machineid & AMIGA_68060 ? code & FSLW_TM_SV :
#endif
@@ -501,7 +503,7 @@
} else
ksi.ksi_code = SEGV_MAPERR;
if (type == T_MMUFLT) {
- if (l->l_addr->u_pcb.pcb_onfault) {
+ if (pcb->pcb_onfault) {
trapcpfault(l, fp);
return;
}
@@ -537,6 +539,7 @@
{
struct lwp *l;
struct proc *p;
+ struct pcb *pcb;
ksiginfo_t ksi;
u_quad_t sticks = 0;
@@ -547,6 +550,7 @@
ksi.ksi_trap = type & ~T_USER;
p = l->l_proc;
+ pcb = lwp_getpcb(l);
if (USERMODE(fp->f_sr)) {
type |= T_USER;
@@ -574,7 +578,7 @@
* Kernel Bus error
*/
case T_BUSERR:
- if (!l || !l->l_addr || !l->l_addr->u_pcb.pcb_onfault)
+ if (!l || !pcb || !pcb->pcb_onfault)
panictrap(type, code, v, fp);
trapcpfault(l, fp);
return;
@@ -613,8 +617,7 @@
case T_FPEMULI|T_USER:
case T_FPEMULD|T_USER:
#ifdef FPU_EMULATE
- if (fpu_emulate(fp, &l->l_addr->u_pcb.pcb_fpregs,
- &ksi) == 0)
+ if (fpu_emulate(fp, &pcb->pcb_fpregs, &ksi) == 0)
; /* XXX - Deal with tracing? (fp->f_sr & PSL_T) */
#else
printf("pid %d killed: no floating point support\n", p->p_pid);
@@ -731,9 +734,8 @@
* Kernel/User page fault
*/
case T_MMUFLT:
- if (l && l->l_addr &&
- (l->l_addr->u_pcb.pcb_onfault == (void *)fubail ||
- l->l_addr->u_pcb.pcb_onfault == (void *)subail)) {
+ if (l && pcb && (pcb->pcb_onfault == (void *)fubail ||
+ pcb->pcb_onfault == (void *)subail)) {
trapcpfault(l, fp);
return;
}
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/dev/bzivsc.c
--- a/sys/arch/amiga/dev/bzivsc.c Sun Nov 22 21:41:03 2009 +0000
+++ b/sys/arch/amiga/dev/bzivsc.c Mon Nov 23 00:11:42 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bzivsc.c,v 1.27 2009/10/21 23:53:38 snj Exp $ */
+/* $NetBSD: bzivsc.c,v 1.28 2009/11/23 00:11:43 rmind Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.27 2009/10/21 23:53:38 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.28 2009/11/23 00:11:43 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -43,7 +43,6 @@
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
diff -r ad17263586e8 -r df222006f696 sys/arch/amiga/dev/bzsc.c
Home |
Main Index |
Thread Index |
Old Index