mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-19 17:50:51 +01:00
Fully initialize pages returned via vm_page_alloc_contig() so that the
memory can be later freed.
This commit is contained in:
parent
304bce7fcf
commit
d89ced81b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6565
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
|
||||
* $Id: vm_page.c,v 1.17 1995/01/24 10:13:35 davidg Exp $
|
||||
* $Id: vm_page.c,v 1.18 1995/02/02 09:09:05 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -755,10 +755,19 @@ again:
|
||||
tmp_addr = addr = kmem_alloc_pageable(kernel_map, size);
|
||||
|
||||
for (i = start; i < (start + size / PAGE_SIZE); i++) {
|
||||
TAILQ_REMOVE(&vm_page_queue_free, &pga[i], pageq);
|
||||
vm_page_t m = &pga[i];;
|
||||
|
||||
TAILQ_REMOVE(&vm_page_queue_free, m, pageq);
|
||||
cnt.v_free_count--;
|
||||
vm_page_wire(&pga[i]);
|
||||
vm_page_set_clean(&pga[i], 0, PAGE_SIZE);
|
||||
m->valid = VM_PAGE_BITS_ALL;
|
||||
m->flags = 0;
|
||||
m->dirty = 0;
|
||||
m->wire_count = 0;
|
||||
m->act_count = 0;
|
||||
m->bmapped = 0;
|
||||
m->busy = 0;
|
||||
vm_page_insert(m, kernel_object, tmp_addr - VM_MIN_KERNEL_ADDRESS);
|
||||
vm_page_wire(m);
|
||||
pmap_kenter(tmp_addr, VM_PAGE_TO_PHYS(&pga[i]));
|
||||
tmp_addr += PAGE_SIZE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user