vm: add map_self() method to utils::shm

Add complementary unmap_self() method.
Move VirtualMemory to util/vm.hpp
Minor associated include cleanup.
Move asm.h to util/asm.hpp
This commit is contained in:
Nekotekina 2020-11-08 01:56:35 +03:00
parent b68bdafadc
commit 1c99a2e7fb
24 changed files with 105 additions and 35 deletions

View file

@ -7,7 +7,6 @@
#include "Utilities/mutex.h"
#include "Utilities/Thread.h"
#include "Utilities/VirtualMemory.h"
#include "Utilities/address_range.h"
#include "Emu/CPU/CPUThread.h"
#include "Emu/Cell/lv2/sys_memory.h"
@ -18,6 +17,9 @@
#include <deque>
#include <shared_mutex>
#include "util/vm.hpp"
#include "util/asm.hpp"
LOG_CHANNEL(vm_log, "VM");
namespace vm
@ -301,9 +303,9 @@ namespace vm
// Block or signal new range locks
g_range_lock = addr | u64{size} << 32 | flags;
_mm_prefetch(g_range_lock_set + 0, _MM_HINT_T0);
_mm_prefetch(g_range_lock_set + 2, _MM_HINT_T0);
_mm_prefetch(g_range_lock_set + 4, _MM_HINT_T0);
utils::prefetch_read(g_range_lock_set + 0);
utils::prefetch_read(g_range_lock_set + 2);
utils::prefetch_read(g_range_lock_set + 4);
const auto range = utils::address_range::start_length(addr, size);
@ -497,9 +499,9 @@ namespace vm
g_range_lock = addr | range_locked;
_mm_prefetch(g_range_lock_set + 0, _MM_HINT_T0);
_mm_prefetch(g_range_lock_set + 2, _MM_HINT_T0);
_mm_prefetch(g_range_lock_set + 4, _MM_HINT_T0);
utils::prefetch_read(g_range_lock_set + 0);
utils::prefetch_read(g_range_lock_set + 2);
utils::prefetch_read(g_range_lock_set + 4);
const auto range = utils::address_range::start_length(addr, 128);