Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Merge the nathanw_sa branch.
details: https://anonhg.NetBSD.org/src/rev/93a3e9f46fb0
branches: trunk
changeset: 541727:93a3e9f46fb0
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri Jan 17 21:55:23 2003 +0000
description:
Merge the nathanw_sa branch.
diffstat:
sys/arch/acorn26/acorn26/Locore.c | 68 +++-
sys/arch/acorn26/acorn26/copyinout.S | 24 +-
sys/arch/acorn26/acorn26/cpu.c | 12 +-
sys/arch/acorn26/acorn26/except.c | 59 ++-
sys/arch/acorn26/acorn26/genassym.cf | 4 +-
sys/arch/acorn26/acorn26/machdep.c | 6 +-
sys/arch/acorn26/acorn26/pmap.c | 10 +-
sys/arch/acorn26/acorn26/sys_machdep.c | 6 +-
sys/arch/acorn26/acorn26/vm_machdep.c | 52 ++-
sys/arch/acorn26/include/Makefile | 4 +-
sys/arch/acorn26/include/mcontext.h | 3 +
sys/arch/acorn26/include/proc.h | 6 +-
sys/arch/acorn32/acorn32/rpc_machdep.c | 6 +-
sys/arch/acorn32/include/Makefile | 4 +-
sys/arch/acorn32/include/mcontext.h | 3 +
sys/arch/algor/algor/machdep.c | 12 +-
sys/arch/algor/include/Makefile | 4 +-
sys/arch/algor/include/mcontext.h | 3 +
sys/arch/alpha/alpha/compat_13_machdep.c | 27 +-
sys/arch/alpha/alpha/cpu.c | 12 +-
sys/arch/alpha/alpha/db_interface.c | 8 +-
sys/arch/alpha/alpha/db_trace.c | 10 +-
sys/arch/alpha/alpha/fp_complete.c | 118 +++---
sys/arch/alpha/alpha/genassym.cf | 29 +-
sys/arch/alpha/alpha/interrupt.c | 17 +-
sys/arch/alpha/alpha/ipifuncs.c | 8 +-
sys/arch/alpha/alpha/linux_syscall.c | 44 +-
sys/arch/alpha/alpha/linux_trap.c | 6 +-
sys/arch/alpha/alpha/locore.s | 286 ++++++++++--------
sys/arch/alpha/alpha/machdep.c | 233 +++++++++++----
sys/arch/alpha/alpha/osf1_syscall.c | 44 +-
sys/arch/alpha/alpha/pmap.c | 60 ++--
sys/arch/alpha/alpha/process_machdep.c | 48 +-
sys/arch/alpha/alpha/prom.c | 8 +-
sys/arch/alpha/alpha/sys_machdep.c | 19 +-
sys/arch/alpha/alpha/syscall.c | 55 ++-
sys/arch/alpha/alpha/trap.c | 231 ++++++++------
sys/arch/alpha/alpha/vm_machdep.c | 105 ++++--
sys/arch/alpha/include/Makefile | 4 +-
sys/arch/alpha/include/alpha.h | 20 +-
sys/arch/alpha/include/alpha_cpu.h | 24 +-
sys/arch/alpha/include/cpu.h | 17 +-
sys/arch/alpha/include/ieeefp.h | 4 +-
sys/arch/alpha/include/mcontext.h | 107 +++++++
sys/arch/alpha/include/pmap.h | 4 +-
sys/arch/alpha/include/proc.h | 26 +-
sys/arch/alpha/include/signal.h | 40 ++-
sys/arch/alpha/include/userret.h | 17 +-
sys/arch/amiga/amiga/autoconf.c | 5 +-
sys/arch/amiga/amiga/genassym.cf | 39 +-
sys/arch/amiga/amiga/locore.s | 309 +--------------------
sys/arch/amiga/amiga/machdep.c | 25 +-
sys/arch/amiga/amiga/pmap.c | 25 +-
sys/arch/amiga/amiga/trap.c | 104 +++---
sys/arch/amiga/include/Makefile | 4 +-
sys/arch/amiga/include/cpu.h | 8 +-
sys/arch/amiga/include/mcontext.h | 3 +
sys/arch/amiga/include/pmap.h | 8 +-
sys/arch/arc/arc/arc_trap.c | 6 +-
sys/arch/arc/arc/machdep.c | 17 +-
sys/arch/arc/include/Makefile | 4 +-
sys/arch/arc/include/mcontext.h | 3 +
sys/arch/arc/jazz/asc.c | 4 +-
sys/arch/arm/arm/arm_machdep.c | 130 ++++++++-
sys/arch/arm/arm/ast.c | 33 +-
sys/arch/arm/arm/compat_13_machdep.c | 10 +-
sys/arch/arm/arm/db_trace.c | 10 +-
sys/arch/arm/arm/linux_syscall.c | 17 +-
sys/arch/arm/arm/linux_trap.c | 6 +-
sys/arch/arm/arm/process_machdep.c | 24 +-
sys/arch/arm/arm/sig_machdep.c | 111 ++++++-
sys/arch/arm/arm/syscall.c | 50 +-
sys/arch/arm/arm/undefined.c | 49 +-
sys/arch/arm/arm/vm_machdep_arm.c | 11 +-
sys/arch/arm/arm32/arm32_machdep.c | 10 +-
sys/arch/arm/arm32/bus_dma.c | 5 +-
sys/arch/arm/arm32/cpuswitch.S | 356 ++++++++++++++++-------
sys/arch/arm/arm32/fault.c | 57 ++-
sys/arch/arm/arm32/genassym.cf | 30 +-
sys/arch/arm/arm32/pmap.c | 22 +-
sys/arch/arm/arm32/sys_machdep.c | 8 +-
sys/arch/arm/arm32/vm_machdep.c | 112 ++++--
sys/arch/arm/footbridge/dc21285reg.h | 4 +-
sys/arch/arm/footbridge/footbridge_clock.c | 6 +-
sys/arch/arm/fpe-arm/armfpe_init.c | 6 +-
sys/arch/arm/include/Makefile | 4 +-
sys/arch/arm/include/cpu.h | 17 +-
sys/arch/arm/include/frame.h | 18 +-
sys/arch/arm/include/mcontext.h | 106 +++++++
sys/arch/arm/include/proc.h | 17 +-
sys/arch/arm/include/signal.h | 25 +-
sys/arch/arm/xscale/xscale_pmc.c | 51 ++-
sys/arch/atari/atari/atari_init.c | 6 +-
sys/arch/atari/atari/genassym.cf | 47 ++-
sys/arch/atari/atari/locore.s | 283 +------------------
sys/arch/atari/atari/machdep.c | 22 +-
sys/arch/atari/atari/pmap.c | 21 +-
sys/arch/atari/atari/trap.c | 98 +++---
sys/arch/atari/dev/clock.c | 3 +-
sys/arch/atari/include/Makefile | 4 +-
sys/arch/atari/include/cpu.h | 7 +-
sys/arch/atari/include/mcontext.h | 3 +
sys/arch/bebox/bebox/machdep.c | 3 +-
sys/arch/bebox/include/Makefile | 4 +-
sys/arch/bebox/include/mcontext.h | 3 +
sys/arch/bebox/include/pte.h | 3 +
sys/arch/bebox/isa/pccons.c | 6 +-
sys/arch/cats/cats/cats_machdep.c | 4 +-
sys/arch/cats/include/Makefile | 4 +-
sys/arch/cats/include/mcontext.h | 3 +
sys/arch/cesfic/cesfic/genassym.cf | 43 ++-
sys/arch/cesfic/cesfic/machdep.c | 22 +-
sys/arch/cesfic/cesfic/trap.c | 82 +++--
sys/arch/cesfic/include/Makefile | 4 +-
sys/arch/cesfic/include/cpu.h | 7 +-
sys/arch/cesfic/include/mcontext.h | 3 +
sys/arch/cobalt/cobalt/machdep.c | 11 +-
sys/arch/cobalt/include/Makefile | 4 +-
sys/arch/cobalt/include/mcontext.h | 3 +
sys/arch/dreamcast/dreamcast/machdep.c | 4 +-
sys/arch/dreamcast/include/Makefile | 4 +-
sys/arch/dreamcast/include/mcontext.h | 3 +
sys/arch/evbarm/include/Makefile | 4 +-
sys/arch/evbarm/include/mcontext.h | 3 +
sys/arch/evbarm/integrator/integrator_machdep.c | 4 +-
sys/arch/evbarm/iq80310/iq80310_machdep.c | 6 +-
sys/arch/evbmips/alchemy/machdep.c | 10 +-
sys/arch/evbmips/include/Makefile | 4 +-
sys/arch/evbmips/include/mcontext.h | 3 +
sys/arch/evbmips/malta/machdep.c | 10 +-
sys/arch/evbppc/evbppc/genassym.cf | 16 +-
sys/arch/evbppc/include/Makefile | 4 +-
sys/arch/evbppc/include/frame.h | 10 +-
sys/arch/evbppc/include/mcontext.h | 3 +
sys/arch/evbppc/walnut/machdep.c | 16 +-
sys/arch/evbsh3/evbsh3/machdep.c | 4 +-
sys/arch/evbsh3/include/Makefile | 4 +-
sys/arch/evbsh3/include/mcontext.h | 3 +
sys/arch/hp300/dev/sd.c | 6 +-
sys/arch/hp300/hp300/genassym.cf | 36 +-
sys/arch/hp300/hp300/hpux_machdep.c | 53 +-
sys/arch/hp300/hp300/locore.s | 267 +-----------------
sys/arch/hp300/hp300/machdep.c | 24 +-
sys/arch/hp300/hp300/trap.c | 85 +++--
sys/arch/hp300/include/Makefile | 4 +-
sys/arch/hp300/include/cpu.h | 7 +-
sys/arch/hp300/include/hpux_machdep.h | 6 +-
sys/arch/hp300/include/mcontext.h | 3 +
sys/arch/hp300/include/param.h | 4 +-
sys/arch/hpcarm/include/Makefile | 4 +-
sys/arch/hpcarm/include/mcontext.h | 3 +
sys/arch/hpcmips/include/Makefile | 4 +-
sys/arch/hpcmips/include/mcontext.h | 3 +
153 files changed, 2772 insertions(+), 2341 deletions(-)
diffs (truncated from 11795 to 300 lines):
diff -r 86132e30ab17 -r 93a3e9f46fb0 sys/arch/acorn26/acorn26/Locore.c
--- a/sys/arch/acorn26/acorn26/Locore.c Fri Jan 17 21:52:10 2003 +0000
+++ b/sys/arch/acorn26/acorn26/Locore.c Fri Jan 17 21:55:23 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: Locore.c,v 1.6 2003/01/08 00:00:03 thorpej Exp $ */
+/* $NetBSD: Locore.c,v 1.7 2003/01/17 21:55:23 thorpej Exp $ */
/*
* Copyright (c) 2000 Ben Harris.
@@ -41,7 +41,7 @@
#include <sys/param.h>
-__RCSID("$NetBSD: Locore.c,v 1.6 2003/01/08 00:00:03 thorpej Exp $");
+__RCSID("$NetBSD: Locore.c,v 1.7 2003/01/17 21:55:23 thorpej Exp $");
#include <sys/proc.h>
#include <sys/sched.h>
@@ -82,47 +82,48 @@
/*
* Find the highest-priority runnable process and switch to it.
*/
-void
-cpu_switch(struct proc *p1, struct proc *newp)
+int
+cpu_switch(struct lwp *l1, struct lwp *newl)
{
int which;
struct prochd *q;
+ struct lwp *l2;
struct proc *p2;
-
/*
* We enter here with interrupts blocked and sched_lock held.
*/
#if 0
- printf("cpu_switch: %p ->", p1);
+ printf("cpu_switch: %p ->", l1);
#endif
- curproc = NULL;
+ curlwp = NULL;
curpcb = NULL;
while (sched_whichqs == 0)
idle();
which = ffs(sched_whichqs) - 1;
q = &sched_qs[which];
- p2 = q->ph_link;
- remrunqueue(p2);
+ l2 = q->ph_link;
+ remrunqueue(l2);
want_resched = 0;
#ifdef LOCKDEBUG
sched_unlock_idle();
#endif
/* p->p_cpu initialized in fork1() for single-processor */
- p2->p_stat = SONPROC;
- curproc = p2;
- curpcb = &curproc->p_addr->u_pcb;
+ l2->l_stat = LSONPROC;
+ curlwp = l2;
+ curpcb = &curlwp->l_addr->u_pcb;
#if 0
- printf(" %p\n", p2);
+ printf(" %p\n", l2);
#endif
- if (p2 == p1)
- return;
- pmap_deactivate(p1);
- pmap_activate(p2);
+ if (l2 == l1)
+ return (0);
+ pmap_deactivate(l1);
+ pmap_activate(l2);
/* Check for Restartable Atomic Sequences. */
+ p2 = l2->l_proc;
if (p2->p_nras != 0) {
- struct trapframe *tf = p2->p_addr->u_pcb.pcb_tf;
+ struct trapframe *tf = l2->l_addr->u_pcb.pcb_tf;
caddr_t pc;
pc = ras_lookup(p2, (caddr_t) tf->tf_pc);
@@ -130,6 +131,35 @@
tf->tf_pc = (register_t) pc;
}
- cpu_loswitch(&p1->p_addr->u_pcb.pcb_sf, p2->p_addr->u_pcb.pcb_sf);
+ cpu_loswitch(&l1->l_addr->u_pcb.pcb_sf, l2->l_addr->u_pcb.pcb_sf);
+ /* We only get back here after the other process has run. */
+ return (1);
+}
+
+/*
+ * Switch to the indicated lwp.
+ */
+void
+cpu_switchto(struct lwp *old, struct lwp *new)
+{
+
+ /*
+ * We enter here with interrupts blocked and sched_lock held.
+ */
+
+#if 0
+ printf("cpu_switchto: %p -> %p", old, new);
+#endif
+ want_resched = 0;
+#ifdef LOCKDEBUG
+ sched_unlock_idle();
+#endif
+ /* p->p_cpu initialized in fork1() for single-processor */
+ new->l_stat = LSONPROC;
+ curlwp = new;
+ curpcb = &curlwp->l_addr->u_pcb;
+ pmap_deactivate(old);
+ pmap_activate(new);
+ cpu_loswitch(&old->l_addr->u_pcb.pcb_sf, new->l_addr->u_pcb.pcb_sf);
/* We only get back here after the other process has run. */
}
diff -r 86132e30ab17 -r 93a3e9f46fb0 sys/arch/acorn26/acorn26/copyinout.S
--- a/sys/arch/acorn26/acorn26/copyinout.S Fri Jan 17 21:52:10 2003 +0000
+++ b/sys/arch/acorn26/acorn26/copyinout.S Fri Jan 17 21:55:23 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: copyinout.S,v 1.4 2002/08/11 23:17:24 bjh21 Exp $ */
+/* $NetBSD: copyinout.S,v 1.5 2003/01/17 21:55:23 thorpej Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
@@ -32,7 +32,7 @@
#include <machine/asm.h>
-RCSID("$NetBSD: copyinout.S,v 1.4 2002/08/11 23:17:24 bjh21 Exp $")
+RCSID("$NetBSD: copyinout.S,v 1.5 2003/01/17 21:55:23 thorpej Exp $")
#include <sys/errno.h>
#include "assym.h"
@@ -41,9 +41,9 @@
ENTRY(fubyte)
mov ip, lr /* data-abort safety */
adr r1, Lfusufault
- ldr r2, Lcurproc
+ ldr r2, Lcurlwp
ldr r2, [r2]
- ldr r2, [r2, #P_ADDR]
+ ldr r2, [r2, #L_ADDR]
str r1, [r2, #(U_PCB + PCB_ONFAULT)]
/* XXX Warning: Rn and Rd must be different in LDRT */
ldrbt r0, [r0]
@@ -59,9 +59,9 @@
ENTRY(fuword)
mov ip, lr
adr r1, Lfusufault
- ldr r2, Lcurproc
+ ldr r2, Lcurlwp
ldr r2, [r2]
- ldr r2, [r2, #P_ADDR]
+ ldr r2, [r2, #L_ADDR]
str r1, [r2, #(U_PCB + PCB_ONFAULT)]
/* XXX Warning: Rn and Rd must be different in LDRT */
ldrt r0, [r0]
@@ -77,9 +77,9 @@
ENTRY(subyte)
mov ip, lr
adr r3, Lfusufault
- ldr r2, Lcurproc
+ ldr r2, Lcurlwp
ldr r2, [r2]
- ldr r2, [r2, #P_ADDR]
+ ldr r2, [r2, #L_ADDR]
str r3, [r2, #(U_PCB + PCB_ONFAULT)]
strbt r1, [r0]
mov r0, #0
@@ -94,9 +94,9 @@
ENTRY(suword)
mov ip, lr
adr r3, Lfusufault
- ldr r2, Lcurproc
+ ldr r2, Lcurlwp
ldr r2, [r2]
- ldr r2, [r2, #P_ADDR]
+ ldr r2, [r2, #L_ADDR]
str r3, [r2, #(U_PCB + PCB_ONFAULT)]
strt r1, [r0]
mov r0, #0
@@ -117,5 +117,5 @@
mov pc, ip
#endif
-Lcurproc:
- .word _C_LABEL(curproc)
+Lcurlwp:
+ .word _C_LABEL(curlwp)
diff -r 86132e30ab17 -r 93a3e9f46fb0 sys/arch/acorn26/acorn26/cpu.c
--- a/sys/arch/acorn26/acorn26/cpu.c Fri Jan 17 21:52:10 2003 +0000
+++ b/sys/arch/acorn26/acorn26/cpu.c Fri Jan 17 21:55:23 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.8 2002/10/02 03:25:46 thorpej Exp $ */
+/* $NetBSD: cpu.c,v 1.9 2003/01/17 21:55:24 thorpej Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -32,7 +32,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.8 2002/10/02 03:25:46 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2003/01/17 21:55:24 thorpej Exp $");
#include <sys/device.h>
#include <sys/proc.h>
@@ -197,7 +197,7 @@
static int
swp_handler(u_int addr, u_int insn, struct trapframe *tf, int fault_code)
{
- struct proc *p;
+ struct proc *p = curlwp->l_proc;
int rd, rm, rn, byte;
register_t temp;
caddr_t uaddr;
@@ -215,9 +215,9 @@
uaddr = (caddr_t)getreg(rn);
/* We want the page wired so we won't sleep */
/* XXX only wire one byte due to weirdness with unaligned words */
- err = uvm_vslock(curproc, uaddr, 1, VM_PROT_READ | VM_PROT_WRITE);
+ err = uvm_vslock(p, uaddr, 1, VM_PROT_READ | VM_PROT_WRITE);
if (err != 0) {
- trapsignal(p, SIGSEGV, (u_int)uaddr);
+ trapsignal(curlwp, SIGSEGV, (u_int)uaddr);
return 0;
}
/* I believe the uvm_vslock() guarantees the fetch/store won't fail. */
@@ -234,7 +234,7 @@
suword(uaddr, getreg(rm));
getreg(rd) = temp;
}
- uvm_vsunlock(curproc, uaddr, 1);
+ uvm_vsunlock(p, uaddr, 1);
return 0;
}
#endif
diff -r 86132e30ab17 -r 93a3e9f46fb0 sys/arch/acorn26/acorn26/except.c
--- a/sys/arch/acorn26/acorn26/except.c Fri Jan 17 21:52:10 2003 +0000
+++ b/sys/arch/acorn26/acorn26/except.c Fri Jan 17 21:55:23 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.3 2002/04/12 18:50:30 thorpej Exp $ */
+/* $NetBSD: except.c,v 1.4 2003/01/17 21:55:24 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 Ben Harris
* All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.3 2002/04/12 18:50:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.4 2003/01/17 21:55:24 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_ktrace.h"
@@ -63,7 +63,7 @@
#endif
void syscall(struct trapframe *);
-static void do_fault(struct trapframe *, struct proc *, struct vm_map *,
+static void do_fault(struct trapframe *, struct lwp *, struct vm_map *,
vaddr_t, vm_prot_t);
static void data_abort_fixup(struct trapframe *);
static vaddr_t data_abort_address(struct trapframe *, vsize_t *);
@@ -97,6 +97,7 @@
{
vaddr_t pc;
struct proc *p;
+ struct lwp *l;
/* Enable interrupts if they were enabled before the trap. */
if ((tf->tf_r15 & R15_IRQ_DISABLE) == 0)
@@ -110,12 +111,13 @@
*/
uvmexp.traps++;
- p = curproc;
- if (p == NULL)
- p = &proc0;
+ l = curlwp;
+ if (l == NULL)
+ l = &lwp0;
+ p = l->l_proc;
if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR)
- p->p_addr->u_pcb.pcb_tf = tf;
+ l->l_addr->u_pcb.pcb_tf = tf;
if ((tf->tf_r15 & R15_MODE) != R15_MODE_USR) {
#ifdef DEBUG
@@ -128,9 +130,9 @@
/* User-mode prefetch abort */
pc = tf->tf_r15 & R15_PC;
- do_fault(tf, p, &p->p_vmspace->vm_map, pc, VM_PROT_EXECUTE);
Home |
Main Index |
Thread Index |
Old Index