Skip to content

Commit

Permalink
By the time that vm_reserv_init() runs, vm_phys_segs[] is initialized…
Browse files Browse the repository at this point in the history
…. Use

it instead of phys_avail[].

Discussed with:	Svatopluk Kraus
  • Loading branch information
alcriceedu committed Nov 22, 2014
1 parent 459c063 commit f4c161c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sys/vm/vm_reserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f4c161c

Please sign in to comment.