diff --git a/sys/arch/arm/arm/process_machdep.c b/sys/arch/arm/arm/process_machdep.c index 9144131d57b7..bd2a311d81cb 100644 --- a/sys/arch/arm/arm/process_machdep.c +++ b/sys/arch/arm/arm/process_machdep.c @@ -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 -__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 #include @@ -92,11 +92,7 @@ static __inline struct trapframe * 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 --git a/sys/arch/arm/arm/sig_machdep.c b/sys/arch/arm/arm/sig_machdep.c index a95f41ef4c87..3e6b36b19d9f 100644 --- a/sys/arch/arm/arm/sig_machdep.c +++ b/sys/arch/arm/arm/sig_machdep.c @@ -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 -__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 /* XXX only needed by syscallargs.h */ #include @@ -67,11 +67,7 @@ static __inline struct trapframe * 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 --git a/sys/arch/arm/include/arm32/pcb.h b/sys/arch/arm/include/arm32/pcb.h index 005984ef7eae..ddcd2f3bdd1f 100644 --- a/sys/arch/arm/include/arm32/pcb.h +++ b/sys/arch/arm/include/arm32/pcb.h @@ -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 #include +struct trapframe; + struct pcb { pd_entry_t *pcb_pagedir; /* PT hooks */ u_int pcb_flags; /* Flags */ @@ -61,6 +63,7 @@ struct pcb { 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 --git a/sys/arch/arm/include/cpu.h b/sys/arch/arm/include/cpu.h index e4ce54833c69..ba4eabdf1cf7 100644 --- a/sys/arch/arm/include/cpu.h +++ b/sys/arch/arm/include/cpu.h @@ -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 #include +#include #endif /* !_LOCORE */ #ifdef arm26 @@ -162,7 +164,7 @@ extern int astpending; /* 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 --git a/sys/arch/arm/include/proc.h b/sys/arch/arm/include/proc.h index 4fcc198a1258..ebb547277c89 100644 --- a/sys/arch/arm/include/proc.h +++ b/sys/arch/arm/include/proc.h @@ -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 --git a/sys/arch/arm32/arm32/compat_13_machdep.c b/sys/arch/arm32/arm32/compat_13_machdep.c index 6e3aa01ad23d..8e079f18da2c 100644 --- a/sys/arch/arm32/arm32/compat_13_machdep.c +++ b/sys/arch/arm32/arm32/compat_13_machdep.c @@ -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 @@ compat_13_sys_sigreturn(p, v, retval) 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 --git a/sys/arch/arm32/arm32/fault.c b/sys/arch/arm32/arm32/fault.c index b388a9aa2f21..dc2d8b82e349 100644 --- a/sys/arch/arm32/arm32/fault.c +++ b/sys/arch/arm32/arm32/fault.c @@ -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 @@ copyfault: * 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 @@ prefetch_abort_handler(frame) /* 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 --git a/sys/arch/arm32/arm32/genassym.cf b/sys/arch/arm32/arm32/genassym.cf index 705d4bba9c75..7d4225983e30 100644 --- a/sys/arch/arm32/arm32/genassym.cf +++ b/sys/arch/arm32/arm32/genassym.cf @@ -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_FLAG offsetof(struct proc, p_flag) 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 --git a/sys/arch/arm32/arm32/machdep.c b/sys/arch/arm32/arm32/machdep.c index 60c0a92ea000..69da373d1411 100644 --- a/sys/arch/arm32/arm32/machdep.c +++ b/sys/arch/arm32/arm32/machdep.c @@ -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 @@ cpu_startup() (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 @@ setregs(p, pack, stack) 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 --git a/sys/arch/arm32/arm32/syscall.c b/sys/arch/arm32/arm32/syscall.c index fea544a9be2c..730f9b9d58a8 100644 --- a/sys/arch/arm32/arm32/syscall.c +++ b/sys/arch/arm32/arm32/syscall.c @@ -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 #include #include +#include #ifdef KTRACE #include #endif @@ -94,6 +95,7 @@ #include #include #include +#include u_int arm700bugcount = 0; @@ -130,7 +132,7 @@ syscall(frame, code) 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 @@ child_return(arg) 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 --git a/sys/arch/arm32/arm32/undefined.c b/sys/arch/arm32/arm32/undefined.c index 7ef93dc4baa2..dc0540b3ee65 100644 --- a/sys/arch/arm32/arm32/undefined.c +++ b/sys/arch/arm32/arm32/undefined.c @@ -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 @@ undefinedinstruction(frame) /* 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 --git a/sys/arch/arm32/arm32/vm_machdep.c b/sys/arch/arm32/arm32/vm_machdep.c index 6df86d894d7f..e13b6626584c 100644 --- a/sys/arch/arm32/arm32/vm_machdep.c +++ b/sys/arch/arm32/arm32/vm_machdep.c @@ -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 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) 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; /* * If specified, give the child a different stack. diff --git a/sys/arch/arm32/fpe-arm/armfpe_init.c b/sys/arch/arm32/fpe-arm/armfpe_init.c index d3dbae745b1f..1c9a662ed4b1 100644 --- a/sys/arch/arm32/fpe-arm/armfpe_init.c +++ b/sys/arch/arm32/fpe-arm/armfpe_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: armfpe_init.c,v 1.21 2000/12/12 19:45:47 mycroft Exp $ */ +/* $NetBSD: armfpe_init.c,v 1.22 2001/02/28 18:15:44 bjh21 Exp $ */ /* * Copyright (C) 1996 Mark Brinicombe @@ -181,7 +181,7 @@ arm_fpe_postproc(fpframe, frame) register struct proc *p; p = curproc; - p->p_md.md_regs = frame; + p->p_addr->u_pcb.pcb_tf = frame; /* take pending signals */ diff --git a/sys/arch/hpcarm/hpcarm/fault.c b/sys/arch/hpcarm/hpcarm/fault.c index d49baaf86c60..b7b61c2ca0d4 100644 --- a/sys/arch/hpcarm/hpcarm/fault.c +++ b/sys/arch/hpcarm/hpcarm/fault.c @@ -1,4 +1,4 @@ -/* $NetBSD: fault.c,v 1.1 2001/02/23 03:48:10 ichiro Exp $ */ +/* $NetBSD: fault.c,v 1.2 2001/02/28 18:15:44 bjh21 Exp $ */ /* * Copyright (c) 1994-1997 Mark Brinicombe. @@ -241,7 +241,7 @@ copyfault: * 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 @@ prefetch_abort_handler(frame) /* 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 --git a/sys/arch/hpcarm/hpcarm/genassym.cf b/sys/arch/hpcarm/hpcarm/genassym.cf index 0feb8ec78d9a..1c1540428b8c 100644 --- a/sys/arch/hpcarm/hpcarm/genassym.cf +++ b/sys/arch/hpcarm/hpcarm/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.1 2001/02/23 03:48:10 ichiro Exp $ +# $NetBSD: genassym.cf,v 1.2 2001/02/28 18:15:44 bjh21 Exp $ # Copyright (c) 1982, 1990 The Regents of the University of California. # All rights reserved. @@ -71,7 +71,6 @@ define P_FLAG offsetof(struct proc, p_flag) 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 --git a/sys/arch/hpcarm/hpcarm/machdep.c b/sys/arch/hpcarm/hpcarm/machdep.c index 73f22d7e2400..950d72f1910a 100644 --- a/sys/arch/hpcarm/hpcarm/machdep.c +++ b/sys/arch/hpcarm/hpcarm/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.2 2001/02/25 15:45:23 toshii Exp $ */ +/* $NetBSD: machdep.c,v 1.3 2001/02/28 18:15:44 bjh21 Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -463,7 +463,7 @@ cpu_startup() (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; } /* @@ -500,7 +500,7 @@ setregs(p, pack, stack) 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) @@ -588,7 +588,7 @@ sendsig(catcher, sig, mask, code) struct sigframe *fp, frame; int onstack; - tf = p->p_md.md_regs; + tf = p->p_addr->u_pcb.pcb_tf; /* Do we need to jump onto the signal stack? */ onstack = @@ -707,7 +707,7 @@ sys___sigreturn14(p, v, retval) 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 --git a/sys/arch/hpcarm/hpcarm/process_machdep.c b/sys/arch/hpcarm/hpcarm/process_machdep.c index 53f811581809..4d6bd5edc2ed 100644 --- a/sys/arch/hpcarm/hpcarm/process_machdep.c +++ b/sys/arch/hpcarm/hpcarm/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.1 2001/02/23 03:48:12 ichiro Exp $ */ +/* $NetBSD: process_machdep.c,v 1.2 2001/02/28 18:15:44 bjh21 Exp $ */ /* * Copyright (c) 1995 Frank Lancaster. All rights reserved. @@ -85,7 +85,7 @@ process_frame(p) struct proc *p; { - return (p->p_md.md_regs); + return (p->p_addr->u_pcb.pcb_tf); } int diff --git a/sys/arch/hpcarm/hpcarm/syscall.c b/sys/arch/hpcarm/hpcarm/syscall.c index 9815d99a0b36..6e8f169fcac2 100644 --- a/sys/arch/hpcarm/hpcarm/syscall.c +++ b/sys/arch/hpcarm/hpcarm/syscall.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscall.c,v 1.1 2001/02/23 03:48:13 ichiro Exp $ */ +/* $NetBSD: syscall.c,v 1.2 2001/02/28 18:15:44 bjh21 Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ syscall(frame, code) uvmexp.syscalls++; p = curproc; - p->p_md.md_regs = frame; + p->p_addr->u_pcb.pcb_tf = frame; /* * Support for architecture dependant SWIs @@ -253,7 +253,7 @@ child_return(arg) 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 --git a/sys/arch/hpcarm/hpcarm/undefined.c b/sys/arch/hpcarm/hpcarm/undefined.c index 1f80482d196d..99fec00bc585 100644 --- a/sys/arch/hpcarm/hpcarm/undefined.c +++ b/sys/arch/hpcarm/hpcarm/undefined.c @@ -1,4 +1,4 @@ -/* $NetBSD: undefined.c,v 1.1 2001/02/23 03:48:13 ichiro Exp $ */ +/* $NetBSD: undefined.c,v 1.2 2001/02/28 18:15:45 bjh21 Exp $ */ /* * Copyright (c) 1995 Mark Brinicombe. @@ -170,7 +170,7 @@ undefinedinstruction(frame) /* 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 --git a/sys/arch/hpcarm/hpcarm/vm_machdep.c b/sys/arch/hpcarm/hpcarm/vm_machdep.c index 4afecf9cd464..765644837548 100644 --- a/sys/arch/hpcarm/hpcarm/vm_machdep.c +++ b/sys/arch/hpcarm/hpcarm/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.2 2001/02/26 16:33:10 bjh21 Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.3 2001/02/28 18:15:45 bjh21 Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -171,8 +171,8 @@ cpu_fork(p1, p2, stack, stacksize, func, arg) 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; /* * If specified, give the child a different stack.