summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-03 16:04:37 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:21 +0200
commitde5b521c0900bbd4d7012ffa3dfd63cc8f3d4371 (patch)
tree94658db3f559c6bdda21a4306620d5cacb2cdf6d /src/core
parentGeneral: Add Asserts (diff)
downloadyuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar.gz
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar.bz2
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar.lz
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar.xz
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.tar.zst
yuzu-de5b521c0900bbd4d7012ffa3dfd63cc8f3d4371.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/process.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index ea5fe5b29..f9d7c024d 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -22,6 +22,7 @@
#include "core/hle/kernel/resource_limit.h"
#include "core/hle/kernel/scheduler.h"
#include "core/hle/kernel/thread.h"
+#include "core/hle/lock.h"
#include "core/memory.h"
#include "core/settings.h"
@@ -345,6 +346,7 @@ static auto FindTLSPageWithAvailableSlots(std::vector<TLSPage>& tls_pages) {
}
VAddr Process::CreateTLSRegion() {
+ SchedulerLock lock(system.Kernel());
if (auto tls_page_iter{FindTLSPageWithAvailableSlots(tls_pages)};
tls_page_iter != tls_pages.cend()) {
return *tls_page_iter->ReserveSlot();
@@ -375,6 +377,7 @@ VAddr Process::CreateTLSRegion() {
}
void Process::FreeTLSRegion(VAddr tls_address) {
+ SchedulerLock lock(system.Kernel());
const VAddr aligned_address = Common::AlignDown(tls_address, Core::Memory::PAGE_SIZE);
auto iter =
std::find_if(tls_pages.begin(), tls_pages.end(), [aligned_address](const auto& page) {
@@ -389,6 +392,7 @@ void Process::FreeTLSRegion(VAddr tls_address) {
}
void Process::LoadModule(CodeSet code_set, VAddr base_addr) {
+ std::lock_guard lock{HLE::g_hle_lock};
const auto ReprotectSegment = [&](const CodeSet::Segment& segment,
Memory::MemoryPermission permission) {
page_table->SetCodeMemoryPermission(segment.addr + base_addr, segment.size, permission);