summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/pmap.c39
-rw-r--r--sys/arch/i386/i386/pmap.c4
-rw-r--r--sys/arch/m68k/m68k/pmap_motorola.c4
-rw-r--r--sys/arch/macppc/macppc/machdep.c5
-rw-r--r--sys/arch/mvme88k/mvme88k/pmap.c9
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c9
-rw-r--r--sys/arch/sparc/sparc/pmap.c40
-rw-r--r--sys/arch/sparc64/sparc64/pmap.c5
8 files changed, 56 insertions, 59 deletions
diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c
index 22fb769b976..043179c55f9 100644
--- a/sys/arch/alpha/alpha/pmap.c
+++ b/sys/arch/alpha/alpha/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.32 2001/12/19 08:58:05 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.33 2002/01/23 00:39:46 art Exp $ */
/* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */
/*-
@@ -512,8 +512,12 @@ void pmap_l3pt_delref(pmap_t, vaddr_t, pt_entry_t *, long,
void pmap_l2pt_delref(pmap_t, pt_entry_t *, pt_entry_t *, long);
void pmap_l1pt_delref(pmap_t, pt_entry_t *, long);
-void *pmap_l1pt_alloc(unsigned long, int, int);
-void pmap_l1pt_free(void *, unsigned long, int);
+void *pmap_l1pt_alloc(struct pool *, int);
+void pmap_l1pt_free(struct pool *, void *);
+
+struct pool_allocator pmap_l1pt_allocator = {
+ pmap_l1pt_alloc, pmap_l1pt_free, 0,
+};
int pmap_l1pt_ctor(void *, void *, int);
@@ -525,8 +529,11 @@ void pmap_pv_remove(pmap_t, paddr_t, vaddr_t, boolean_t,
struct pv_entry **);
struct pv_entry *pmap_pv_alloc(void);
void pmap_pv_free(struct pv_entry *);
-void *pmap_pv_page_alloc(u_long, int, int);
-void pmap_pv_page_free(void *, u_long, int);
+void *pmap_pv_page_alloc(struct pool *, int);
+void pmap_pv_page_free(struct pool *, void *);
+struct pool_allocator pmap_pv_allocator = {
+ pmap_pv_page_alloc, pmap_pv_page_free, 0,
+};
#ifdef DEBUG
void pmap_pv_dump(paddr_t);
#endif
@@ -947,19 +954,17 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids)
*/
pmap_ncpuids = ncpuids;
pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl",
- 0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
+ &pool_allocator_nointr);
pool_init(&pmap_l1pt_pool, PAGE_SIZE, 0, 0, 0, "l1ptpl",
- 0, pmap_l1pt_alloc, pmap_l1pt_free, M_VMPMAP);
+ &pmap_l1pt_allocator);
pool_cache_init(&pmap_l1pt_cache, &pmap_l1pt_pool, pmap_l1pt_ctor,
NULL, NULL);
pool_init(&pmap_asn_pool, pmap_ncpuids * sizeof(u_int), 0, 0, 0,
- "pmasnpl",
- 0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
+ "pmasnpl", &pool_allocator_nointr);
pool_init(&pmap_asngen_pool, pmap_ncpuids * sizeof(u_long), 0, 0, 0,
- "pmasngenpl",
- 0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
+ "pmasngenpl", &pool_allocator_nointr);
pool_init(&pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pvpl",
- 0, pmap_pv_page_alloc, pmap_pv_page_free, M_VMPMAP);
+ &pmap_pv_allocator);
TAILQ_INIT(&pmap_all_pmaps);
@@ -1003,7 +1008,7 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids)
*/
pool_init(&pmap_tlb_shootdown_job_pool,
sizeof(struct pmap_tlb_shootdown_job), 0, 0, 0, "pmaptlbpl",
- 0, NULL, NULL, M_VMPMAP);
+ NULL);
for (i = 0; i < ALPHA_MAXPROCS; i++) {
TAILQ_INIT(&pmap_tlb_shootdown_q[i].pq_head);
simple_lock_init(&pmap_tlb_shootdown_q[i].pq_slock);
@@ -3203,7 +3208,7 @@ pmap_pv_free(struct pv_entry *pv)
* Allocate a page for the pv_entry pool.
*/
void *
-pmap_pv_page_alloc(u_long size, int flags, int mtype)
+pmap_pv_page_alloc(struct pool *pp, int flags)
{
paddr_t pg;
@@ -3218,7 +3223,7 @@ pmap_pv_page_alloc(u_long size, int flags, int mtype)
* Free a pv_entry pool page.
*/
void
-pmap_pv_page_free(void *v, u_long size, int mtype)
+pmap_pv_page_free(struct pool *pp, void *v)
{
pmap_physpage_free(ALPHA_K0SEG_TO_PHYS((vaddr_t)v));
@@ -3600,7 +3605,7 @@ pmap_l1pt_ctor(void *arg, void *object, int flags)
* Page alloctor for L1 PT pages.
*/
void *
-pmap_l1pt_alloc(unsigned long sz, int flags, int mtype)
+pmap_l1pt_alloc(struct pool *pp, int flags)
{
paddr_t ptpa;
@@ -3627,7 +3632,7 @@ pmap_l1pt_alloc(unsigned long sz, int flags, int mtype)
* Page freer for L1 PT pages.
*/
void
-pmap_l1pt_free(void *v, unsigned long sz, int mtype)
+pmap_l1pt_free(struct pool *pp, void *v)
{
pmap_physpage_free(ALPHA_K0SEG_TO_PHYS((vaddr_t) v));
diff --git a/sys/arch/i386/i386/pmap.c b/sys/arch/i386/i386/pmap.c
index d1b677fc309..d9c5df4b464 100644
--- a/sys/arch/i386/i386/pmap.c
+++ b/sys/arch/i386/i386/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.57 2001/12/19 08:58:05 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.58 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */
/*
@@ -837,7 +837,7 @@ pmap_bootstrap(kva_start)
*/
pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl",
- 0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
+ &pool_allocator_nointr);
#ifdef __NetBSD__
/*
diff --git a/sys/arch/m68k/m68k/pmap_motorola.c b/sys/arch/m68k/m68k/pmap_motorola.c
index aeff6d43056..02c67f39482 100644
--- a/sys/arch/m68k/m68k/pmap_motorola.c
+++ b/sys/arch/m68k/m68k/pmap_motorola.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_motorola.c,v 1.15 2002/01/10 21:08:43 miod Exp $ */
+/* $OpenBSD: pmap_motorola.c,v 1.16 2002/01/23 00:39:47 art Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -574,7 +574,7 @@ pmap_init()
* Initialize the pmap pools.
*/
pool_init(&pmap_pmap_pool, sizeof(struct pmap), 0, 0, 0, "pmappl",
- 0, pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
+ &pool_allocator_nointr);
/*
* Now it is safe to enable pv_table recording.
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 2602917e5d2..042176b0df8 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.21 2002/01/16 20:50:16 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.22 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -481,8 +481,7 @@ where = 3;
(void)power4e_get_eth_addr();
#ifdef PPC_VECTOR_SUPPORTED
- pool_init(&ppc_vecpl, sizeof(struct vreg), 16, 0, 0, "ppcvec",
- 0, NULL, NULL, M_SUBPROC);
+ pool_init(&ppc_vecpl, sizeof(struct vreg), 16, 0, 0, "ppcvec", NULL);
#endif /* PPC_VECTOR_SUPPORTED */
}
diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c
index f8e0e907526..ac2638f72cb 100644
--- a/sys/arch/mvme88k/mvme88k/pmap.c
+++ b/sys/arch/mvme88k/mvme88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.61 2001/12/27 22:33:46 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.62 2002/01/23 00:39:47 art Exp $ */
/*
* Copyright (c) 2001 Miodrag Vallat
* Copyright (c) 1998-2001 Steve Murphree, Jr.
@@ -1303,10 +1303,9 @@ pmap_init(void)
attr += npages;
}
- pool_init(&pmappool, sizeof(struct pmap), 0, 0, 0, "pmappl", 0,
- pool_page_alloc_nointr, pool_page_free_nointr, M_VMPMAP);
- pool_init(&pvpool, sizeof(pv_entry_t), 0, 0, 0, "pvpl", 0,
- NULL, NULL, M_VMPVENT);
+ pool_init(&pmappool, sizeof(struct pmap), 0, 0, 0, "pmappl",
+ &pool_allocator_nointr);
+ pool_init(&pvpool, sizeof(pv_entry_t), 0, 0, 0, "pvpl", NULL);
pmap_initialized = TRUE;
} /* pmap_init() */
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index 3cf66b09549..bc4e8e14e6b 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.55 2002/01/13 05:27:40 drahn Exp $ */
+/* $OpenBSD: pmap.c,v 1.56 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */
/*
@@ -729,13 +729,12 @@ pmap_init()
for (i = npgs; --i >= 0;)
pv++->pv_idx = -1;
#ifdef USE_PMAP_VP
- pool_init(&pmap_vp_pool, PAGE_SIZE, 0, 0, 0, "ppvl",
- 0, NULL, NULL, M_VMPMAP);
+ pool_init(&pmap_vp_pool, PAGE_SIZE, 0, 0, 0, "ppvl", NULL);
#endif
pool_init(&pmap_pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pvpl",
- 0, NULL, NULL, M_VMPMAP);
+ NULL);
pool_init(&pmap_po_pool, sizeof(struct pte_ovfl), 0, 0, 0, "popl",
- 0, NULL, NULL, M_VMPMAP);
+ NULL);
pmap_attrib = (char *)pv;
bzero(pv, npgs);
pv = (struct pv_entry *)addr;
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index f0ef4375d49..23cd2348e08 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.117 2001/12/19 08:58:05 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.118 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -214,8 +214,12 @@ pvfree(pv)
*/
static struct pool L1_pool;
static struct pool L23_pool;
-void *pgt_page_alloc __P((unsigned long, int, int));
-void pgt_page_free __P((void *, unsigned long, int));
+void *pgt_page_alloc(struct pool *, int);
+void pgt_page_free(struct pool *, void *);
+
+struct pool_allocator pgt_allocator = {
+ pgt_page_alloc, pgt_page_free, 0,
+};
void pcache_flush __P((caddr_t, caddr_t, int));
void
@@ -233,30 +237,23 @@ pcache_flush(va, pa, n)
* Page table pool back-end.
*/
void *
-pgt_page_alloc(sz, flags, mtype)
- unsigned long sz;
- int flags;
- int mtype;
+pgt_page_alloc(struct pool *pp, int flags)
{
caddr_t p;
p = (caddr_t)uvm_km_kmemalloc(kernel_map, uvm.kernel_object,
- (vsize_t)sz, UVM_KMF_NOWAIT);
-
+ PAGE_SIZE, UVM_KMF_NOWAIT);
if (p != NULL && ((cpuinfo.flags & CPUFLG_CACHEPAGETABLES) == 0)) {
- pcache_flush(p, (caddr_t)VA2PA(p), sz);
- kvm_uncache(p, atop(sz));
+ pcache_flush(p, (caddr_t)VA2PA(p), PAGE_SIZE);
+ kvm_uncache(p, atop(PAGE_SIZE));
}
return (p);
}
void
-pgt_page_free(v, sz, mtype)
- void *v;
- unsigned long sz;
- int mtype;
+pgt_page_free(struct pool *pp, void *v);
{
- uvm_km_free(kernel_map, (vaddr_t)v, sz);
+ uvm_km_free(kernel_map, (vaddr_t)v, PAGE_SIZE);
}
#endif /* SUN4M */
@@ -3359,8 +3356,7 @@ pmap_init()
sizeof(struct pvlist);
}
- pool_init(&pvpool, sizeof(struct pvlist), 0, 0, 0, "pvpl", 0,
- NULL, NULL, 0);
+ pool_init(&pvpool, sizeof(struct pvlist), 0, 0, 0, "pvpl", NULL);
/*
* We can set it here since it's only used in pmap_enter to see
@@ -3378,12 +3374,12 @@ pmap_init()
int n;
n = SRMMU_L1SIZE * sizeof(int);
- pool_init(&L1_pool, n, n, 0, 0, "L1 pagetable", 0,
- pgt_page_alloc, pgt_page_free, 0);
+ pool_init(&L1_pool, n, n, 0, 0, "L1 pagetable",
+ &pgt_page_allocator);
n = SRMMU_L2SIZE * sizeof(int);
- pool_init(&L23_pool, n, n, 0, 0, "L2/L3 pagetable", 0,
- pgt_page_alloc, pgt_page_free, 0);
+ pool_init(&L23_pool, n, n, 0, 0, "L2/L3 pagetable",
+ &pgt_page_allocator);
}
#endif
}
diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c
index 460480c3d83..3d5635483de 100644
--- a/sys/arch/sparc64/sparc64/pmap.c
+++ b/sys/arch/sparc64/sparc64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.8 2001/12/04 23:22:42 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.9 2002/01/23 00:39:47 art Exp $ */
/* $NetBSD: pmap.c,v 1.107 2001/08/31 16:47:41 eeh Exp $ */
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */
#define HWREF
@@ -1526,8 +1526,7 @@ pmap_init()
}
/* Setup a pool for additional pvlist structures */
- pool_init(&pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pv_entry", 0,
- NULL, NULL, 0);
+ pool_init(&pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pv_entry", NULL);
vm_first_phys = avail_start;
vm_num_phys = avail_end - avail_start;