summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2014-11-22 17:46:30 +0000
committeralc <alc@FreeBSD.org>2014-11-22 17:46:30 +0000
commitf4c161ccb6f228644f4097b574604e44f89bf27f (patch)
treefed76e2215cd44ebffa4b5aaee2f855af5fc2c95
parent459c06361687f04f43b50e83bab334c9650936a9 (diff)
downloadFreeBSD-src-f4c161ccb6f228644f4097b574604e44f89bf27f.zip
FreeBSD-src-f4c161ccb6f228644f4097b574604e44f89bf27f.tar.gz
By the time that vm_reserv_init() runs, vm_phys_segs[] is initialized. Use
it instead of phys_avail[]. Discussed with: Svatopluk Kraus
-rw-r--r--sys/vm/vm_reserv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index 4d35a4f..23980e8 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -818,15 +818,17 @@ void
vm_reserv_init(void)
{
vm_paddr_t paddr;
- int i;
+ struct vm_phys_seg *seg;
+ int segind;
/*
* Initialize the reservation array. Specifically, initialize the
* "pages" field for every element that has an underlying superpage.
*/
- for (i = 0; phys_avail[i + 1] != 0; i += 2) {
- paddr = roundup2(phys_avail[i], VM_LEVEL_0_SIZE);
- while (paddr + VM_LEVEL_0_SIZE <= phys_avail[i + 1]) {
+ for (segind = 0; segind < vm_phys_nsegs; segind++) {
+ seg = &vm_phys_segs[segind];
+ paddr = roundup2(seg->start, VM_LEVEL_0_SIZE);
+ while (paddr + VM_LEVEL_0_SIZE <= seg->end) {
vm_reserv_array[paddr >> VM_LEVEL_0_SHIFT].pages =
PHYS_TO_VM_PAGE(paddr);
paddr += VM_LEVEL_0_SIZE;
OpenPOWER on IntegriCloud