Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nathanw_sa]: src/sys/arch/sun2/sun2 LWPify
details: https://anonhg.NetBSD.org/src/rev/7b9d76618c30
branches: nathanw_sa
changeset: 506296:7b9d76618c30
user: gmcgarry <gmcgarry%NetBSD.org@localhost>
date: Sat Oct 05 07:11:56 2002 +0000
description:
LWPify
diffstat:
sys/arch/sun2/sun2/genassym.cf | 35 ++++++++++++++++++++++-------------
sys/arch/sun2/sun2/locore.s | 4 ++--
sys/arch/sun2/sun2/locore2.c | 4 ++--
sys/arch/sun2/sun2/machdep.c | 4 ++--
sys/arch/sun2/sun2/machdep.h | 5 +++--
sys/arch/sun2/sun2/trap.c | 6 +++---
sys/arch/sun2/sun2/vm_machdep.c | 10 +++++-----
7 files changed, 39 insertions(+), 29 deletions(-)
diffs (188 lines):
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/genassym.cf
--- a/sys/arch/sun2/sun2/genassym.cf Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/genassym.cf Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.1.2.3 2002/06/20 03:41:38 nathanw Exp $
+# $NetBSD: genassym.cf,v 1.1.2.4 2002/10/05 07:11:56 gmcgarry Exp $
#
# Copyright (c) 1994, 1995 Gordon W. Ross
@@ -126,19 +126,25 @@
# unix structure-isms
#
-# proc fields and values
-define P_FORW offsetof(struct proc, p_forw)
-define P_BACK offsetof(struct proc, p_back)
+# lwp & proc fields and values
+define L_ADDR offsetof(struct lwp, l_addr)
+define L_FORW offsetof(struct lwp, l_forw)
+define L_BACK offsetof(struct lwp, l_back)
+define L_PRIORITY offsetof(struct lwp, l_priority)
+define L_STAT offsetof(struct lwp, l_stat)
+define L_WCHAN offsetof(struct lwp, l_wchan)
+define L_PROC offsetof(struct lwp, l_proc)
+define L_MD_REGS offsetof(struct lwp, l_md.md_regs)
+define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags)
+define P_FLAG offsetof(struct proc, p_flag)
+define P_NRAS offsetof(struct proc, p_nras)
define P_VMSPACE offsetof(struct proc, p_vmspace)
-define P_ADDR offsetof(struct proc, p_addr)
-define P_PRIORITY offsetof(struct proc, p_priority)
-define P_STAT offsetof(struct proc, p_stat)
-define P_WCHAN offsetof(struct proc, p_wchan)
-define P_FLAG offsetof(struct proc, p_flag)
-define P_MDFLAG offsetof(struct proc, p_md.md_flags)
-define P_MDREGS offsetof(struct proc, p_md.md_regs)
-define SRUN SRUN
-define SONPROC SONPROC
+
+# lwp fields and values
+
+define LSSLEEP LSSLEEP
+define LSRUN LSRUN
+define LSONPROC LSONPROC
# XXX: HP-UX trace bit?
@@ -155,6 +161,9 @@
define PCB_FPCTX offsetof(struct pcb, pcb_fpregs)
define SIZEOF_PCB sizeof(struct pcb)
+# frame offsets
+define TF_PC offsetof(struct frame, f_pc)
+
# exception frame offset/sizes
define FR_SP offsetof(struct trapframe, tf_regs[15])
define FR_ADJ offsetof(struct trapframe, tf_stackadj)
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/locore.s
--- a/sys/arch/sun2/sun2/locore.s Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/locore.s Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.9.6.4 2002/01/08 00:28:11 nathanw Exp $ */
+/* $NetBSD: locore.s,v 1.9.6.5 2002/10/05 07:11:56 gmcgarry Exp $ */
/*
* Copyright (c) 2001 Matthew Fredette
@@ -147,7 +147,7 @@
lea %sp@(-64),%sp | tf_regs[16]
movl %sp,%a1 | %a1=trapframe
lea _C_LABEL(proc0),%a0 | proc0.p_md.md_regs =
- movl %a1,%a0@(P_MDREGS) | trapframe
+ movl %a1,%a0@(L_MD_REGS) | trapframe
movl %a2,%a1@(FR_SP) | a2 == usp (from above)
pea %a1@ | push &trapframe
jbsr _C_LABEL(main) | main(&trapframe)
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/locore2.c
--- a/sys/arch/sun2/sun2/locore2.c Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/locore2.c Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore2.c,v 1.5.8.6 2002/08/13 02:18:58 nathanw Exp $ */
+/* $NetBSD: locore2.c,v 1.5.8.7 2002/10/05 07:11:56 gmcgarry Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -194,7 +194,7 @@
proc0paddr = (struct user *) nextva;
nextva += USPACE;
memset((caddr_t)proc0paddr, 0, USPACE);
- lwp0.p_addr = proc0paddr;
+ lwp0.l_addr = proc0paddr;
/*
* Now that lwp0 exists, make it the "current" one.
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/machdep.c
--- a/sys/arch/sun2/sun2/machdep.c Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/machdep.c Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.11.4.9 2002/09/17 21:18:11 nathanw Exp $ */
+/* $NetBSD: machdep.c,v 1.11.4.10 2002/10/05 07:11:56 gmcgarry Exp $ */
/*
* Copyright (c) 2001 Matthew Fredette.
@@ -434,7 +434,7 @@
tf->tf_regs[D7] = 0;
tf->tf_regs[A0] = 0;
tf->tf_regs[A1] = 0;
- tf->tf_regs[A2] = (int)p->p_psstr;
+ tf->tf_regs[A2] = (int)l->l_proc->p_psstr;
tf->tf_regs[A3] = 0;
tf->tf_regs[A4] = 0;
tf->tf_regs[A5] = 0;
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/machdep.h
--- a/sys/arch/sun2/sun2/machdep.h Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/machdep.h Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.4.8.3 2002/04/01 07:43:21 nathanw Exp $ */
+/* $NetBSD: machdep.h,v 1.4.8.4 2002/10/05 07:11:57 gmcgarry Exp $ */
/*
* Copyright (c) 2001 Matthew Fredette
@@ -101,7 +101,8 @@
void swapconf __P((void));
-void switch_exit __P((struct proc *));
+void switch_exit __P((struct lwp *));
+void switch_lwp_exit __P((struct lwp *));
void zs_init __P((void));
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/trap.c
--- a/sys/arch/sun2/sun2/trap.c Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/trap.c Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.4.6.10 2002/09/26 20:04:53 nathanw Exp $ */
+/* $NetBSD: trap.c,v 1.4.6.11 2002/10/05 07:11:57 gmcgarry Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -167,7 +167,7 @@
*/
static void
userret(l, tf, oticks)
- struct lwp *p;
+ struct lwp *l;
struct trapframe *tf;
u_quad_t oticks;
{
@@ -195,7 +195,7 @@
(int)(p->p_sticks - oticks) * psratio);
}
- curcpu()->ci_schedstate.spc_curpriority = p->p_priority = l->l_usrpri;
+ curcpu()->ci_schedstate.spc_curpriority = l->l_priority = l->l_usrpri;
}
/*
diff -r 9543db662171 -r 7b9d76618c30 sys/arch/sun2/sun2/vm_machdep.c
--- a/sys/arch/sun2/sun2/vm_machdep.c Sat Oct 05 06:42:31 2002 +0000
+++ b/sys/arch/sun2/sun2/vm_machdep.c Sat Oct 05 07:11:56 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.5.4.7 2002/07/12 01:39:51 nathanw Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.5.4.8 2002/10/05 07:11:57 gmcgarry Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@@ -245,8 +245,8 @@
* Do any additional state-saving necessary before swapout.
*/
void
-cpu_swapout(p)
- struct proc *p;
+cpu_swapout(l)
+ struct lwp *l;
{
/*
@@ -262,8 +262,8 @@
* reside in different physical pages.
*/
void
-cpu_swapin(p)
- struct proc *p;
+cpu_swapin(l)
+ struct lwp *l;
{
/*
Home |
Main Index |
Thread Index |
Old Index