Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch PCB convergence, part the first:



details:   https://anonhg.NetBSD.org/src/rev/6c9ccdc00802
branches:  trunk
changeset: 504383:6c9ccdc00802
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Wed Feb 28 18:15:42 2001 +0000

description:
PCB convergence, part the first:
Move the pointer to the current user trapframe from struct mdproc to struct
pcb (as on arm26).  Only tested by compiling kernels on arm32 and
hpcarm (dnard seems to be incomplete anyway).  Someone should try running one.

diffstat:

 sys/arch/arm/arm/process_machdep.c       |   8 ++------
 sys/arch/arm/arm/sig_machdep.c           |   8 ++------
 sys/arch/arm/include/arm32/pcb.h         |   5 ++++-
 sys/arch/arm/include/cpu.h               |   6 ++++--
 sys/arch/arm/include/proc.h              |   6 +++---
 sys/arch/arm32/arm32/compat_13_machdep.c |   4 ++--
 sys/arch/arm32/arm32/fault.c             |   6 +++---
 sys/arch/arm32/arm32/genassym.cf         |   3 +--
 sys/arch/arm32/arm32/machdep.c           |   6 +++---
 sys/arch/arm32/arm32/syscall.c           |   8 +++++---
 sys/arch/arm32/arm32/undefined.c         |   4 ++--
 sys/arch/arm32/arm32/vm_machdep.c        |   6 +++---
 sys/arch/arm32/fpe-arm/armfpe_init.c     |   4 ++--
 sys/arch/hpcarm/hpcarm/fault.c           |   6 +++---
 sys/arch/hpcarm/hpcarm/genassym.cf       |   3 +--
 sys/arch/hpcarm/hpcarm/machdep.c         |  10 +++++-----
 sys/arch/hpcarm/hpcarm/process_machdep.c |   4 ++--
 sys/arch/hpcarm/hpcarm/syscall.c         |   6 +++---
 sys/arch/hpcarm/hpcarm/undefined.c       |   4 ++--
 sys/arch/hpcarm/hpcarm/vm_machdep.c      |   6 +++---
 20 files changed, 55 insertions(+), 58 deletions(-)

diffs (truncated from 493 to 300 lines):

diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm/arm/process_machdep.c
--- a/sys/arch/arm/arm/process_machdep.c        Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm/arm/process_machdep.c        Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.5 2001/02/27 17:57:55 bjh21 Exp $        */
+/*     $NetBSD: process_machdep.c,v 1.6 2001/02/28 18:15:42 bjh21 Exp $        */
 
 /*
  * Copyright (c) 1995 Frank Lancaster.  All rights reserved.
@@ -71,7 +71,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.5 2001/02/27 17:57:55 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.6 2001/02/28 18:15:42 bjh21 Exp $");
 
 #include <sys/proc.h>
 #include <sys/ptrace.h>
@@ -92,11 +92,7 @@
 process_frame(struct proc *p)
 {
 
-#ifdef arm26
        return p->p_addr->u_pcb.pcb_tf;
-#else /* arm32 */
-       return (p->p_md.md_regs);
-#endif
 }
 
 int
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm/arm/sig_machdep.c
--- a/sys/arch/arm/arm/sig_machdep.c    Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm/arm/sig_machdep.c    Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.3 2001/02/27 17:42:16 bjh21 Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.4 2001/02/28 18:15:43 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -45,7 +45,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.3 2001/02/27 17:42:16 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.4 2001/02/28 18:15:43 bjh21 Exp $");
 
 #include <sys/mount.h>         /* XXX only needed by syscallargs.h */
 #include <sys/proc.h>
@@ -67,11 +67,7 @@
 process_frame(struct proc *p)
 {
 
-#ifdef arm26
        return p->p_addr->u_pcb.pcb_tf;
-#else /* arm32 */
-       return (p->p_md.md_regs);
-#endif
 }
 
 /*
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm/include/arm32/pcb.h
--- a/sys/arch/arm/include/arm32/pcb.h  Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm/include/arm32/pcb.h  Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcb.h,v 1.1 2001/02/23 21:23:49 reinoud Exp $  */
+/*     $NetBSD: pcb.h,v 1.2 2001/02/28 18:15:43 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1994 Mark Brinicombe.
@@ -38,6 +38,8 @@
 #include <machine/pte.h>
 #include <machine/fp.h>
 
+struct trapframe;
+
 struct pcb {
        pd_entry_t      *pcb_pagedir;           /* PT hooks */
        u_int   pcb_flags;                      /* Flags */
