* Introduced CREATE_AREA_DONT_CLEAR create_area_etc() flag, which allows the
call to fetch non-clear pages. * B_PHYSICAL_BASE_ADDRESS does now imply B_CONTIGUOUS. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31932 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,6 +27,7 @@ struct vnode;
|
|||||||
// area creation flags
|
// area creation flags
|
||||||
#define CREATE_AREA_DONT_WAIT 0x01
|
#define CREATE_AREA_DONT_WAIT 0x01
|
||||||
#define CREATE_AREA_UNMAP_ADDRESS_RANGE 0x02
|
#define CREATE_AREA_UNMAP_ADDRESS_RANGE 0x02
|
||||||
|
#define CREATE_AREA_DONT_CLEAR 0x04
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -1768,6 +1768,8 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
|
|||||||
page_num_t guardPages;
|
page_num_t guardPages;
|
||||||
bool canOvercommit = false;
|
bool canOvercommit = false;
|
||||||
addr_t physicalBase = 0;
|
addr_t physicalBase = 0;
|
||||||
|
uint32 newPageState = (flags & CREATE_AREA_DONT_CLEAR) != 0
|
||||||
|
? PAGE_STATE_FREE : PAGE_STATE_CLEAR;
|
||||||
|
|
||||||
TRACE(("create_anonymous_area [%d] %s: size 0x%lx\n", team, name, size));
|
TRACE(("create_anonymous_area [%d] %s: size 0x%lx\n", team, name, size));
|
||||||
|
|
||||||
@@ -1797,6 +1799,7 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
|
|||||||
case B_PHYSICAL_BASE_ADDRESS:
|
case B_PHYSICAL_BASE_ADDRESS:
|
||||||
physicalBase = (addr_t)*address;
|
physicalBase = (addr_t)*address;
|
||||||
addressSpec = B_ANY_KERNEL_ADDRESS;
|
addressSpec = B_ANY_KERNEL_ADDRESS;
|
||||||
|
wiring = B_CONTIGUOUS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1884,7 +1887,7 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
|
|||||||
if (wiring == B_CONTIGUOUS) {
|
if (wiring == B_CONTIGUOUS) {
|
||||||
// we try to allocate the page run here upfront as this may easily
|
// we try to allocate the page run here upfront as this may easily
|
||||||
// fail for obvious reasons
|
// fail for obvious reasons
|
||||||
page = vm_page_allocate_page_run(PAGE_STATE_CLEAR, physicalBase,
|
page = vm_page_allocate_page_run(newPageState, physicalBase,
|
||||||
size / B_PAGE_SIZE);
|
size / B_PAGE_SIZE);
|
||||||
if (page == NULL) {
|
if (page == NULL) {
|
||||||
status = B_NO_MEMORY;
|
status = B_NO_MEMORY;
|
||||||
@@ -1957,7 +1960,7 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
|
|||||||
# endif
|
# endif
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
vm_page* page = vm_page_allocate_page(PAGE_STATE_CLEAR, true);
|
vm_page* page = vm_page_allocate_page(newPageState, true);
|
||||||
cache->InsertPage(page, offset);
|
cache->InsertPage(page, offset);
|
||||||
vm_map_page(area, page, address, protection);
|
vm_map_page(area, page, address, protection);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user