[Kernel] Revert Guest->Host Object Mapping
This commit is contained in:
committed by
Radosław Gliński
parent
be689457cb
commit
18b5a6706a
@@ -479,44 +479,6 @@ X_STATUS ObjectTable::RestoreHandle(X_HANDLE handle, XObject* object) {
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void ObjectTable::MapGuestObjectToHostHandle(uint32_t guest_object,
|
||||
X_HANDLE host_handle) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
guest_to_host_handle_[guest_object] = host_handle;
|
||||
}
|
||||
bool ObjectTable::HostHandleForGuestObject(uint32_t guest_object, X_HANDLE& out) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
auto gobj_iter = guest_to_host_handle_.find(guest_object);
|
||||
if (gobj_iter == guest_to_host_handle_.end()) {
|
||||
return false;
|
||||
}
|
||||
out = gobj_iter->second;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ObjectTable::UnmapGuestObjectHostHandle(uint32_t guest_object) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
auto iter = guest_to_host_handle_.find(guest_object);
|
||||
if (iter == guest_to_host_handle_.end()) {
|
||||
return;
|
||||
} else {
|
||||
guest_to_host_handle_.erase(iter);
|
||||
}
|
||||
}
|
||||
void ObjectTable::FlushGuestToHostMapping(uint32_t base_address,
|
||||
uint32_t length) {
|
||||
auto global_lock = global_critical_region_.Acquire();
|
||||
auto iterator = guest_to_host_handle_.lower_bound(base_address);
|
||||
|
||||
while (iterator !=guest_to_host_handle_.end() && iterator->first >= base_address && iterator->first < (base_address + length)) {
|
||||
auto old_mapping = iterator;
|
||||
|
||||
iterator++;
|
||||
auto node_handle = guest_to_host_handle_.extract(old_mapping);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace kernel
|
||||
} // namespace xe
|
||||
|
||||
Reference in New Issue
Block a user