Remove shared_cond and simplify reservation waiting

Use atomic wait for reservations
Cleanup some obsolete code
This commit is contained in:
Nekotekina 2019-09-09 11:29:14 +03:00
parent d13ff285d1
commit 0a96497e13
7 changed files with 4 additions and 537 deletions

View file

@ -17,8 +17,6 @@
#include <thread>
#include <deque>
static_assert(sizeof(shared_cond) == 8, "Unexpected size of shared_cond");
namespace vm
{
static u8* memory_reserve_4GiB(std::uintptr_t _addr = 0)
@ -50,9 +48,6 @@ namespace vm
// Reservation stats (compressed x16)
u8* const g_reservations = memory_reserve_4GiB((std::uintptr_t)g_stat_addr);
// Reservation sync variables
u8* const g_reservations2 = g_reservations + 0x10000000;
// Memory locations
std::vector<std::shared_ptr<block_t>> g_locations;
@ -634,11 +629,9 @@ namespace vm
if (addr == 0x10000)
{
utils::memory_commit(g_reservations, 0x1000);
utils::memory_commit(g_reservations2, 0x1000);
}
utils::memory_commit(g_reservations + addr / 16, size / 16);
utils::memory_commit(g_reservations2 + addr / 16, size / 16);
}
else
{
@ -646,12 +639,10 @@ namespace vm
for (u32 i = 0; i < 6; i++)
{
utils::memory_commit(g_reservations + addr / 16 + i * 0x10000, 0x4000);
utils::memory_commit(g_reservations2 + addr / 16 + i * 0x10000, 0x4000);
}
// End of the address space
utils::memory_commit(g_reservations + 0xfff0000, 0x10000);
utils::memory_commit(g_reservations2 + 0xfff0000, 0x10000);
}
if (flags & 0x100)