@@ -61,6 +63,7 @@
        u_int   pcb_und_sp;
        caddr_t pcb_onfault;                    /* On fault handler */
        struct  fpe_sp_state pcb_fpstate;       /* Floating Point state */
+       struct  trapframe *pcb_tf;
 };
 
 /*
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm/include/cpu.h        Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.8 2001/02/28 00:17:18 bjh21 Exp $    */
+/*     $NetBSD: cpu.h,v 1.9 2001/02/28 18:15:43 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -104,7 +104,9 @@
 
 
 #ifndef _LOCORE
+#include <sys/user.h>
 #include <machine/frame.h>
+#include <machine/pcb.h>
 #endif /* !_LOCORE */
 
 #ifdef arm26
@@ -162,7 +164,7 @@
 /* Hack to treat FPE time as interrupt time so we can measure it */
 #define CLKF_INTR(frame) ((current_intr_depth > 1) || (frame->if_spsr & PSR_MODE) == PSR_UND32_MODE)
 
-#define        PROC_PC(p)      ((p)->p_md.md_regs->tf_pc)
+#define        PROC_PC(p)      ((p)->p_addr->u_pcb.pcb_tf->tf_pc)
 
 #elif defined(PROG26)
 
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm/include/proc.h
--- a/sys/arch/arm/include/proc.h       Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm/include/proc.h       Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.1 2001/02/23 21:23:48 reinoud Exp $ */
+/*     $NetBSD: proc.h,v 1.2 2001/02/28 18:15:43 bjh21 Exp $   */
 
 /*
  * Copyright (c) 1994 Mark Brinicombe.
@@ -39,7 +39,7 @@
  * Machine-dependent part of the proc structure for arm.
  */
 struct mdproc {
-       struct trapframe *md_regs;      /* registers on current frame */
-       int     __spare;
+       struct trapframe *__spare0;
+       int     __spare1;
 };
 #endif
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/compat_13_machdep.c
--- a/sys/arch/arm32/arm32/compat_13_machdep.c  Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/compat_13_machdep.c  Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_13_machdep.c,v 1.2 2000/12/22 22:58:53 jdolecek Exp $   */
+/*     $NetBSD: compat_13_machdep.c,v 1.3 2001/02/28 18:15:43 bjh21 Exp $      */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -73,7 +73,7 @@
                return (EINVAL);
 
        /* Restore register context. */
-       tf = p->p_md.md_regs;
+       tf = p->p_addr->u_pcb.pcb_tf;
        tf->tf_r0    = context.sc_r0;
        tf->tf_r1    = context.sc_r1;
        tf->tf_r2    = context.sc_r2;
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/fault.c
--- a/sys/arch/arm32/arm32/fault.c      Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/fault.c      Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fault.c,v 1.49 2001/01/12 13:43:13 bjh21 Exp $ */
+/*     $NetBSD: fault.c,v 1.50 2001/02/28 18:15:43 bjh21 Exp $ */
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -241,7 +241,7 @@
                 * Note that the fault was from USR mode.
                 */
                user = 1;
-               p->p_md.md_regs = frame;
+               p->p_addr->u_pcb.pcb_tf = frame;
        } else
                user = 0;
 
