vm: add extern clear_range_locks function

Allows to wait for range locks to clear for specified range.
vm::range_lock now monitors specified reservation lock as well.
This commit is contained in:
Nekotekina 2020-10-30 07:58:16 +03:00
parent 0da24f21d6
commit 3419d15878
4 changed files with 32 additions and 15 deletions

View file

@ -226,11 +226,8 @@ namespace vm
return result;
}
static void _lock_shareable_cache(u8 value, u32 addr, u32 size)
void clear_range_locks(u32 addr, u32 size)
{
// Block new range locks
g_addr_lock = addr | u64{size} << 32;
ASSUME(size);
const auto range = utils::address_range::start_length(addr, size);
@ -259,6 +256,14 @@ namespace vm
}
}
static void _lock_shareable_cache(u8 value, u32 addr, u32 size)
{
// Block new range locks
g_addr_lock = addr | u64{size} << 32;
clear_range_locks(addr, size);
}
void passive_lock(cpu_thread& cpu)
{
bool ok = true;