summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_pmemrange.c
diff options
context:
space:
mode:
authorAriane van der Steldt <ariane@cvs.openbsd.org>2011-07-08 18:25:57 +0000
committerAriane van der Steldt <ariane@cvs.openbsd.org>2011-07-08 18:25:57 +0000
commit48142241ec73b235e102c03fa64123d49a404e71 (patch)
treedd15a3a9398d676617f481f94b26cb905b6b7538 /sys/uvm/uvm_pmemrange.c
parent2938779744ddbf102425f64fa0f4d6f7993d1c89 (diff)
Move uvm_pmr_alloc_pig to kern/subr_hibernate.c
No callers, no functional change.
Diffstat (limited to 'sys/uvm/uvm_pmemrange.c')
-rw-r--r--sys/uvm/uvm_pmemrange.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/sys/uvm/uvm_pmemrange.c b/sys/uvm/uvm_pmemrange.c
index c39f01f3074..5d0678af0e5 100644
--- a/sys/uvm/uvm_pmemrange.c
+++ b/sys/uvm/uvm_pmemrange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.c,v 1.31 2011/07/08 18:20:10 ariane Exp $ */
+/* $OpenBSD: uvm_pmemrange.c,v 1.32 2011/07/08 18:25:56 ariane Exp $ */
/*
* Copyright (c) 2009, 2010 Ariane van der Steldt <ariane@stack.nl>
@@ -1942,49 +1942,3 @@ uvm_wakeup_pla(paddr_t low, psize_t len)
}
}
}
-
-#ifndef SMALL_KERNEL
-/*
- * Allocate the biggest contig chunk of memory.
- */
-int
-uvm_pmr_alloc_pig(paddr_t *addr, psize_t *sz)
-{
- struct uvm_pmemrange *pig_pmr, *pmr;
- struct vm_page *pig_pg, *pg;
- int memtype;
-
- uvm_lock_fpageq();
- pig_pg = NULL;
- TAILQ_FOREACH(pmr, &uvm.pmr_control.use, pmr_use) {
- for (memtype = 0; memtype < UVM_PMR_MEMTYPE_MAX; memtype++) {
- /* Find biggest page in this memtype pmr. */
- pg = RB_MAX(uvm_pmr_size, &pmr->size[memtype]);
- if (pg == NULL)
- pg = TAILQ_FIRST(&pmr->single[memtype]);
- else
- pg--;
-
- if (pig_pg == NULL || (pg != NULL && pig_pg != NULL &&
- pig_pg->fpgsz < pg->fpgsz)) {
- pig_pmr = pmr;
- pig_pg = pg;
- }
- }
- }
-
- /* Remove page from freelist. */
- if (pig_pg != NULL) {
- uvm_pmr_remove(pig_pmr, pig_pg);
- uvmexp.free -= pig_pg->fpgsz;
- if (pig_pg->pg_flags & PG_ZERO)
- uvmexp.zeropages -= pig_pg->fpgsz;
- *addr = VM_PAGE_TO_PHYS(pig_pg);
- *sz = pig_pg->fpgsz;
- }
- uvm_unlock_fpageq();
-
- /* Return. */
- return (pig_pg != NULL ? 0 : ENOMEM);
-}
-#endif /* SMALL_KERNEL */