Introduce a new & faster pmap for the MPC6xx (60x, 7xx, 7xxx) PPC CPUs.

Move MPC6xx dependent header files to powerpc/include/mpc6xx/
This commit is contained in:
matt 2001-06-06 17:36:01 +00:00
parent 073b3ed1ba
commit 938edd5b75
17 changed files with 2734 additions and 1541 deletions

View File

@ -1,8 +1,10 @@
# $NetBSD: files.powerpc,v 1.17 2001/02/24 04:30:42 matt Exp $
defopt altivec
defopt openpic
# $NetBSD: files.powerpc,v 1.18 2001/06/06 17:36:01 matt Exp $
defopt opt_altivec.h ALTIVEC K_ALTIVEC
defopt OPENPIC
defopt opt_ppcarch.h PPC_MPC6XX PPC_MPC8XX PPC_IBM4XX
file arch/powerpc/powerpc/Locore.c
file arch/powerpc/powerpc/bus_dma.c
file arch/powerpc/powerpc/copyinstr.c
file arch/powerpc/powerpc/copyoutstr.c
file arch/powerpc/powerpc/copystr.c
@ -15,7 +17,6 @@ file netinet/in4_cksum.c inet
file arch/powerpc/powerpc/ipkdb_glue.c ipkdb
file arch/powerpc/powerpc/mem.c
file arch/powerpc/powerpc/openpic.c openpic
file arch/powerpc/powerpc/pmap.c
file arch/powerpc/powerpc/powerpc_machdep.c
file arch/powerpc/powerpc/process_machdep.c
file arch/powerpc/powerpc/sig_machdep.c
@ -32,5 +33,9 @@ file arch/powerpc/powerpc/db_disasm.c ddb
file arch/powerpc/powerpc/db_interface.c ddb
file arch/powerpc/powerpc/db_trace.c ddb
# MPC (Motorola PowerPC) 6xx Family files (60x,74x,75x,74xx)
#
file arch/powerpc/mpc6xx/pmap.c ppc_mpc6xx
# Binary compatibility with previous NetBSD releases (COMPAT_XX)
file arch/powerpc/powerpc/compat_13_machdep.c compat_13

View File

@ -1,25 +1,25 @@
# $NetBSD: Makefile,v 1.19 2001/05/30 13:08:34 tsubai Exp $
# $NetBSD: Makefile,v 1.20 2001/06/06 17:36:01 matt Exp $
KDIR= /sys/arch/powerpc/include
INCSDIR= /usr/include/powerpc
INCS= ansi.h aout_machdep.h asm.h \
bat.h bswap.h byte_swap.h \
bswap.h byte_swap.h \
cdefs.h cpu.h \
db_machdep.h \
elf_machdep.h endian.h endian_machdep.h \
float.h fpu.h frame.h \
hid.h hid_601.h \
ieee.h ieeefp.h \
int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
ipkdb.h \
kcore.h \
limits.h lock.h \
math.h \
param.h pcb.h pio.h pmap.h proc.h profile.h psl.h pte.h ptrace.h \
param.h pcb.h pio.h proc.h profile.h psl.h ptrace.h \
reg.h reloc.h \
setjmp.h signal.h stdarg.h \
trap.h types.h \
varargs.h
SUBDIR= mpc6xx
.include <bsd.kinc.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.6 1999/05/05 11:20:54 tsubai Exp $ */
/* $NetBSD: cpu.h,v 1.7 2001/06/06 17:36:02 matt Exp $ */
/*
* Copyright (C) 1999 Wolfgang Solfrank.
@ -39,11 +39,15 @@ extern void __syncicache __P((void *, int));
* CTL_MACHDEP definitions.
*/
#define CPU_CACHELINE 1
#define CPU_MAXID 2
#define CPU_TIMEBASE 2
#define CPU_CPUTEMP 3
#define CPU_MAXID 4
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "cachelinesize", CTLTYPE_INT }, \
{ "timebase", CTLTYPE_INT }, \
{ "cputempature", CTLTYPE_INT }, \
}
#endif /* _POWERPC_CPU_H_ */

View File

