Nuke ci_curpm and curpm. Nuke pcb_pmreal. Those were use for spill stacks

and those no longer exist.  for few uses that need CURPM, use CURPCB/PCB_PM
This commit is contained in:
matt 2003-08-12 05:06:53 +00:00
parent a66b0c9e9a
commit c0d6cb285d
13 changed files with 38 additions and 71 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.3 2003/07/15 01:37:36 lukem Exp $ */
/* $NetBSD: machdep.c,v 1.4 2003/08/12 05:06:55 matt Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.3 2003/07/15 01:37:36 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.4 2003/08/12 05:06:55 matt Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -222,7 +222,7 @@ bootstrap(u_int startkernel, u_int endkernel)
memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr);
curpcb = &proc0paddr->u_pcb;
curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();
curpcb->pcb_pm = pmap_kernel();
/*
* Install trap vectors.

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.16 2003/07/25 11:44:21 scw Exp $ */
/* $NetBSD: machdep.c,v 1.17 2003/08/12 05:06:55 matt Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2003/07/25 11:44:21 scw Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2003/08/12 05:06:55 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -202,7 +202,7 @@ initppc(u_int startkernel, u_int endkernel, char *args, void *info_block)
memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr);
curpcb = &proc0paddr->u_pcb;
curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();
curpcb->pcb_pm = pmap_kernel();
/*
* Set up trap vectors

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.5 2003/08/11 05:13:22 chs Exp $
# $NetBSD: genassym.cf,v 1.6 2003/08/12 05:06:58 matt Exp $
#
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -138,7 +138,7 @@ define SFRAME_R29 offsetof(struct switchframe, fixreg[16])
define SFRAME_R30 offsetof(struct switchframe, fixreg[17])
define SFRAME_R31 offsetof(struct switchframe, fixreg[18])
define PCB_PMR offsetof(struct pcb, pcb_pmreal)
define PCB_PM offsetof(struct pcb, pcb_pm)
define PCB_SP offsetof(struct pcb, pcb_sp)
define PCB_SPL offsetof(struct pcb, pcb_spl)
define PCB_FAULT offsetof(struct pcb, pcb_onfault)
@ -160,7 +160,6 @@ define LSONPROC LSONPROC
define CI_SIZE sizeof(struct cpu_info)
define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
define CI_CURPM offsetof(struct cpu_info, ci_curpm)
define CI_IDLE_PCB offsetof(struct cpu_info, ci_idle_pcb)
define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.24 2003/07/19 08:20:22 simonb Exp $ */
/* $NetBSD: pmap.c,v 1.25 2003/08/12 05:06:58 matt Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.24 2003/07/19 08:20:22 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.25 2003/08/12 05:06:58 matt Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -1144,16 +1144,7 @@ pmap_activate(struct lwp *l)
* XXX Normally performed in cpu_fork().
*/
printf("pmap_activate(%p), pmap=%p\n",l,pmap);
if (pcb->pcb_pm != pmap) {
pcb->pcb_pm = pmap;
(void) pmap_extract(pmap_kernel(), (vaddr_t)pcb->pcb_pm,
(paddr_t *)&pcb->pcb_pmreal);
}
if (l == curlwp) {
/* Store pointer to new current pmap. */
curpm = pcb->pcb_pmreal;
}
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.34 2003/08/08 07:14:26 matt Exp $ */
/* $NetBSD: cpu.h,v 1.35 2003/08/12 05:06:53 matt Exp $ */
/*
* Copyright (C) 1999 Wolfgang Solfrank.
@ -63,7 +63,6 @@ struct cpu_info {
struct lwp *ci_curlwp; /* current owner of the processor */
struct pcb *ci_curpcb;
struct pmap *ci_curpm;
struct lwp *ci_fpulwp;
struct lwp *ci_veclwp;
struct pcb *ci_idle_pcb; /* PA of our idle pcb */
@ -162,7 +161,6 @@ curcpu(void)
#define curlwp (curcpu()->ci_curlwp)
#define curpcb (curcpu()->ci_curpcb)
#define curpm (curcpu()->ci_curpm)
static __inline register_t
mfmsr(void)

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcb.h,v 1.14 2003/03/05 05:27:25 matt Exp $ */
/* $NetBSD: pcb.h,v 1.15 2003/08/12 05:06:54 matt Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -50,7 +50,6 @@ struct fpu {
struct pcb {
struct pmap *pcb_pm; /* pmap of our vmspace */
struct pmap *pcb_pmreal; /* real address of above */
register_t pcb_sp; /* saved SP */
int pcb_spl; /* saved SPL */
int pcb_flags;

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.3 2003/08/08 07:14:27 matt Exp $
# $NetBSD: genassym.cf,v 1.4 2003/08/12 05:06:57 matt Exp $
#
# Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -151,7 +151,7 @@ define SFRAME_R29 offsetof(struct switchframe, fixreg[16])
define SFRAME_R30 offsetof(struct switchframe, fixreg[17])
define SFRAME_R31 offsetof(struct switchframe, fixreg[18])
define PCB_PMR offsetof(struct pcb, pcb_pmreal)
define PCB_PM offsetof(struct pcb, pcb_pm)
define PCB_SP offsetof(struct pcb, pcb_sp)
define PCB_SPL offsetof(struct pcb, pcb_spl)
define PCB_FAULT offsetof(struct pcb, pcb_onfault)
@ -170,7 +170,6 @@ define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
define CI_SIZE sizeof(struct cpu_info)
define CI_CURLWP offsetof(struct cpu_info, ci_curlwp)
define CI_CURPCB offsetof(struct cpu_info, ci_curpcb)
define CI_CURPM offsetof(struct cpu_info, ci_curpm)
define CI_IDLE_PCB offsetof(struct cpu_info, ci_idle_pcb)
define CI_ASTPENDING offsetof(struct cpu_info, ci_astpending)
define CI_WANT_RESCHED offsetof(struct cpu_info, ci_want_resched)

