rem: if (virtualAddress < KERNEL_BASE)
add: if (IS_USER_ADDRESS(virtualAddress))
context: get_memory_map(const void *address, ulong numBytes, physical_entry *table, long numEntries){	vm_address_space *addressSpace;	addr_t virtualAddress = (addr_t)address;	addr_t pageOffset = virtualAddress & (B_PAGE_SIZE - 1);	addr_t physicalAddress;	status_t status = B_OK;	int32 index = -1;	addr_t offset = 0;	int flags;	TRACE(("get_memory_map(%p, %lu bytes, %ld entries)\n", address, numBytes, numEntries));	if (numEntries == 0 || numBytes == 0)		return B_BAD_VALUE;	// in which address space is the address to be found?		if (virtualAddress < KERNEL_BASE)		addressSpace = vm_get_current_user_aspace();	else		addressSpace = vm_get_kernel_aspace();	if (addressSpace == NULL)		return B_ERROR;	(*addressSpace->translation_map.ops->lock)(&addressSpace->translation_map);	while (offset < numBytes) {		addr_t bytes = min(numBytes - offset, B_PAGE_SIZE);		status = (*addressSpace->translation_map.ops->query)(&addressSpace->translation_map,					(addr_t)address + offset, &physicalAddress, &flags);		if (status < 0)			break;		if (index < 0 && pageOffset > 0) {			physicalAddress += pageOffset;			if (bytes > B_PAGE_SIZE - pageOffset)				bytes = B_PAGE_SIZE - pageOffset;		}		// need to switch to the next physical_entry?		if (index < 0 || (addr_t)table[index].address != physicalAddress - table[index].size) {			if (++index + 1 > numEntries) {				// table to small				status = B_BUFFER_OVERFLOW;				break;			}			table[index].address = (void *)physicalAddress;			table[index].size = bytes;		} else {			// page does fit in current entry			table[index].size += bytes;		}		offset += bytes;	}	(*addressSpace->translation_map.ops->unlock)(&addressSpace->translation_map);	// close the entry list	if (status == B_OK) {		if (++index + 1 > numEntries)			return B_BUFFER_OVERFLOW;		table[index].address = NULL;		table[index].size = 0;	}	return status;}