summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar bunnei2021-12-20 14:24:50 -0800
committerGravatar GitHub2021-12-20 14:24:50 -0800
commitee6d40d414199f1b957499b4cc07d63e5c0b7ec5 (patch)
treec1c31b6a204407dd13de214c8781d9fde0930d1b /src/core/hle/kernel
parentMerge pull request #7603 from ameerj/here-we-go-again (diff)
parentcore: hle: Remove global HLE lock. (diff)
downloadyuzu-ee6d40d414199f1b957499b4cc07d63e5c0b7ec5.tar.gz
yuzu-ee6d40d414199f1b957499b4cc07d63e5c0b7ec5.tar.xz
yuzu-ee6d40d414199f1b957499b4cc07d63e5c0b7ec5.zip
Merge pull request #7597 from bunnei/remove-global-lock
core: hle: Remove global HLE lock.
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/k_process.cpp2
-rw-r--r--src/core/hle/kernel/svc.cpp9
2 files changed, 0 insertions, 11 deletions
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index 90dda40dc..aee313995 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -28,7 +28,6 @@
28#include "core/hle/kernel/k_thread.h" 28#include "core/hle/kernel/k_thread.h"
29#include "core/hle/kernel/kernel.h" 29#include "core/hle/kernel/kernel.h"
30#include "core/hle/kernel/svc_results.h" 30#include "core/hle/kernel/svc_results.h"
31#include "core/hle/lock.h"
32#include "core/memory.h" 31#include "core/memory.h"
33 32
34namespace Kernel { 33namespace Kernel {
@@ -543,7 +542,6 @@ void KProcess::FreeTLSRegion(VAddr tls_address) {
543} 542}
544 543
545void KProcess::LoadModule(CodeSet code_set, VAddr base_addr) { 544void KProcess::LoadModule(CodeSet code_set, VAddr base_addr) {
546 std::lock_guard lock{HLE::g_hle_lock};
547 const auto ReprotectSegment = [&](const CodeSet::Segment& segment, 545 const auto ReprotectSegment = [&](const CodeSet::Segment& segment,
548 KMemoryPermission permission) { 546 KMemoryPermission permission) {
549 page_table->SetProcessMemoryPermission(segment.addr + base_addr, segment.size, permission); 547 page_table->SetProcessMemoryPermission(segment.addr + base_addr, segment.size, permission);
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index a9f7438ea..bb9475c56 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -41,7 +41,6 @@
41#include "core/hle/kernel/svc_results.h" 41#include "core/hle/kernel/svc_results.h"
42#include "core/hle/kernel/svc_types.h" 42#include "core/hle/kernel/svc_types.h"
43#include "core/hle/kernel/svc_wrap.h" 43#include "core/hle/kernel/svc_wrap.h"
44#include "core/hle/lock.h"
45#include "core/hle/result.h" 44#include "core/hle/result.h"
46#include "core/memory.h" 45#include "core/memory.h"
47#include "core/reporter.h" 46#include "core/reporter.h"
@@ -137,7 +136,6 @@ enum class ResourceLimitValueType {
137 136
138/// Set the process heap to a given Size. It can both extend and shrink the heap. 137/// Set the process heap to a given Size. It can both extend and shrink the heap.
139static ResultCode SetHeapSize(Core::System& system, VAddr* heap_addr, u64 heap_size) { 138static ResultCode SetHeapSize(Core::System& system, VAddr* heap_addr, u64 heap_size) {
140 std::lock_guard lock{HLE::g_hle_lock};
141 LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size); 139 LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size);
142 140
143 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 8GB. 141 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 8GB.
@@ -168,7 +166,6 @@ static ResultCode SetHeapSize32(Core::System& system, u32* heap_addr, u32 heap_s
168 166
169static ResultCode SetMemoryAttribute(Core::System& system, VAddr address, u64 size, u32 mask, 167static ResultCode SetMemoryAttribute(Core::System& system, VAddr address, u64 size, u32 mask,
170 u32 attribute) { 168 u32 attribute) {
171 std::lock_guard lock{HLE::g_hle_lock};
172 LOG_DEBUG(Kernel_SVC, 169 LOG_DEBUG(Kernel_SVC,
173 "called, address=0x{:016X}, size=0x{:X}, mask=0x{:08X}, attribute=0x{:08X}", address, 170 "called, address=0x{:016X}, size=0x{:X}, mask=0x{:08X}, attribute=0x{:08X}", address,
174 size, mask, attribute); 171 size, mask, attribute);
@@ -212,7 +209,6 @@ static ResultCode SetMemoryAttribute32(Core::System& system, u32 address, u32 si
212 209
213/// Maps a memory range into a different range. 210/// Maps a memory range into a different range.
214static ResultCode MapMemory(Core::System& system, VAddr dst_addr, VAddr src_addr, u64 size) { 211static ResultCode MapMemory(Core::System& system, VAddr dst_addr, VAddr src_addr, u64 size) {
215 std::lock_guard lock{HLE::g_hle_lock};
216 LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, 212 LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
217 src_addr, size); 213 src_addr, size);
218 214
@@ -232,7 +228,6 @@ static ResultCode MapMemory32(Core::System& system, u32 dst_addr, u32 src_addr,
232 228
233/// Unmaps a region that was previously mapped with svcMapMemory 229/// Unmaps a region that was previously mapped with svcMapMemory
234static ResultCode UnmapMemory(Core::System& system, VAddr dst_addr, VAddr src_addr, u64 size) { 230static ResultCode UnmapMemory(Core::System& system, VAddr dst_addr, VAddr src_addr, u64 size) {
235 std::lock_guard lock{HLE::g_hle_lock};
236 LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr, 231 LOG_TRACE(Kernel_SVC, "called, dst_addr=0x{:X}, src_addr=0x{:X}, size=0x{:X}", dst_addr,
237 src_addr, size); 232 src_addr, size);
238 233
@@ -642,7 +637,6 @@ static void OutputDebugString(Core::System& system, VAddr address, u64 len) {
642/// Gets system/memory information for the current process 637/// Gets system/memory information for the current process
643static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle handle, 638static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle handle,
644 u64 info_sub_id) { 639 u64 info_sub_id) {
645 std::lock_guard lock{HLE::g_hle_lock};
646 LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id, 640 LOG_TRACE(Kernel_SVC, "called info_id=0x{:X}, info_sub_id=0x{:X}, handle=0x{:08X}", info_id,
647 info_sub_id, handle); 641 info_sub_id, handle);
648 642
@@ -924,7 +918,6 @@ static ResultCode GetInfo32(Core::System& system, u32* result_low, u32* result_h
924 918
925/// Maps memory at a desired address 919/// Maps memory at a desired address
926static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size) { 920static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size) {
927 std::lock_guard lock{HLE::g_hle_lock};
928 LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size); 921 LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size);
929 922
930 if (!Common::Is4KBAligned(addr)) { 923 if (!Common::Is4KBAligned(addr)) {
@@ -978,7 +971,6 @@ static ResultCode MapPhysicalMemory32(Core::System& system, u32 addr, u32 size)
978 971
979/// Unmaps memory previously mapped via MapPhysicalMemory 972/// Unmaps memory previously mapped via MapPhysicalMemory
980static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size) { 973static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size) {
981 std::lock_guard lock{HLE::g_hle_lock};
982 LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size); 974 LOG_DEBUG(Kernel_SVC, "called, addr=0x{:016X}, size=0x{:X}", addr, size);
983 975
984 if (!Common::Is4KBAligned(addr)) { 976 if (!Common::Is4KBAligned(addr)) {
@@ -1520,7 +1512,6 @@ static ResultCode ControlCodeMemory(Core::System& system, Handle code_memory_han
1520static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address, 1512static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address,
1521 VAddr page_info_address, Handle process_handle, 1513 VAddr page_info_address, Handle process_handle,
1522 VAddr address) { 1514 VAddr address) {
1523 std::lock_guard lock{HLE::g_hle_lock};
1524 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} address={:X}", process_handle, address); 1515 LOG_TRACE(Kernel_SVC, "called process=0x{:08X} address={:X}", process_handle, address);
1525 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 1516 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
1526 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle); 1517 KScopedAutoObject process = handle_table.GetObject<KProcess>(process_handle);