@@ -538,7 +538,7 @@
        /* Was the prefectch abort from USR32 mode ? */
 
        if ((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE) {
-               p->p_md.md_regs = frame;
+               p->p_addr->u_pcb.pcb_tf = frame;
        } else {
                /*
                 * All the kernel code pages are loaded at boot time
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/genassym.cf
--- a/sys/arch/arm32/arm32/genassym.cf  Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/genassym.cf  Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.6 2001/01/18 10:18:24 jdolecek Exp $
+#      $NetBSD: genassym.cf,v 1.7 2001/02/28 18:15:43 bjh21 Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -71,7 +71,6 @@
 define P_SIGLIST               offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_siglist)
 define P_SIGMASK               offsetof(struct proc, p_sigctx) + offsetof(struct sigctx, ps_sigmask)
 define P_USRPRI                offsetof(struct proc, p_usrpri)
-define P_SPARE                 offsetof(struct proc, p_md.__spare)
 
 define SONPROC                 SONPROC
 
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/machdep.c
--- a/sys/arch/arm32/arm32/machdep.c    Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/machdep.c    Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.85 2001/02/13 13:19:53 bjh21 Exp $       */
+/*     $NetBSD: machdep.c,v 1.86 2001/02/28 18:15:43 bjh21 Exp $       */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -475,7 +475,7 @@
        (void) pmap_extract(kernel_pmap, (vaddr_t)(kernel_pmap)->pm_pdir,
            (paddr_t *)&curpcb->pcb_pagedir);
 
-       proc0.p_md.md_regs = (struct trapframe *)curpcb->pcb_sp - 1;
+        curpcb->pcb_tf = (struct trapframe *)curpcb->pcb_sp - 1;
 }
 
 #ifndef FOOTBRIDGE
@@ -514,7 +514,7 @@
                    pack->ep_entry, stack, p);
 #endif
 
-       tf = p->p_md.md_regs;
+       tf = p->p_addr->u_pcb.pcb_tf;
 
 #ifdef PMAP_DEBUG
        if (pmap_debug_level >= -1)
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/syscall.c
--- a/sys/arch/arm32/arm32/syscall.c    Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/syscall.c    Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syscall.c,v 1.38 2000/12/12 20:49:16 mycroft Exp $     */
+/*     $NetBSD: syscall.c,v 1.39 2001/02/28 18:15:44 bjh21 Exp $       */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -85,6 +85,7 @@
 #include <sys/systm.h>
 #include <sys/reboot.h>
 #include <sys/syscall.h>
+#include <sys/user.h>
 #ifdef KTRACE
 #include <sys/ktrace.h>
 #endif
@@ -94,6 +95,7 @@
 #include <machine/cpu.h>
 #include <machine/frame.h>
 #include <machine/katelib.h>
+#include <machine/pcb.h>
 
 u_int arm700bugcount = 0;
 
@@ -130,7 +132,7 @@
 
        uvmexp.syscalls++;
        p = curproc;
-       p->p_md.md_regs = frame;
+       p->p_addr->u_pcb.pcb_tf = frame;
 
 #ifdef CPU_ARM7
        /*
@@ -278,7 +280,7 @@
        void *arg;
 {
        struct proc *p = arg;
-       struct trapframe *frame = p->p_md.md_regs;
+       struct trapframe *frame = p->p_addr->u_pcb.pcb_tf;
 
        frame->tf_r0 = 0;
        frame->tf_spsr &= ~PSR_C_bit;   /* carry bit */ 
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/undefined.c
--- a/sys/arch/arm32/arm32/undefined.c  Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/undefined.c  Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: undefined.c,v 1.22 2001/01/12 13:43:13 bjh21 Exp $     */
+/*     $NetBSD: undefined.c,v 1.23 2001/02/28 18:15:44 bjh21 Exp $     */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -170,7 +170,7 @@
                /* Modify the fault_code to reflect the USR/SVC state at time of fault */
 
                fault_code = FAULT_USER;
-               p->p_md.md_regs = frame;
+               p->p_addr->u_pcb.pcb_tf = frame;
        } else
                fault_code = 0;
 
diff -r c754ce12c106 -r 6c9ccdc00802 sys/arch/arm32/arm32/vm_machdep.c
--- a/sys/arch/arm32/arm32/vm_machdep.c Wed Feb 28 18:14:50 2001 +0000
+++ b/sys/arch/arm32/arm32/vm_machdep.c Wed Feb 28 18:15:42 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.54 2001/02/26 15:59:54 bjh21 Exp $    */
+/*     $NetBSD: vm_machdep.c,v 1.55 2001/02/28 18:15:44 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -170,8 +170,8 @@
        arm_fpe_copycontext(FP_CONTEXT(p1), FP_CONTEXT(p2));
 #endif /* ARMFPE */
 
-       p2->p_md.md_regs = tf = (struct trapframe *)pcb->pcb_sp - 1;
-       *tf = *p1->p_md.md_regs;
+       p2->p_addr->u_pcb.pcb_tf = tf = (struct trapframe *)pcb->pcb_sp - 1;
+       *tf = *p1->p_addr->u_pcb.pcb_tf;



Home | Main Index | Thread Index | Old Index