Merge remote-tracking branch 'upstream/master'

This commit is contained in:
S Gopal Rajagopal 2015-02-18 23:43:37 +05:30
commit 85648da706
83 changed files with 4587 additions and 4103 deletions

View file

@ -276,7 +276,7 @@ namespace vm
return true;
}
bool reservation_query(u32 addr, bool is_writing)
bool reservation_query(u32 addr, u32 size, bool is_writing, std::function<bool()> callback)
{
std::lock_guard<reservation_mutex_t> lock(g_reservation_mutex);
@ -285,10 +285,18 @@ namespace vm
return false;
}
if (is_writing)
// check if current reservation and address may overlap
if (g_reservation_addr >> 12 == addr >> 12 && is_writing)
{
// break the reservation
_reservation_break(addr);
if (size && addr + size - 1 >= g_reservation_addr && g_reservation_addr + g_reservation_size - 1 >= addr)
{
// break the reservation if overlap
_reservation_break(addr);
}
else
{
return callback(); //? true : _reservation_break(addr), true;
}
}
return true;