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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user