remove bitrotted functions that have never been used, and have been
cargo-culted from one port to another.
This commit is contained in:
parent
b3b862261c
commit
e04236d6b3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.24 2005/12/24 20:06:47 perry Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.25 2006/05/15 12:47:42 dogcow Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -108,7 +108,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.24 2005/12/24 20:06:47 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.25 2006/05/15 12:47:42 dogcow Exp $");
|
||||
|
||||
#ifndef __x86_64__
|
||||
#include "opt_cputype.h"
|
||||
@ -559,10 +559,6 @@ static void pmap_remove_ptes __P((struct pmap *,
|
||||
#define PMAP_REMOVE_ALL 0 /* remove all mappings */
|
||||
#define PMAP_REMOVE_SKIPWIRED 1 /* skip wired mappings */
|
||||
|
||||
static vaddr_t pmap_tmpmap_pa __P((paddr_t));
|
||||
static pt_entry_t *pmap_tmpmap_pvepte __P((struct pv_entry *));
|
||||
static void pmap_tmpunmap_pa __P((void));
|
||||
static void pmap_tmpunmap_pvepte __P((struct pv_entry *));
|
||||
static void pmap_unmap_ptes __P((struct pmap *));
|
||||
static boolean_t pmap_get_physpage __P((vaddr_t, int, paddr_t *));
|
||||
static boolean_t pmap_pdes_valid __P((vaddr_t, pd_entry_t **,
|
||||
@ -601,90 +597,6 @@ pmap_is_active(pmap, cpu_num)
|
||||
(pmap->pm_cpus & (1U << cpu_num)) != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pa: map a page in for tmp usage
|
||||
*/
|
||||
|
||||
inline static vaddr_t
|
||||
pmap_tmpmap_pa(pa)
|
||||
paddr_t pa;
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (*ptpte)
|
||||
panic("pmap_tmpmap_pa: ptp_pte in use?");
|
||||
#endif
|
||||
*ptpte = PG_V | PG_RW | pa; /* always a new mapping */
|
||||
return((vaddr_t)ptpva);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pa: unmap a tmp use page (undoes pmap_tmpmap_pa)
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pa()
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (!pmap_valid_entry(*ptp_pte))
|
||||
panic("pmap_tmpunmap_pa: our pte invalid?");
|
||||
#endif
|
||||
*ptpte = 0; /* zap! */
|
||||
pmap_update_pg((vaddr_t)ptpva);
|
||||
#ifdef MULTIPROCESSOR
|
||||
/*
|
||||
* No need for tlb shootdown here, since ptp_pte is per-CPU.
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pvepte: get a quick mapping of a PTE for a pv_entry
|
||||
*
|
||||
* => do NOT use this on kernel mappings [why? because pv_ptp may be NULL]
|
||||
*/
|
||||
|
||||
inline static pt_entry_t *
|
||||
pmap_tmpmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (pve->pv_pmap == pmap_kernel())
|
||||
panic("pmap_tmpmap_pvepte: attempt to map kernel");
|
||||
#endif
|
||||
|
||||
/* is it current pmap? use direct mapping... */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return(vtopte(pve->pv_va));
|
||||
|
||||
return(((pt_entry_t *)pmap_tmpmap_pa(VM_PAGE_TO_PHYS(pve->pv_ptp)))
|
||||
+ ptei((unsigned long)pve->pv_va));
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pvepte: release a mapping obtained with pmap_tmpmap_pvepte
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
/* was it current pmap? if so, return */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return;
|
||||
|
||||
pmap_tmpunmap_pa();
|
||||
}
|
||||
|
||||
inline static void
|
||||
pmap_apte_flush(struct pmap *pmap)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.191 2006/05/14 05:30:31 christos Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.192 2006/05/15 12:47:42 dogcow Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -60,7 +60,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.191 2006/05/14 05:30:31 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.192 2006/05/15 12:47:42 dogcow Exp $");
|
||||
|
||||
#include "opt_cputype.h"
|
||||
#include "opt_user_ldt.h"
|
||||
@ -491,10 +491,6 @@ static void pmap_remove_ptes(struct pmap *, struct vm_page *,
|
||||
#define PMAP_REMOVE_ALL 0 /* remove all mappings */
|
||||
#define PMAP_REMOVE_SKIPWIRED 1 /* skip wired mappings */
|
||||
|
||||
static vaddr_t pmap_tmpmap_pa(paddr_t);
|
||||
static pt_entry_t *pmap_tmpmap_pvepte(struct pv_entry *);
|
||||
static void pmap_tmpunmap_pa(void);
|
||||
static void pmap_tmpunmap_pvepte(struct pv_entry *);
|
||||
static void pmap_unmap_ptes(struct pmap *);
|
||||
|
||||
static boolean_t pmap_reactivate(struct pmap *);
|
||||
@ -531,89 +527,6 @@ pmap_is_active(pmap, cpu_id)
|
||||
(pmap->pm_cpus & (1U << cpu_id)) != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pa: map a page in for tmp usage
|
||||
*/
|
||||
|
||||
inline static vaddr_t
|
||||
pmap_tmpmap_pa(pa)
|
||||
paddr_t pa;
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (*ptpte)
|
||||
panic("pmap_tmpmap_pa: ptp_pte in use?");
|
||||
#endif
|
||||
*ptpte = PG_V | PG_RW | pa; /* always a new mapping */
|
||||
return((vaddr_t)ptpva);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pa: unmap a tmp use page (undoes pmap_tmpmap_pa)
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pa()
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (!pmap_valid_entry(*ptp_pte))
|
||||
panic("pmap_tmpunmap_pa: our pte invalid?");
|
||||
#endif
|
||||
*ptpte = 0; /* zap! */
|
||||
pmap_update_pg((vaddr_t)ptpva);
|
||||
#ifdef MULTIPROCESSOR
|
||||
/*
|
||||
* No need for tlb shootdown here, since ptp_pte is per-CPU.
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pvepte: get a quick mapping of a PTE for a pv_entry
|
||||
*
|
||||
* => do NOT use this on kernel mappings [why? because pv_ptp may be NULL]
|
||||
*/
|
||||
|
||||
inline static pt_entry_t *
|
||||
pmap_tmpmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (pve->pv_pmap == pmap_kernel())
|
||||
panic("pmap_tmpmap_pvepte: attempt to map kernel");
|
||||
#endif
|
||||
|
||||
/* is it current pmap? use direct mapping... */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return(vtopte(pve->pv_va));
|
||||
|
||||
return(((pt_entry_t *)pmap_tmpmap_pa(VM_PAGE_TO_PHYS(pve->pv_ptp)))
|
||||
+ ptei((unsigned)pve->pv_va));
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pvepte: release a mapping obtained with pmap_tmpmap_pvepte
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
/* was it current pmap? if so, return */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return;
|
||||
|
||||
pmap_tmpunmap_pa();
|
||||
}
|
||||
|
||||
inline static void
|
||||
pmap_apte_flush(struct pmap *pmap)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.80 2006/05/12 06:05:23 simonb Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.81 2006/05/15 12:47:42 dogcow Exp $ */
|
||||
|
||||
/*
|
||||
*
|
||||
@ -60,7 +60,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.80 2006/05/12 06:05:23 simonb Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.81 2006/05/15 12:47:42 dogcow Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -369,10 +369,6 @@ static void pmap_remove_ptes(struct pmap *,
|
||||
vaddr_t, vaddr_t, vaddr_t, int);
|
||||
#define PMAP_REMOVE_ALL 0 /* remove all mappings */
|
||||
#define PMAP_REMOVE_SKIPWIRED 1 /* skip wired mappings */
|
||||
static vaddr_t pmap_tmpmap_pa(paddr_t);
|
||||
static pt_entry_t *pmap_tmpmap_pvepte(struct pv_entry *);
|
||||
static void pmap_tmpunmap_pa(void);
|
||||
static void pmap_tmpunmap_pvepte(struct pv_entry *);
|
||||
static void pmap_unmap_ptes(struct pmap *);
|
||||
|
||||
/*
|
||||
@ -397,84 +393,6 @@ pmap_is_curpmap(struct pmap *pmap)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pa: map a page in for tmp usage
|
||||
*
|
||||
* => returns with pmap_tmpptp_lock held
|
||||
*/
|
||||
|
||||
inline static vaddr_t
|
||||
pmap_tmpmap_pa(paddr_t pa)
|
||||
{
|
||||
|
||||
simple_lock(&pmap_tmpptp_lock);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (*ptp_pte)
|
||||
panic("pmap_tmpmap_pa: ptp_pte in use?");
|
||||
#endif
|
||||
*ptp_pte = PG_V | PG_RW | pa; /* always a new mapping */
|
||||
return((vaddr_t)ptpp);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pa: unmap a tmp use page (undoes pmap_tmpmap_pa)
|
||||
*
|
||||
* => we release pmap_tmpptp_lock
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pa(void)
|
||||
{
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (!pmap_valid_entry(*ptp_pte))
|
||||
panic("pmap_tmpunmap_pa: our pte invalid?");
|
||||
#endif
|
||||
*ptp_pte = 0; /* zap! */
|
||||
pmap_update_pg((vaddr_t)ptpp);
|
||||
simple_unlock(&pmap_tmpptp_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pvepte: get a quick mapping of a PTE for a pv_entry
|
||||
*
|
||||
* => do NOT use this on kernel mappings [why? because pv_ptp may be NULL]
|
||||
* => we may grab pmap_tmpptp_lock and return with it held
|
||||
*/
|
||||
|
||||
inline static pt_entry_t *
|
||||
pmap_tmpmap_pvepte(struct pv_entry *pve)
|
||||
{
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
if (pve->pv_pmap == pmap_kernel())
|
||||
panic("pmap_tmpmap_pvepte: attempt to map kernel");
|
||||
#endif
|
||||
|
||||
/* is it current pmap? use direct mapping... */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return(vtopte(pve->pv_va));
|
||||
|
||||
return(((pt_entry_t *)pmap_tmpmap_pa(VM_PAGE_TO_PHYS(pve->pv_ptp)))
|
||||
+ ptei((unsigned)pve->pv_va));
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pvepte: release a mapping obtained with pmap_tmpmap_pvepte
|
||||
*
|
||||
* => we will release pmap_tmpptp_lock if we hold it
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pvepte(struct pv_entry *pve)
|
||||
{
|
||||
|
||||
/* was it current pmap? if so, return */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return;
|
||||
|
||||
pmap_tmpunmap_pa();
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_map_ptes: map a pmap's PTEs into KVM and lock them in
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmap.c,v 1.19 2006/01/23 20:19:08 yamt Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.20 2006/05/15 12:47:42 dogcow Exp $ */
|
||||
/* NetBSD: pmap.c,v 1.179 2004/10/10 09:55:24 yamt Exp */
|
||||
|
||||
/*
|
||||
@ -61,7 +61,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.19 2006/01/23 20:19:08 yamt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.20 2006/05/15 12:47:42 dogcow Exp $");
|
||||
|
||||
#include "opt_cputype.h"
|
||||
#include "opt_user_ldt.h"
|
||||
@ -519,10 +519,6 @@ static void pmap_remove_ptes(struct pmap *, struct vm_page *,
|
||||
#define PMAP_REMOVE_ALL 0 /* remove all mappings */
|
||||
#define PMAP_REMOVE_SKIPWIRED 1 /* skip wired mappings */
|
||||
|
||||
static vaddr_t pmap_tmpmap_pa(paddr_t);
|
||||
static pt_entry_t *pmap_tmpmap_pvepte(struct pv_entry *);
|
||||
static void pmap_tmpunmap_pa(void);
|
||||
static void pmap_tmpunmap_pvepte(struct pv_entry *);
|
||||
static void pmap_unmap_ptes(struct pmap *);
|
||||
|
||||
static boolean_t pmap_reactivate(struct pmap *);
|
||||
@ -563,93 +559,6 @@ pmap_is_active(pmap, cpu_id)
|
||||
(pmap->pm_cpus & (1U << cpu_id)) != 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pa: map a page in for tmp usage
|
||||
*/
|
||||
|
||||
inline static vaddr_t
|
||||
pmap_tmpmap_pa(pa)
|
||||
paddr_t pa;
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
pt_entry_t *maptp;
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (*ptpte)
|
||||
panic("pmap_tmpmap_pa: ptp_pte in use?");
|
||||
#endif
|
||||
maptp = (pt_entry_t *)vtomach((vaddr_t)ptpte);
|
||||
PTE_SET(ptpte, maptp, PG_V | PG_RW | pa); /* always a new mapping */
|
||||
return((vaddr_t)ptpva);
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pa: unmap a tmp use page (undoes pmap_tmpmap_pa)
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pa()
|
||||
{
|
||||
#ifdef MULTIPROCESSOR
|
||||
int id = cpu_number();
|
||||
#endif
|
||||
pt_entry_t *ptpte = PTESLEW(ptp_pte, id);
|
||||
pt_entry_t *maptp;
|
||||
caddr_t ptpva = VASLEW(ptpp, id);
|
||||
#if defined(DIAGNOSTIC)
|
||||
if (!pmap_valid_entry(*ptp_pte))
|
||||
panic("pmap_tmpunmap_pa: our pte invalid?");
|
||||
#endif
|
||||
maptp = (pt_entry_t *)vtomach((vaddr_t)ptpte);
|
||||
PTE_CLEAR(ptpte, maptp); /* zap! */
|
||||
pmap_update_pg((vaddr_t)ptpva);
|
||||
#ifdef MULTIPROCESSOR
|
||||
/*
|
||||
* No need for tlb shootdown here, since ptp_pte is per-CPU.
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpmap_pvepte: get a quick mapping of a PTE for a pv_entry
|
||||
*
|
||||
* => do NOT use this on kernel mappings [why? because pv_ptp may be NULL]
|
||||
*/
|
||||
|
||||
inline static pt_entry_t *
|
||||
pmap_tmpmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
#ifdef DIAGNOSTIC
|
||||
if (pve->pv_pmap == pmap_kernel())
|
||||
panic("pmap_tmpmap_pvepte: attempt to map kernel");
|
||||
#endif
|
||||
|
||||
/* is it current pmap? use direct mapping... */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return(vtopte(pve->pv_va));
|
||||
|
||||
return(((pt_entry_t *)pmap_tmpmap_pa(VM_PAGE_TO_PHYS(pve->pv_ptp)))
|
||||
+ ptei((unsigned)pve->pv_va));
|
||||
}
|
||||
|
||||
/*
|
||||
* pmap_tmpunmap_pvepte: release a mapping obtained with pmap_tmpmap_pvepte
|
||||
*/
|
||||
|
||||
inline static void
|
||||
pmap_tmpunmap_pvepte(pve)
|
||||
struct pv_entry *pve;
|
||||
{
|
||||
/* was it current pmap? if so, return */
|
||||
if (pmap_is_curpmap(pve->pv_pmap))
|
||||
return;
|
||||
|
||||
pmap_tmpunmap_pa();
|
||||
}
|
||||
|
||||
inline static void
|
||||
pmap_apte_flush(struct pmap *pmap)
|
||||
|
Loading…
Reference in New Issue
Block a user