summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-09-27 20:45:24 +0000
committerdg <dg@FreeBSD.org>1994-09-27 20:45:24 +0000
commite513bd35afde67eeb8769f325fbe698707f6209b (patch)
treef63d392b7b56993f3898769e159b5bd06ab23ce2 /sys
parent77843a901a451b12851b0d452b11d042cd4b4c44 (diff)
downloadFreeBSD-src-e513bd35afde67eeb8769f325fbe698707f6209b.zip
FreeBSD-src-e513bd35afde67eeb8769f325fbe698707f6209b.tar.gz
Fixed another bug, and cleaned up the code.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_page.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 1a2ab55..189bff8 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
- * $Id: vm_page.c,v 1.6 1994/09/27 18:00:27 davidg Exp $
+ * $Id: vm_page.c,v 1.7 1994/09/27 19:34:16 davidg Exp $
*/
/*
@@ -605,7 +605,7 @@ again:
* Find first page in array that is free, within range, and aligned.
*/
for (i = start; i < cnt.v_page_count; i++) {
- phys = pga[i].phys_addr;
+ phys = VM_PAGE_TO_PHYS(&pga[i]);
if (((pga[i].flags & PG_FREE) == PG_FREE) &&
(phys >= low) && (phys < high) &&
((phys & (alignment - 1)) == 0))
@@ -615,7 +615,7 @@ again:
/*
* If the above failed or we will exceed the upper bound, fail.
*/
- if ((i == cnt.v_page_count) || ((pga[i].phys_addr + size) > high)) {
+ if ((i == cnt.v_page_count) || ((VM_PAGE_TO_PHYS(&pga[i]) + size) > high)) {
splx(s);
return (NULL);
}
@@ -626,8 +626,8 @@ again:
* Check successive pages for contiguous and free.
*/
for (i = start + 1; i < (start + size / PAGE_SIZE); i++) {
- if ((pga[i].phys_addr !=
- (pga[i - 1].phys_addr + PAGE_SIZE)) ||
+ if ((VM_PAGE_TO_PHYS(&pga[i]) !=
+ (VM_PAGE_TO_PHYS(&pga[i - 1]) + PAGE_SIZE)) ||
((pga[i].flags & PG_FREE) != PG_FREE)) {
start++;
goto again;
@@ -646,7 +646,7 @@ again:
cnt.v_free_count--;
vm_page_wire(&pga[i]);
pga[i].flags = PG_CLEAN; /* shut off PG_FREE and any other flags */
- pmap_kenter(tmp_addr, pga[start].phys_addr);
+ pmap_kenter(tmp_addr, VM_PAGE_TO_PHYS(&pga[i]));
tmp_addr += PAGE_SIZE;
}
OpenPOWER on IntegriCloud