rem: if (err < 0) return err;
add: if (status < B_OK) return status;
context: vm_map_physical_memory(aspace_id aid, const char *name, void **_address,	uint32 addressSpec, addr_t size, uint32 protection, addr_t phys_addr){	vm_area *area;	vm_cache *cache;	vm_cache_ref *cache_ref;	vm_store *store;	addr_t map_offset;	int err;	vm_address_space *aspace = vm_get_aspace_by_id(aid);	TRACE(("vm_map_physical_memory(aspace = %ld, \"%s\", virtual = %p, spec = %ld,"		" size = %lu, protection = %ld, phys = %p)\n",		aid, name, _address, addressSpec, size, protection, (void *)phys_addr));	if (!arch_vm_supports_protection(protection))		return B_NOT_SUPPORTED;	if (aspace == NULL)		return B_BAD_TEAM_ID;	// if the physical address is somewhat inside a page,	// move the actual area down to align on a page boundary	map_offset = phys_addr % B_PAGE_SIZE;	size += map_offset;	phys_addr -= map_offset;	size = PAGE_ALIGN(size);	// create an device store object	store = vm_store_create_device(phys_addr);	if (store == NULL)		panic("vm_map_physical_memory: vm_store_create_device returned NULL");	cache = vm_cache_create(store);	if (cache == NULL)		panic("vm_map_physical_memory: vm_cache_create returned NULL");	cache_ref = vm_cache_ref_create(cache);	if (cache_ref == NULL)		panic("vm_map_physical_memory: vm_cache_ref_create returned NULL");	// tell the page scanner to skip over this area, it's pages are special	cache->scan_skip = 1;	vm_cache_acquire_ref(cache_ref, true);	err = map_backing_store(aspace, store, _address, 0, size, addressSpec, 0, protection, REGION_NO_PRIVATE_MAP, &area, name);	vm_cache_release_ref(cache_ref);	vm_put_aspace(aspace);	if (err < 0)		return err;	// modify the pointer returned to be offset back into the new area	// the same way the physical address in was offset	*_address = (void *)((addr_t)*_address + map_offset);	return area->id;}