summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-05-23 06:45:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-05-23 06:45:21 +0000
commitba50231bab01e91be3dbb36908fe1b7363dbe57c (patch)
treeee70a5e13ed8557de17d23daf029631a7cc1f88c /sys/arch
parent4fa5afc2b460b4d92ba11433a4fbd0951039b005 (diff)
Remove unused pmap_steal_memory_implementation(). It doesn't actually work
and implementing this interface only really makes sense for architectures that use a direct map. ok patrick@, visa@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm64/arm64/pmap.c68
1 files changed, 1 insertions, 67 deletions
diff --git a/sys/arch/arm64/arm64/pmap.c b/sys/arch/arm64/arm64/pmap.c
index 8320fa1e8e7..9f944176392 100644
--- a/sys/arch/arm64/arm64/pmap.c
+++ b/sys/arch/arm64/arm64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.52 2018/05/16 09:07:45 kettenis Exp $ */
+/* $OpenBSD: pmap.c,v 1.53 2018/05/23 06:45:20 kettenis Exp $ */
/*
* Copyright (c) 2008-2009,2014-2016 Dale Rahn <drahn@dalerahn.com>
*
@@ -960,72 +960,6 @@ pmap_vp_destroy(pmap_t pm)
pm->pm_vp.l0 = NULL;
}
-/*
- * Similar to pmap_steal_avail, but operating on vm_physmem since
- * uvm_page_physload() has been called.
- */
-vaddr_t
-pmap_steal_memory(vsize_t size, vaddr_t *start, vaddr_t *end)
-{
- struct vm_physseg *seg;
- vaddr_t va;
- paddr_t pa;
- int segno;
- u_int npg;
-
- size = round_page(size);
- npg = atop(size);
-
- for (segno = 0, seg = vm_physmem; segno < vm_nphysseg; segno++, seg++) {
- if (seg->avail_end - seg->avail_start < npg)
- continue;
- /*
- * We can only steal at an ``unused'' segment boundary,
- * i.e. either at the start or at the end.
- */
- if (seg->avail_start == seg->start ||
- seg->avail_end == seg->end)
- break;
- }
- if (segno == vm_nphysseg)
- va = 0;
- else {
- if (seg->avail_start == seg->start) {
- pa = ptoa(seg->avail_start);
- seg->avail_start += npg;
- seg->start += npg;
- } else {
- pa = ptoa(seg->avail_end) - size;
- seg->avail_end -= npg;
- seg->end -= npg;
- }
- /*
- * If all the segment has been consumed now, remove it.
- * Note that the crash dump code still knows about it
- * and will dump it correctly.
- */
- if (seg->start == seg->end) {
- if (vm_nphysseg-- == 1)
- panic("pmap_steal_memory: out of memory");
- while (segno < vm_nphysseg) {
- seg[0] = seg[1]; /* struct copy */
- seg++;
- segno++;
- }
- }
-
- va = (vaddr_t)pa; /* 1:1 mapping */
- bzero((void *)va, size);
- }
-
- if (start != NULL)
- *start = VM_MIN_KERNEL_ADDRESS;
- if (end != NULL)
- *end = VM_MAX_KERNEL_ADDRESS;
-
- return (va);
-}
-
vaddr_t virtual_avail, virtual_end;
static inline uint64_t