Accidently unmapped the wrong pages in case of COW after the last commit...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20408 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1935,12 +1935,13 @@ status_t
|
|||||||
vm_unmap_pages(vm_area *area, addr_t base, size_t size)
|
vm_unmap_pages(vm_area *area, addr_t base, size_t size)
|
||||||
{
|
{
|
||||||
vm_translation_map *map = &area->address_space->translation_map;
|
vm_translation_map *map = &area->address_space->translation_map;
|
||||||
|
addr_t end = base + (size - 1);
|
||||||
|
|
||||||
map->ops->lock(map);
|
map->ops->lock(map);
|
||||||
|
|
||||||
if (area->wiring != B_NO_LOCK && area->cache_type != CACHE_TYPE_DEVICE) {
|
if (area->wiring != B_NO_LOCK && area->cache_type != CACHE_TYPE_DEVICE) {
|
||||||
// iterate through all pages and decrease their wired count
|
// iterate through all pages and decrease their wired count
|
||||||
for (addr_t virtualAddress = base; virtualAddress < base + (size - 1);
|
for (addr_t virtualAddress = base; virtualAddress < end;
|
||||||
virtualAddress += B_PAGE_SIZE) {
|
virtualAddress += B_PAGE_SIZE) {
|
||||||
addr_t physicalAddress;
|
addr_t physicalAddress;
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
@@ -1960,7 +1961,7 @@ vm_unmap_pages(vm_area *area, addr_t base, size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map->ops->unmap(map, base, base + (size - 1));
|
map->ops->unmap(map, base, end);
|
||||||
|
|
||||||
if (area->wiring == B_NO_LOCK) {
|
if (area->wiring == B_NO_LOCK) {
|
||||||
vm_area_mappings queue;
|
vm_area_mappings queue;
|
||||||
@@ -3536,7 +3537,7 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
|
|||||||
|
|
||||||
// In case this is a copy-on-write page, we need to unmap it from the area now
|
// In case this is a copy-on-write page, we need to unmap it from the area now
|
||||||
if (isWrite && page->cache == topCacheRef->cache)
|
if (isWrite && page->cache == topCacheRef->cache)
|
||||||
vm_unmap_pages(area, address - area->base, B_PAGE_SIZE);
|
vm_unmap_pages(area, address, B_PAGE_SIZE);
|
||||||
|
|
||||||
// TODO: there is currently no mechanism to prevent a page being mapped
|
// TODO: there is currently no mechanism to prevent a page being mapped
|
||||||
// more than once in case of a second page fault!
|
// more than once in case of a second page fault!
|
||||||
|
|||||||
Reference in New Issue
Block a user