area_for() in the kernel can now also find user areas in case you are coming from a user team.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21746 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-07-30 11:54:11 +00:00
parent 2240e7df9b
commit 6e09c5679e
+11 -1
View File
@@ -4073,7 +4073,17 @@ get_memory_map(const void *address, ulong numBytes, physical_entry *table, long
area_id
area_for(void *address)
{
return vm_area_for(vm_kernel_address_space_id(), (addr_t)address);
team_id space;
if (IS_USER_ADDRESS(address)) {
// we try the user team address space, if any
space = vm_current_user_address_space_id();
if (space < B_OK)
return space;
} else
space = vm_kernel_address_space_id();
return vm_area_for(space, (addr_t)address);
}