diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-09-10 16:59:15 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-09-10 16:59:15 +0000 |
commit | c8759bf8436684b473fb86971fb78dfbec302044 (patch) | |
tree | 192c5d637c53c64490eb6fb2ed798bc5446ce095 /sys/uvm/uvm_page.c | |
parent | f77714c7f4a232941861af5e81441bd3542a6f1d (diff) |
fixup the uvm_map() call in the uvm_pagealloc_contig() w/
right uvm_map flags values, also fix the error ondition check.
couple of spaces vs tabs in the same code spot.
art@ ok
Diffstat (limited to 'sys/uvm/uvm_page.c')
-rw-r--r-- | sys/uvm/uvm_page.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 70ca9b258d3..fa85122f307 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -971,18 +971,21 @@ uvm_pagealloc_contig(size, low, high, alignment) TAILQ_INIT(&pglist); if (uvm_pglistalloc(size, low, high, alignment, 0, &pglist, 1, FALSE)) - return 0; + return 0; addr = vm_map_min(kernel_map); - if (uvm_map(kernel_map, &addr, size, NULL, - UVM_UNKNOWN_OFFSET, TRUE) != KERN_SUCCESS) - addr = 0; + if (uvm_map(kernel_map, &addr, size, NULL, UVM_UNKNOWN_OFFSET, + UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_NONE, + UVM_ADV_RANDOM, 0)) != KERN_SUCCESS) { + uvm_pglistfree(&pglist); + return 0; + } temp_addr = addr; for (pg = TAILQ_FIRST(&pglist); pg != NULL; pg = TAILQ_NEXT(pg, pageq)) { pg->uobject = uvm.kernel_object; pg->offset = temp_addr - vm_map_min(kernel_map); uvm_pageinsert(pg); - uvm_pagewire(pg); + uvm_pagewire(pg); #if defined(PMAP_NEW) pmap_kenter_pa(temp_addr, VM_PAGE_TO_PHYS(pg), VM_PROT_READ|VM_PROT_WRITE); |