summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar Narr the Reg2022-11-20 09:31:20 -0600
committerGravatar GitHub2022-11-20 09:31:20 -0600
commitdb7bcd51ae09c4ef25e08096de563903f61e2380 (patch)
tree5ae9977b48e1aff118fae3ebffb215b0b4afa887 /src/core/hle/kernel/svc.cpp
parentservice: nfc: Implement nfc user (diff)
parentMerge pull request #9238 from german77/cabinet_applet (diff)
downloadyuzu-db7bcd51ae09c4ef25e08096de563903f61e2380.tar.gz
yuzu-db7bcd51ae09c4ef25e08096de563903f61e2380.tar.xz
yuzu-db7bcd51ae09c4ef25e08096de563903f61e2380.zip
Merge branch 'master' into nfc_impl
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 9962ad171..e520cab47 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -2701,14 +2701,24 @@ static Result GetThreadList(Core::System& system, u32* out_num_threads, VAddr ou
2701 return ResultSuccess; 2701 return ResultSuccess;
2702} 2702}
2703 2703
2704static Result FlushProcessDataCache32([[maybe_unused]] Core::System& system, 2704static Result FlushProcessDataCache32(Core::System& system, Handle process_handle, u64 address,
2705 [[maybe_unused]] Handle handle, [[maybe_unused]] u32 address, 2705 u64 size) {
2706 [[maybe_unused]] u32 size) { 2706 // Validate address/size.
2707 // Note(Blinkhawk): For emulation purposes of the data cache this is mostly a no-op, 2707 R_UNLESS(size > 0, ResultInvalidSize);
2708 // as all emulation is done in the same cache level in host architecture, thus data cache 2708 R_UNLESS(address == static_cast<uintptr_t>(address), ResultInvalidCurrentMemory);
2709 // does not need flushing. 2709 R_UNLESS(size == static_cast<size_t>(size), ResultInvalidCurrentMemory);
2710 LOG_DEBUG(Kernel_SVC, "called"); 2710
2711 return ResultSuccess; 2711 // Get the process from its handle.
2712 KScopedAutoObject process =
2713 system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KProcess>(process_handle);
2714 R_UNLESS(process.IsNotNull(), ResultInvalidHandle);
2715
2716 // Verify the region is within range.
2717 auto& page_table = process->PageTable();
2718 R_UNLESS(page_table.Contains(address, size), ResultInvalidCurrentMemory);
2719
2720 // Perform the operation.
2721 R_RETURN(system.Memory().FlushDataCache(*process, address, size));
2712} 2722}
2713 2723
2714namespace { 2724namespace {