summaryrefslogtreecommitdiff
path: root/sys/uvm
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
parent2938779744ddbf102425f64fa0f4d6f7993d1c89 (diff)
Move uvm_pmr_alloc_pig to kern/subr_hibernate.c
No callers, no functional change.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_pmemrange.c48
-rw-r--r--sys/uvm/uvm_pmemrange.h6
2 files changed, 2 insertions, 52 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 */
diff --git a/sys/uvm/uvm_pmemrange.h b/sys/uvm/uvm_pmemrange.h
index 697d9637c53..680e15719b9 100644
--- a/sys/uvm/uvm_pmemrange.h
+++ b/sys/uvm/uvm_pmemrange.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pmemrange.h,v 1.10 2011/07/08 18:20:10 ariane Exp $ */
+/* $OpenBSD: uvm_pmemrange.h,v 1.11 2011/07/08 18:25:56 ariane Exp $ */
/*
* Copyright (c) 2009 Ariane van der Steldt <ariane@stack.nl>
@@ -123,10 +123,6 @@ void uvm_wakeup_pla(paddr_t, psize_t);
int uvm_pmr_isfree(struct vm_page *pg);
#endif
-#ifndef SMALL_KERNEL
-int uvm_pmr_alloc_pig(paddr_t*, psize_t*);
-#endif /* SMALL_KERNEL */
-
/*
* Internal tree logic.
*/