summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-04-29 07:43:16 +0000
committerpeter <peter@FreeBSD.org>2002-04-29 07:43:16 +0000
commitc0e3147cc6cb9443ed740df00ac3e6ff532536e5 (patch)
tree8606fb37ea8e86e89888ad66971582ab9925c328 /sys/alpha
parent18fb0e27c7018fe7e30a1a44ac1ab4bd16f98130 (diff)
downloadFreeBSD-src-c0e3147cc6cb9443ed740df00ac3e6ff532536e5.zip
FreeBSD-src-c0e3147cc6cb9443ed740df00ac3e6ff532536e5.tar.gz
Tidy up some loose ends.
i386/ia64/alpha - catch up to sparc64/ppc: - replace pmap_kernel() with refs to kernel_pmap - change kernel_pmap pointer to (&kernel_pmap_store) (this is a speedup since ld can set these at compile/link time) all platforms (as suggested by jake): - gc unused pmap_reference - gc unused pmap_destroy - gc unused struct pmap.pm_count (we never used pm_count - we track address space sharing at the vmspace)
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/pmap.c55
-rw-r--r--sys/alpha/include/pmap.h5
-rw-r--r--sys/alpha/isa/isa_dma.c2
3 files changed, 7 insertions, 55 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c
index 05339c7..d2fb088 100644
--- a/sys/alpha/alpha/pmap.c
+++ b/sys/alpha/alpha/pmap.c
@@ -222,7 +222,7 @@
* Given a map and a machine independent protection code,
* convert to an alpha protection code.
*/
-#define pte_prot(m, p) (protection_codes[m == pmap_kernel() ? 0 : 1][p])
+#define pte_prot(m, p) (protection_codes[m == kernel_pmap ? 0 : 1][p])
int protection_codes[2][8];
/*
@@ -296,8 +296,7 @@ vm_size_t Lev2mapsize, Lev3mapsize;
/*
* Statically allocated kernel pmap
*/
-static struct pmap kernel_pmap_store;
-pmap_t kernel_pmap;
+struct pmap kernel_pmap_store;
vm_offset_t avail_start; /* PA of first available physical page */
vm_offset_t avail_end; /* PA of last available physical page */
@@ -531,13 +530,9 @@ pmap_bootstrap(vm_offset_t ptaddr, u_int maxasn)
alpha_protection_init();
/*
- * The kernel's pmap is statically allocated so we don't have to use
- * pmap_create, which is unlikely to work correctly at this part of
- * the boot sequence (XXX and which no longer exists).
+ * Initialize the kernel pmap (which is statically allocated).
*/
- kernel_pmap = &kernel_pmap_store;
kernel_pmap->pm_lev1 = Lev1map;
- kernel_pmap->pm_count = 1;
kernel_pmap->pm_active = ~0;
kernel_pmap->pm_asn[alpha_pal_whami()].asn = 0;
kernel_pmap->pm_asn[alpha_pal_whami()].gen = 1;
@@ -1356,7 +1351,6 @@ pmap_pinit0(pmap)
int i;
pmap->pm_lev1 = Lev1map;
- pmap->pm_count = 1;
pmap->pm_ptphint = NULL;
pmap->pm_active = 0;
for (i = 0; i < MAXCPU; i++) {
@@ -1407,7 +1401,6 @@ pmap_pinit(pmap)
pmap->pm_lev1[PTLEV1I] = pmap_phys_to_pte(VM_PAGE_TO_PHYS(lev1pg))
| PG_V | PG_KRE | PG_KWE;
- pmap->pm_count = 1;
pmap->pm_ptphint = NULL;
pmap->pm_active = 0;
for (i = 0; i < MAXCPU; i++) {
@@ -1775,39 +1768,9 @@ pmap_growkernel(vm_offset_t addr)
critical_exit();
}
-/*
- * Retire the given physical map from service.
- * Should only be called if the map contains
- * no valid mappings.
- */
-void
-pmap_destroy(pmap_t pmap)
-{
- int count;
-
- if (pmap == NULL)
- return;
-
- count = --pmap->pm_count;
- if (count == 0) {
- pmap_release(pmap);
- panic("destroying a pmap is not yet implemented");
- }
-}
-
-/*
- * Add a reference to the specified pmap.
- */
-void
-pmap_reference(pmap_t pmap)
-{
- if (pmap != NULL) {
- pmap->pm_count++;
- }
-}
/***************************************************
-* page management routines.
+ * page management routines.
***************************************************/
/*
@@ -2691,16 +2654,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
{
}
-/*
- * Routine: pmap_kernel
- * Function:
- * Returns the physical map handle for the kernel.
- */
-pmap_t
-pmap_kernel()
-{
- return (kernel_pmap);
-}
/*
* pmap_zero_page zeros the specified hardware page by
diff --git a/sys/alpha/include/pmap.h b/sys/alpha/include/pmap.h
index e06902f..de171c1 100644
--- a/sys/alpha/include/pmap.h
+++ b/sys/alpha/include/pmap.h
@@ -173,7 +173,6 @@ struct pmap {
pt_entry_t *pm_lev1; /* KVA of lev0map */
vm_object_t pm_pteobj; /* Container for pte's */
TAILQ_HEAD(,pv_entry) pm_pvlist; /* list of mappings in pmap */
- int pm_count; /* reference count */
u_int32_t pm_active; /* active cpus */
struct {
u_int32_t asn:ASN_BITS; /* address space number */
@@ -192,7 +191,8 @@ struct pmap {
typedef struct pmap *pmap_t;
#ifdef _KERNEL
-extern pmap_t kernel_pmap;
+extern struct pmap kernel_pmap_store;
+#define kernel_pmap (&kernel_pmap_store)
#endif
/*
@@ -231,7 +231,6 @@ vm_offset_t pmap_steal_memory(vm_size_t);
void pmap_bootstrap(vm_offset_t, u_int);
void pmap_setdevram(unsigned long long basea, vm_offset_t sizea);
int pmap_uses_prom_console(void);
-pmap_t pmap_kernel(void);
void *pmap_mapdev(vm_offset_t, vm_size_t);
void pmap_unmapdev(vm_offset_t, vm_size_t);
unsigned *pmap_pte(pmap_t, vm_offset_t) __pure2;
diff --git a/sys/alpha/isa/isa_dma.c b/sys/alpha/isa/isa_dma.c
index 45b2f02..4d57b39 100644
--- a/sys/alpha/isa/isa_dma.c
+++ b/sys/alpha/isa/isa_dma.c
@@ -239,7 +239,7 @@ static void isa_dmastart_cb(void *arg, bus_dma_segment_t *segs, int nseg,
panic("isa_dmastart: transfer mapping not contiguous");
if ((chipset.sgmap == NULL) &&
- (pmap_extract(pmap_kernel(), (vm_offset_t)addr)
+ (pmap_extract(kernel_pmap, (vm_offset_t)addr)
> BUS_SPACE_MAXADDR_24BIT)) {
/* we bounced */
dma_bounced |= (1 << chan);
OpenPOWER on IntegriCloud