View File

@ -1,4 +1,4 @@
/* $NetBSD: oea_machdep.c,v 1.10 2003/08/08 07:14:27 matt Exp $ */
/* $NetBSD: oea_machdep.c,v 1.11 2003/08/12 05:06:57 matt Exp $ */
/*
* Copyright (C) 2002 Matt Thomas
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.10 2003/08/08 07:14:27 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.11 2003/08/12 05:06:57 matt Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -158,7 +158,7 @@ oea_init(void (*handler)(void))
curpcb->pcb_vr.vscr = 0;
curpcb->pcb_vr.vrsave = 0;
#endif
curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();
curpcb->pcb_pm = pmap_kernel();
/*
* Cause a PGM trap if we branch to 0.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.12 2003/08/08 06:06:48 matt Exp $ */
/* $NetBSD: pmap.c,v 1.13 2003/08/12 05:06:57 matt Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.12 2003/08/08 06:06:48 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.13 2003/08/12 05:06:57 matt Exp $");
#include "opt_altivec.h"
#include "opt_pmap.h"
@ -2106,19 +2106,7 @@ pmap_activate(struct lwp *l)
/*
* XXX Normally performed in cpu_fork().
*/
if (pcb->pcb_pm != pmap) {
pcb->pcb_pm = pmap;
pcb->pcb_pmreal = pmap;
}
/*
* In theory, the SR registers need only be valid on return
* to user space wait to do them there.
*/
if (l == curlwp) {
/* Store pointer to new current pmap. */
curpm = pmap;
}
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_subr.S,v 1.16 2003/08/11 15:39:24 matt Exp $ */
/* $NetBSD: locore_subr.S,v 1.17 2003/08/12 05:06:55 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -326,6 +326,10 @@ ENTRY_NOPROFILE(cpu_switch)
stint %r9,_C_LABEL(sched_whichqs)@l(%r8) /* mark it empty */
switch_common:
/*
* r31 = lwp now running on this cpu
* r30 = previous lwp (maybe be NULL)
*/
1:
/* just did this resched thing */
li %r3,0
@ -343,7 +347,7 @@ switch_common:
/* record new lwp */
stptr %r31,CI_CURLWP(%r4)
ldptr %r4,L_ADDR(%r31)
ldptr %r4,L_ADDR(%r31) /* put PCB addr in r4 */
#if !defined(MULTIPROCESSOR) /* XXX */
li %r3,0 /* if it is the same lwp, return 0 */
@ -371,10 +375,6 @@ switch_exited:
/* indicate new pcb */
GET_CPUINFO(%r6)
stptr %r4,CI_CURPCB(%r6)
/* save real pmap pointer for spill fill */
ldptr %r5,PCB_PMR(%r4)
stptru %r5,CI_CURPM(%r6)
#ifdef PPC_OEA64
stdcx. %r5,%r0,%r6 /* clear possible reservation */
#else
@ -416,7 +416,8 @@ switch_return:
#if defined(PPC_IBM4XX)
0:
GET_CPUINFO(%r3)
ldreg %r3,CI_CURPM(%r3) /* Do we need a context? */
ldreg %r3,CI_CURPCB(%r3) /* Do we need a context? */
ldreg %r3,PCB_PM(%r3)
ldreg %r4,PM_CTX(%r3)
cmpwi %r4,0
# mtspr SPR_SPR0,4 /* Always keep the current ctx here */

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.83 2003/08/08 06:10:43 matt Exp $ */
/* $NetBSD: trap.c,v 1.84 2003/08/12 05:06:56 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.83 2003/08/08 06:10:43 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2003/08/12 05:06:56 matt Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@ -89,12 +89,6 @@ trap(struct trapframe *frame)
if (frame->srr1 & PSL_PR)
type |= EXC_USER;
#ifdef DIAGNOSTIC
if (!doing_shutdown && pcb->pcb_pmreal != curpm)
panic("trap: curpm (%p) != pcb->pcb_pmreal (%p)",
curpm, pcb->pcb_pmreal);
#endif
uvmexp.traps++;
switch (type) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap_subr.S,v 1.47 2003/08/08 07:14:28 matt Exp $ */
/* $NetBSD: trap_subr.S,v 1.48 2003/08/12 05:06:56 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -61,7 +61,8 @@
*/
#define RESTORE_USER_SRS(t0,t1) \
GET_CPUINFO(t0); \
ldptr t0,CI_CURPM(t0); \
ldptr t0,CI_CURPCB(t0); \
ldptr t0,PCB_PM(t0); \
ldreg t0,PM_STEG(t0); \
mtasr t0
@ -101,7 +102,8 @@
*/
#define RESTORE_USER_SRS(pmap,sr) \
GET_CPUINFO(pmap); \
ldptr pmap,CI_CURPM(pmap); \
ldptr pmap,CI_CURPCB(pmap); \
ldptr pmap,PCB_PM(pmap); \
ldregu sr,PM_SR(pmap); \
RESTORE_SRS(pmap,sr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.53 2003/07/15 02:54:49 lukem Exp $ */
/* $NetBSD: vm_machdep.c,v 1.54 2003/08/12 05:06:56 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.53 2003/07/15 02:54:49 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.54 2003/08/12 05:06:56 matt Exp $");
#include "opt_altivec.h"
#include "opt_multiprocessor.h"
@ -111,7 +111,6 @@ cpu_lwp_fork(l1, l2, stack, stacksize, func, arg)
*pcb = l1->l_addr->u_pcb;
pcb->pcb_pm = l2->l_proc->p_vmspace->vm_map.pmap;
pcb->pcb_pmreal = pcb->pcb_pm;
/*
* Setup the trap frame for the new process
@ -204,9 +203,6 @@ void
cpu_swapin(l)
struct lwp *l;
{
struct pcb *pcb = &l->l_addr->u_pcb;
pcb->pcb_pmreal = pcb->pcb_pm; /* XXX */
}
/*