@ -0,0 +1,11 @@
# $NetBSD: Makefile,v 1.1 2001/06/06 17:36:02 matt Exp $
KDIR= /sys/arch/powerpc/include/mpc6xx
INCSDIR= /usr/include/powerpc/mpc6xx
INCS= bat.h \
hid.h hid_601.h \
pmap.h pte.h \
vmparam.h
.include <bsd.kinc.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: bat.h,v 1.2 1999/12/18 01:36:06 thorpej Exp $ */
/* $NetBSD: bat.h,v 1.1 2001/06/06 17:36:02 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -67,8 +67,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MACHINE_BAT_H_
#define _MACHINE_BAT_H_
#ifndef _MPC6XX_BAT_H_
#define _MPC6XX_BAT_H_
struct bat {
u_int32_t batu;
@ -168,4 +168,4 @@ struct bat {
extern struct bat battable[16];
#endif
#endif /* _MACHINE_BAT_H_ */
#endif /* _MPC6XX_BAT_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hid.h,v 1.1 2000/11/09 11:49:13 tsubai Exp $ */
/* $NetBSD: hid.h,v 1.1 2001/06/06 17:36:02 matt Exp $ */
/*-
* Copyright (c) 2000 Tsubai Masanari. All rights reserved.
@ -26,6 +26,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MPC6XX_HID_H_
#define _MPC6XX_HID_H_
/* Hardware Implementation Dependent registers for the PowerPC */
#define HID0_EMCP 0x80000000 /* Enable MCP */
@ -104,3 +107,5 @@
* 604: ECP = Enable cache parity checking
* 604: SIE = Serial instruction execution disable
*/
#endif /* _MPC6XX_HID_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: hid_601.h,v 1.1 1999/12/18 01:33:45 thorpej Exp $ */
/* $NetBSD: hid_601.h,v 1.1 2001/06/06 17:36:03 matt Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -36,6 +36,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MPC6XX_HID_601_H_
#define _MPC6XX_HID_601_H_
/*
* Hardware Implementation Dependent registers for the PowerPC 601.
*/
@ -101,3 +103,5 @@
* HID15 (SPR 1023) -- Processor ID Register
*/
#define HID15_601_PID 0x0000000f /* processor ID mask */
#endif /* _MPC6XX_HID_601_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.21 2001/04/22 23:19:29 thorpej Exp $ */
/* $NetBSD: pmap.h,v 1.1 2001/06/06 17:36:03 matt Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -31,10 +31,10 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MACHINE_PMAP_H_
#define _MACHINE_PMAP_H_
#ifndef _MPC6XX_PMAP_H_
#define _MPC6XX_PMAP_H_
#include <machine/pte.h>
#include <powerpc/mpc6xx/pte.h>
/*
* Segment registers
@ -63,26 +63,29 @@ typedef struct pmap *pmap_t;
extern struct pmap kernel_pmap_;
#define pmap_kernel() (&kernel_pmap_)
#define pmap_clear_modify(pg) (ptemodify((pg), PTE_CHG, 0))
#define pmap_clear_reference(pg) (ptemodify((pg), PTE_REF, 0))
#define pmap_is_modified(pg) (ptebits((pg), PTE_CHG))
#define pmap_is_referenced(pg) (ptebits((pg), PTE_REF))
#define pmap_unwire(pm, va)
#define pmap_update() /* nothing (yet) */
#define pmap_clear_modify(pg) (pmap_clear_bit((pg), PTE_CHG))
#define pmap_clear_reference(pg) (pmap_clear_bit((pg), PTE_REF))
#define pmap_is_modified(pg) (pmap_query_bit((pg), PTE_CHG))
#define pmap_is_referenced(pg) (pmap_query_bit((pg), PTE_REF))
#define pmap_phys_address(x) (x)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
#define pmap_wired_count(pmap) ((pmap)->pm_stats.wired_count)
void pmap_bootstrap __P((u_int kernelstart, u_int kernelend));
boolean_t pmap_extract __P((struct pmap *, vaddr_t, paddr_t *));
boolean_t ptemodify __P((struct vm_page *, u_int, u_int));
int ptebits __P((struct vm_page *, int));
void pmap_real_memory __P((paddr_t *, psize_t *));
void pmap_bootstrap (vaddr_t kernelstart, vaddr_t kernelend);
boolean_t pmap_extract (struct pmap *, vaddr_t, paddr_t *);
boolean_t pmap_query_bit (struct vm_page *, int);
void pmap_clear_bit (struct vm_page *, int);
void pmap_real_memory (paddr_t *, psize_t *);
#define PMAP_NEED_PROCWR
void pmap_procwr __P((struct proc *, vaddr_t, size_t));
void pmap_procwr (struct proc *, vaddr_t, size_t);
#define PMAP_NC 0x1000
#define PMAP_STEAL_MEMORY
#if 0
/*
* Alternate mapping hooks for pool pages. Avoids thrashing the TLB.
*
@ -92,12 +95,12 @@ void pmap_procwr __P((struct proc *, vaddr_t, size_t));
*/
#define PMAP_MAP_POOLPAGE(pa) (pa)
#define PMAP_UNMAP_POOLPAGE(pa) (pa)
#endif
static __inline paddr_t vtophys __P((vaddr_t));
static __inline paddr_t vtophys (vaddr_t);
static __inline paddr_t
vtophys(va)
vaddr_t va;
vtophys(vaddr_t va)
{
paddr_t pa;
@ -111,4 +114,4 @@ vtophys(va)
#endif /* _KERNEL */
#endif /* _LOCORE */
#endif /* _MACHINE_PMAP_H_ */
#endif /* _MPC6XX_PMAP_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pte.h,v 1.2 1998/08/31 14:43:40 tsubai Exp $ */
/* $NetBSD: pte.h,v 1.1 2001/06/06 17:36:03 matt Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -31,8 +31,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MACHINE_PTE_H_
#define _MACHINE_PTE_H_
#ifndef _MPC6XX_PTE_H_
#define _MPC6XX_PTE_H_
#include <sys/queue.h>
@ -52,6 +52,7 @@ struct pte {
#define PTE_API 0x0000003f
/* Low word: */
#define PTE_RPGN 0xfffff000
#define PTE_RPGN_SHFT 12
#define PTE_REF 0x00000100
#define PTE_CHG 0x00000080
#define PTE_WIMG 0x00000078
@ -63,6 +64,11 @@ struct pte {
#define PTE_RO 0x00000003
#define PTE_RW 0x00000002
#define PTE_RSVD 0x00000e04
#define PTE_WIRED 0x00000004
#define PTE_GIDX_MASK 0x00000e00
#define PTE_GIDX_SHFT 9
#ifndef _LOCORE
typedef struct pte pte_t;
#endif /* _LOCORE */
@ -76,13 +82,6 @@ typedef struct pte pte_t;
#define ADDR_API_SHFT 22
#define ADDR_POFF 0x00000fff
#ifndef _LOCORE
#ifdef _KERNEL
extern pte_t *ptable;
extern int ptab_cnt;
#endif /* _KERNEL */
#endif /* _LOCORE */
/*
* Bits in DSISR:
*/
@ -108,4 +107,4 @@ extern int ptab_cnt;
extern u_int dsisr __P((void));
#endif /* _KERNEL */
#endif /* _LOCORE */
#endif /* _MACHINE_PTE_H_ */
#endif /* _MPC6XX_PTE_H_ */

View File

@ -0,0 +1,198 @@
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Matt Thomas <matt@3am-softwre.com> of Allegro Networks, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MPC6XX_VMPARAM_H_
#define _MPC6XX_VMPARAM_H_
#include <sys/queue.h>
/*
* Most of the definitions in this can be overriden by a machine-specific
* vmparam.h if required. Otherwise a port can just include this file
* get the right thing to happen.
*/
#ifndef USRTEXT
#define USRTEXT PAGE_SIZE
#endif
#ifndef USRSTACK
#define USRSTACK VM_MAXUSER_ADDRESS
#endif
#ifndef MAXTSIZ
#define MAXTSIZ (64*1024*1024) /* maximum text size */
#endif
#ifndef MAXDSIZ
#define MAXDSIZ (1024*1024*1024) /* maximum data size */
#endif
#ifndef MAXSSIZ
#define MAXSSIZ (32*1024*1024) /* maximum stack size */
#endif
#ifndef DFLDSIZ
#define DFLDSIZ (128*1024*1024) /* default data size */
#endif
#ifndef DFLSSIZ
#define DFLSSIZ (2*1024*1024) /* default stack size */
#endif
/*
* Default maximum amount of shared memory pages
*/
#ifndef SHMMAXPGS
#define SHMMAXPGS 1024
#endif
/*
* Default number of pages in the user raw I/O map.
*/
#ifndef USRIOSIZE
#define USRIOSIZE 1024
#endif
/*
* The number of seconds for a process to be blocked before being
* considered very swappable.
*/
#ifndef MAXSLP
#define MAXSLP 20
#endif
/*
* Segment handling stuff
*/
#define SEGMENT_LENGTH 0x10000000
#define SEGMENT_MASK 0xf0000000
/*
* Macros to manipulate VSIDs
*/
#if 0
/*
* Move the SR# to the top 4 bits to make the lower 19bits entirely random
* so to give better PTE distribution.
*/
#define VSID_MAKE(sr, hash) (((sr) << (ADDR_SR_SHFT-4))|((hash) & 0xfffff))
#define VSID_TO_SR(vsid) (((vsid) >> (ADDR_SR_SHFT-4)) & 0xF)
#define VSID_TO_HASH(vsid) ((vsid) & 0xfffff)
#else
#define VSID_MAKE(sr, hash) ((sr) | (((hash) & 0xfffff) << 4))
#define VSID_TO_SR(vsid) ((vsid) & 0xF)
#define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff)
#endif
/*
* Fixed segments
*/
#define USER_SR 13
#define KERNEL_SR 14
#define KERNEL_VSIDBITS 0xfffff
#define KERNEL_SEGMENT VSID_MAKE(KERNEL_SR, KERNEL_VSIDBITS)
#define EMPTY_SEGMENT VSID_MAKE(0, KERNEL_VSIDBITS)
#define USER_ADDR ((void *)(USER_SR << ADDR_SR_SHFT))
/*
* Some system constants
*/
#ifndef NPMAPS
#define NPMAPS 32768 /* Number of pmaps in system */
#endif
/*
* Eventually VM_MAXUSER_ADDRESS should be defined as
* (USER_SR << ADDR_SR_SHFT) - PAGE_SIZE
* Well, USER_SR should die too. Say 0xbffff000.
*/
#define VM_MIN_ADDRESS ((vaddr_t) 0)
#define VM_MAXUSER_ADDRESS ((vaddr_t) 0x7ffff000)
#define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t) (KERNEL_SR << ADDR_SR_SHFT))
#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + SEGMENT_LENGTH)
#ifndef VM_PHYSSEG_MAX
#define VM_PHYSSEG_MAX 16
#endif
#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST
#define VM_PHYSSEG_NOADD
#ifndef VM_PHYS_SIZE
#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE)
#endif
#ifndef VM_MAX_KERNEL_BUF
#define VM_MAX_KERNEL_BUF (SEGMENT_LENGTH / 2)
#endif
#define VM_NFREELIST 16 /* 16 distinct memory segments */
#define VM_FREELIST_DEFAULT 0
#define VM_FREELIST_FIRST256 1
#define VM_FREELIST_MAX 2
#ifndef _LOCORE
LIST_HEAD(pvo_head, pvo_entry);
#if __NetBSD_Version__ > 105180000
#define __HAVE_VM_PAGE_MD
struct vm_page_md {
struct pvo_head mdpg_pvoh;
unsigned int mdpg_attrs;
};
#define VM_MDPAGE_INIT(pg) do { \
LIST_INIT(&(pg)->mdpage.mdpg_pvoh); \
(pg)->mdpage.mdpg_attrs = 0; \
} while (/*CONSTCOND*/0)
#else
#define __HAVE_PMAP_PHYSSEG
struct pmap_physseg {
struct pvo_head *pvoh;
char *attrs;
};
#endif
#endif /* _LOCORE */
#endif /* _MPC6XX_VMPARAM_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: param.h,v 1.9 2001/05/30 12:28:49 mrg Exp $ */
/* $NetBSD: param.h,v 1.10 2001/06/06 17:36:02 matt Exp $ */
/*-
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -31,6 +31,9 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _POWERPC_PARAM_H
#define _POWERPC_PARAM_H
#ifdef _KERNEL
#ifndef _LOCORE
#include <machine/cpu.h>
@ -40,7 +43,9 @@
/*
* Machine dependent constants for PowerPC (32-bit only currently)
*/
#ifndef MACHINE
#define MACHINE "powerpc"
#endif
#define MACHINE_ARCH "powerpc"
#define MID_MACHINE MID_POWERPC
@ -64,7 +69,9 @@
#define MSGBUFSIZE NBPG /* default message buffer size */
#endif
#ifndef KERNBASE
#define KERNBASE 0x100000
#endif
/*
* Constants related to network buffer management.
@ -94,8 +101,12 @@
* Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
* logical pages.
*/
#define NKMEMPAGES_MIN_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
#ifndef NKMEMPAGES_MIN_DEFAULT
#define NKMEMPAGES_MIN_DEFAULT ((16 * 1024 * 1024) >> PAGE_SHIFT)
#endif
#ifndef NKMEMPAGES_MAX_DEFAULT
#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
#endif
/*
* pages ("clicks") to disk blocks
@ -114,24 +125,4 @@
#define dbtob(x) ((x) << DEV_BSHIFT)
#define btodb(x) ((x) >> DEV_BSHIFT)
/*
* Segment handling stuff
*/
#define SEGMENT_LENGTH 0x10000000
#define SEGMENT_MASK 0xf0000000
/*
* Fixed segments
*/
#define USER_SR 13
#define KERNEL_SR 14
#define KERNEL_SEGMENT (0xfffff0 + KERNEL_SR)
#define EMPTY_SEGMENT 0xfffff0
#define USER_ADDR ((void *)(USER_SR << ADDR_SR_SHFT))
/*
* Some system constants
*/
#ifndef NPMAPS
#define NPMAPS 32768 /* Number of pmaps in system */
#endif
#endif /* _POWERPC_PARAM_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_trace.c,v 1.8 2001/03/29 14:58:08 eeh Exp $ */
/* $NetBSD: db_trace.c,v 1.9 2001/06/06 17:36:03 matt Exp $ */
/* $OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $ */
/*
@ -118,7 +118,7 @@ db_stack_trace_print(addr, have_addr, count, modif, pr)
db_addr_t *args = (db_addr_t *)(frame + 8);
lr = *(db_addr_t *)(frame + 4) - 4;
if (lr & 3) {
if ((lr & 3) || (lr < 0x10000)) {
(*pr)("saved LR(0x%x) is invalid.", lr);
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.42 2001/06/02 18:09:19 chs Exp $ */
/* $NetBSD: trap.c,v 1.43 2001/06/06 17:36:03 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -161,6 +161,10 @@ trap(frame)
case EXC_ISI|EXC_USER:
KERNEL_PROC_LOCK(p);
ftype = VM_PROT_READ | VM_PROT_EXECUTE;
#ifdef PMAPDEBUG
printf("trap: user ISI trap @ %#x (ssr1=%#x)\n",
frame->srr0, frame->srr1);
#endif
rv = uvm_fault(&p->p_vmspace->vm_map, trunc_page(frame->srr0),
0, ftype);
if (rv == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap_subr.S,v 1.4 2001/03/07 08:10:44 tsubai Exp $ */
/* $NetBSD: trap_subr.S,v 1.5 2001/06/06 17:36:04 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -239,6 +239,24 @@ _C_LABEL(decrsize) = .-_C_LABEL(decrint)
.globl _C_LABEL(tlbimiss),_C_LABEL(tlbimsize)
_C_LABEL(tlbimiss):
#ifdef PMAPDEBUG
mfspr 2,IMISS /* exception address */
li 1,24 /* get rid of the lower */
srw 2,2,1 /* 24 bits */
li 1,1 /* Load 1 */
cmpl 2,1,1 /* is it > 16MB */
blt 99f /* nope, skip saving these SPRs */
li 1,0xc0 /* arbitrary */
mfspr 2,HASH1
stw 2,0(1)
mfspr 2,HASH2
stw 2,4(1)
mfspr 2,IMISS
stw 2,8(1)
mfspr 2,ICMP
stw 2,12(1)
99:
#endif /* PMAPDEBUG */
mfspr 2,HASH1 /* get first pointer */
li 1,8
mfctr 0 /* save counter */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.26 2001/04/24 04:31:07 thorpej Exp $ */
/* $NetBSD: vm_machdep.c,v 1.27 2001/06/06 17:36:04 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -105,8 +105,7 @@ cpu_fork(p1, p2, stack, stacksize, func, arg)
#endif
pcb->pcb_pm = p2->p_vmspace->vm_map.pmap;
(void) pmap_extract(pmap_kernel(), (vaddr_t)pcb->pcb_pm,
(paddr_t *)&pcb->pcb_pmreal);
pcb->pcb_pmreal = pcb->pcb_pm; /* XXX */
/*
* Setup the trap frame for the new process
@ -157,8 +156,7 @@ cpu_swapin(p)
{
struct pcb *pcb = &p->p_addr->u_pcb;
(void) pmap_extract(pmap_kernel(), (vaddr_t)pcb->pcb_pm,
(paddr_t *)&pcb->pcb_pmreal);
pcb->pcb_pmreal = pcb->pcb_pm; /* XXX */
}
/*