summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2023-02-13 11:21:43 -0500
committerGravatar Liam2023-02-13 19:03:12 -0500
commitceda2d280e8a3030c1e23083c5cea9158387fe4c (patch)
tree8041460840ed81d4cb74d87eecfb8fb720cdfa15 /src
parentkernel: use GetCurrentProcess (diff)
downloadyuzu-ceda2d280e8a3030c1e23083c5cea9158387fe4c.tar.gz
yuzu-ceda2d280e8a3030c1e23083c5cea9158387fe4c.tar.xz
yuzu-ceda2d280e8a3030c1e23083c5cea9158387fe4c.zip
general: rename CurrentProcess to ApplicationProcess
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/renderer/system.cpp2
-rw-r--r--src/audio_core/sink/sink_stream.cpp4
-rw-r--r--src/core/arm/arm_interface.cpp6
-rw-r--r--src/core/core.cpp42
-rw-r--r--src/core/core.h18
-rw-r--r--src/core/debugger/gdbstub.cpp28
-rw-r--r--src/core/file_sys/savedata_factory.cpp2
-rw-r--r--src/core/hle/ipc_helpers.h2
-rw-r--r--src/core/hle/kernel/k_client_port.cpp2
-rw-r--r--src/core/hle/kernel/k_handle_table.h3
-rw-r--r--src/core/hle/kernel/k_session.cpp2
-rw-r--r--src/core/hle/kernel/kernel.cpp46
-rw-r--r--src/core/hle/kernel/kernel.h24
-rw-r--r--src/core/hle/service/acc/acc.cpp4
-rw-r--r--src/core/hle/service/am/am.cpp22
-rw-r--r--src/core/hle/service/am/applets/applet_error.cpp2
-rw-r--r--src/core/hle/service/am/applets/applet_general_backend.cpp2
-rw-r--r--src/core/hle/service/am/applets/applet_web_browser.cpp2
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp6
-rw-r--r--src/core/hle/service/audio/audren_u.cpp2
-rw-r--r--src/core/hle/service/bcat/bcat_module.cpp10
-rw-r--r--src/core/hle/service/fatal/fatal.cpp2
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp4
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp5
-rw-r--r--src/core/hle/service/hid/hid.cpp8
-rw-r--r--src/core/hle/service/hid/hidbus.cpp4
-rw-r--r--src/core/hle/service/hid/irs.cpp8
-rw-r--r--src/core/hle/service/jit/jit.cpp4
-rw-r--r--src/core/hle/service/ldr/ldr.cpp13
-rw-r--r--src/core/hle/service/nfp/nfp_device.cpp2
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp4
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.cpp4
-rw-r--r--src/core/hle/service/pctl/pctl_module.cpp2
-rw-r--r--src/core/hle/service/prepo/prepo.cpp4
-rw-r--r--src/core/loader/nso.cpp2
-rw-r--r--src/core/memory.cpp10
-rw-r--r--src/core/memory/cheat_engine.cpp6
-rw-r--r--src/core/reporter.cpp10
-rw-r--r--src/yuzu/bootmanager.cpp2
-rw-r--r--src/yuzu/main.cpp6
-rw-r--r--src/yuzu_cmd/yuzu.cpp2
41 files changed, 169 insertions, 164 deletions
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp
index 4fac30c7c..31cbee282 100644
--- a/src/audio_core/renderer/system.cpp
+++ b/src/audio_core/renderer/system.cpp
@@ -127,7 +127,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
127 render_device = params.rendering_device; 127 render_device = params.rendering_device;
128 execution_mode = params.execution_mode; 128 execution_mode = params.execution_mode;
129 129
130 core.Memory().ZeroBlock(*core.Kernel().CurrentProcess(), transfer_memory->GetSourceAddress(), 130 core.Memory().ZeroBlock(*core.ApplicationProcess(), transfer_memory->GetSourceAddress(),
131 transfer_memory_size); 131 transfer_memory_size);
132 132
133 // Note: We're not actually using the transfer memory because it's a pain to code for. 133 // Note: We're not actually using the transfer memory because it's a pain to code for.
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp
index 06c2a876e..76889b375 100644
--- a/src/audio_core/sink/sink_stream.cpp
+++ b/src/audio_core/sink/sink_stream.cpp
@@ -270,7 +270,7 @@ void SinkStream::Stall() {
270 if (stalled_lock) { 270 if (stalled_lock) {
271 return; 271 return;
272 } 272 }
273 stalled_lock = system.StallProcesses(); 273 stalled_lock = system.StallApplication();
274} 274}
275 275
276void SinkStream::Unstall() { 276void SinkStream::Unstall() {
@@ -278,7 +278,7 @@ void SinkStream::Unstall() {
278 if (!stalled_lock) { 278 if (!stalled_lock) {
279 return; 279 return;
280 } 280 }
281 system.UnstallProcesses(); 281 system.UnstallApplication();
282 stalled_lock.unlock(); 282 stalled_lock.unlock();
283} 283}
284 284
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp
index 8aa7b9641..4a331d4c1 100644
--- a/src/core/arm/arm_interface.cpp
+++ b/src/core/arm/arm_interface.cpp
@@ -43,9 +43,9 @@ void ARM_Interface::SymbolicateBacktrace(Core::System& system, std::vector<Backt
43 43
44 std::map<std::string, Symbols::Symbols> symbols; 44 std::map<std::string, Symbols::Symbols> symbols;
45 for (const auto& module : modules) { 45 for (const auto& module : modules) {
46 symbols.insert_or_assign(module.second, 46 symbols.insert_or_assign(
47 Symbols::GetSymbols(module.first, system.Memory(), 47 module.second, Symbols::GetSymbols(module.first, system.Memory(),
48 system.CurrentProcess()->Is64BitProcess())); 48 system.ApplicationProcess()->Is64BitProcess()));
49 } 49 }
50 50
51 for (auto& entry : out) { 51 for (auto& entry : out) {
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 47292cd78..fb9b25d12 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -186,7 +186,7 @@ struct System::Impl {
186 void Run() { 186 void Run() {
187 std::unique_lock<std::mutex> lk(suspend_guard); 187 std::unique_lock<std::mutex> lk(suspend_guard);
188 188
189 kernel.Suspend(false); 189 kernel.SuspendApplication(false);
190 core_timing.SyncPause(false); 190 core_timing.SyncPause(false);
191 is_paused.store(false, std::memory_order_relaxed); 191 is_paused.store(false, std::memory_order_relaxed);
192 } 192 }
@@ -195,7 +195,7 @@ struct System::Impl {
195 std::unique_lock<std::mutex> lk(suspend_guard); 195 std::unique_lock<std::mutex> lk(suspend_guard);
196 196
197 core_timing.SyncPause(true); 197 core_timing.SyncPause(true);
198 kernel.Suspend(true); 198 kernel.SuspendApplication(true);
199 is_paused.store(true, std::memory_order_relaxed); 199 is_paused.store(true, std::memory_order_relaxed);
200 } 200 }
201 201
@@ -203,17 +203,17 @@ struct System::Impl {
203 return is_paused.load(std::memory_order_relaxed); 203 return is_paused.load(std::memory_order_relaxed);
204 } 204 }
205 205
206 std::unique_lock<std::mutex> StallProcesses() { 206 std::unique_lock<std::mutex> StallApplication() {
207 std::unique_lock<std::mutex> lk(suspend_guard); 207 std::unique_lock<std::mutex> lk(suspend_guard);
208 kernel.Suspend(true); 208 kernel.SuspendApplication(true);
209 core_timing.SyncPause(true); 209 core_timing.SyncPause(true);
210 return lk; 210 return lk;
211 } 211 }
212 212
213 void UnstallProcesses() { 213 void UnstallApplication() {
214 if (!IsPaused()) { 214 if (!IsPaused()) {
215 core_timing.SyncPause(false); 215 core_timing.SyncPause(false);
216 kernel.Suspend(false); 216 kernel.SuspendApplication(false);
217 } 217 }
218 } 218 }
219 219
@@ -221,7 +221,7 @@ struct System::Impl {
221 debugger = std::make_unique<Debugger>(system, port); 221 debugger = std::make_unique<Debugger>(system, port);
222 } 222 }
223 223
224 SystemResultStatus SetupForMainProcess(System& system, Frontend::EmuWindow& emu_window) { 224 SystemResultStatus SetupForApplicationProcess(System& system, Frontend::EmuWindow& emu_window) {
225 LOG_DEBUG(Core, "initialized OK"); 225 LOG_DEBUG(Core, "initialized OK");
226 226
227 // Setting changes may require a full system reinitialization (e.g., disabling multicore). 227 // Setting changes may require a full system reinitialization (e.g., disabling multicore).
@@ -273,7 +273,7 @@ struct System::Impl {
273 return SystemResultStatus::ErrorGetLoader; 273 return SystemResultStatus::ErrorGetLoader;
274 } 274 }
275 275
276 SystemResultStatus init_result{SetupForMainProcess(system, emu_window)}; 276 SystemResultStatus init_result{SetupForApplicationProcess(system, emu_window)};
277 if (init_result != SystemResultStatus::Success) { 277 if (init_result != SystemResultStatus::Success) {
278 LOG_CRITICAL(Core, "Failed to initialize system (Error {})!", 278 LOG_CRITICAL(Core, "Failed to initialize system (Error {})!",
279 static_cast<int>(init_result)); 279 static_cast<int>(init_result));
@@ -302,7 +302,7 @@ struct System::Impl {
302 static_cast<u32>(SystemResultStatus::ErrorLoader) + static_cast<u32>(load_result)); 302 static_cast<u32>(SystemResultStatus::ErrorLoader) + static_cast<u32>(load_result));
303 } 303 }
304 AddGlueRegistrationForProcess(*app_loader, *main_process); 304 AddGlueRegistrationForProcess(*app_loader, *main_process);
305 kernel.MakeCurrentProcess(main_process); 305 kernel.MakeApplicationProcess(main_process);
306 kernel.InitializeCores(); 306 kernel.InitializeCores();
307 307
308 // Initialize cheat engine 308 // Initialize cheat engine
@@ -585,12 +585,12 @@ void System::DetachDebugger() {
585 } 585 }
586} 586}
587 587
588std::unique_lock<std::mutex> System::StallProcesses() { 588std::unique_lock<std::mutex> System::StallApplication() {
589 return impl->StallProcesses(); 589 return impl->StallApplication();
590} 590}
591 591
592void System::UnstallProcesses() { 592void System::UnstallApplication() {
593 impl->UnstallProcesses(); 593 impl->UnstallApplication();
594} 594}
595 595
596void System::InitializeDebugger() { 596void System::InitializeDebugger() {
@@ -648,8 +648,8 @@ const Kernel::GlobalSchedulerContext& System::GlobalSchedulerContext() const {
648 return impl->kernel.GlobalSchedulerContext(); 648 return impl->kernel.GlobalSchedulerContext();
649} 649}
650 650
651Kernel::KProcess* System::CurrentProcess() { 651Kernel::KProcess* System::ApplicationProcess() {
652 return impl->kernel.CurrentProcess(); 652 return impl->kernel.ApplicationProcess();
653} 653}
654 654
655Core::DeviceMemory& System::DeviceMemory() { 655Core::DeviceMemory& System::DeviceMemory() {
@@ -660,8 +660,8 @@ const Core::DeviceMemory& System::DeviceMemory() const {
660 return *impl->device_memory; 660 return *impl->device_memory;
661} 661}
662 662
663const Kernel::KProcess* System::CurrentProcess() const { 663const Kernel::KProcess* System::ApplicationProcess() const {
664 return impl->kernel.CurrentProcess(); 664 return impl->kernel.ApplicationProcess();
665} 665}
666 666
667ARM_Interface& System::ArmInterface(std::size_t core_index) { 667ARM_Interface& System::ArmInterface(std::size_t core_index) {
@@ -760,8 +760,8 @@ const Core::SpeedLimiter& System::SpeedLimiter() const {
760 return impl->speed_limiter; 760 return impl->speed_limiter;
761} 761}
762 762
763u64 System::GetCurrentProcessProgramID() const { 763u64 System::GetApplicationProcessProgramID() const {
764 return impl->kernel.CurrentProcess()->GetProgramID(); 764 return impl->kernel.ApplicationProcess()->GetProgramID();
765} 765}
766 766
767Loader::ResultStatus System::GetGameName(std::string& out) const { 767Loader::ResultStatus System::GetGameName(std::string& out) const {
@@ -880,11 +880,11 @@ bool System::GetExitLock() const {
880 return impl->exit_lock; 880 return impl->exit_lock;
881} 881}
882 882
883void System::SetCurrentProcessBuildID(const CurrentBuildProcessID& id) { 883void System::SetApplicationProcessBuildID(const CurrentBuildProcessID& id) {
884 impl->build_id = id; 884 impl->build_id = id;
885} 885}
886 886
887const System::CurrentBuildProcessID& System::GetCurrentProcessBuildID() const { 887const System::CurrentBuildProcessID& System::GetApplicationProcessBuildID() const {
888 return impl->build_id; 888 return impl->build_id;
889} 889}
890 890
diff --git a/src/core/core.h b/src/core/core.h
index fb5cda2f5..0042ac170 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -184,8 +184,8 @@ public:
184 /// Forcibly detach the debugger if it is running. 184 /// Forcibly detach the debugger if it is running.
185 void DetachDebugger(); 185 void DetachDebugger();
186 186
187 std::unique_lock<std::mutex> StallProcesses(); 187 std::unique_lock<std::mutex> StallApplication();
188 void UnstallProcesses(); 188 void UnstallApplication();
189 189
190 /** 190 /**
191 * Initialize the debugger. 191 * Initialize the debugger.
@@ -295,11 +295,11 @@ public:
295 /// Gets the manager for the guest device memory 295 /// Gets the manager for the guest device memory
296 [[nodiscard]] const Core::DeviceMemory& DeviceMemory() const; 296 [[nodiscard]] const Core::DeviceMemory& DeviceMemory() const;
297 297
298 /// Provides a pointer to the current process 298 /// Provides a pointer to the application process
299 [[nodiscard]] Kernel::KProcess* CurrentProcess(); 299 [[nodiscard]] Kernel::KProcess* ApplicationProcess();
300 300
301 /// Provides a constant pointer to the current process. 301 /// Provides a constant pointer to the application process.
302 [[nodiscard]] const Kernel::KProcess* CurrentProcess() const; 302 [[nodiscard]] const Kernel::KProcess* ApplicationProcess() const;
303 303
304 /// Provides a reference to the core timing instance. 304 /// Provides a reference to the core timing instance.
305 [[nodiscard]] Timing::CoreTiming& CoreTiming(); 305 [[nodiscard]] Timing::CoreTiming& CoreTiming();
@@ -331,7 +331,7 @@ public:
331 /// Provides a constant reference to the speed limiter 331 /// Provides a constant reference to the speed limiter
332 [[nodiscard]] const Core::SpeedLimiter& SpeedLimiter() const; 332 [[nodiscard]] const Core::SpeedLimiter& SpeedLimiter() const;
333 333
334 [[nodiscard]] u64 GetCurrentProcessProgramID() const; 334 [[nodiscard]] u64 GetApplicationProcessProgramID() const;
335 335
336 /// Gets the name of the current game 336 /// Gets the name of the current game
337 [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const; 337 [[nodiscard]] Loader::ResultStatus GetGameName(std::string& out) const;
@@ -396,8 +396,8 @@ public:
396 void SetExitLock(bool locked); 396 void SetExitLock(bool locked);
397 [[nodiscard]] bool GetExitLock() const; 397 [[nodiscard]] bool GetExitLock() const;
398 398
399 void SetCurrentProcessBuildID(const CurrentBuildProcessID& id); 399 void SetApplicationProcessBuildID(const CurrentBuildProcessID& id);
400 [[nodiscard]] const CurrentBuildProcessID& GetCurrentProcessBuildID() const; 400 [[nodiscard]] const CurrentBuildProcessID& GetApplicationProcessBuildID() const;
401 401
402 /// Register a host thread as an emulated CPU Core. 402 /// Register a host thread as an emulated CPU Core.
403 void RegisterCoreThread(std::size_t id); 403 void RegisterCoreThread(std::size_t id);
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
index 9c02b7b31..945ec528e 100644
--- a/src/core/debugger/gdbstub.cpp
+++ b/src/core/debugger/gdbstub.cpp
@@ -96,7 +96,7 @@ static std::string EscapeXML(std::string_view data) {
96 96
97GDBStub::GDBStub(DebuggerBackend& backend_, Core::System& system_) 97GDBStub::GDBStub(DebuggerBackend& backend_, Core::System& system_)
98 : DebuggerFrontend(backend_), system{system_} { 98 : DebuggerFrontend(backend_), system{system_} {
99 if (system.CurrentProcess()->Is64BitProcess()) { 99 if (system.ApplicationProcess()->Is64BitProcess()) {
100 arch = std::make_unique<GDBStubA64>(); 100 arch = std::make_unique<GDBStubA64>();
101 } else { 101 } else {
102 arch = std::make_unique<GDBStubA32>(); 102 arch = std::make_unique<GDBStubA32>();
@@ -340,15 +340,15 @@ void GDBStub::HandleBreakpointInsert(std::string_view command) {
340 success = true; 340 success = true;
341 break; 341 break;
342 case BreakpointType::WriteWatch: 342 case BreakpointType::WriteWatch:
343 success = system.CurrentProcess()->InsertWatchpoint(system, addr, size, 343 success = system.ApplicationProcess()->InsertWatchpoint(system, addr, size,
344 Kernel::DebugWatchpointType::Write); 344 Kernel::DebugWatchpointType::Write);
345 break; 345 break;
346 case BreakpointType::ReadWatch: 346 case BreakpointType::ReadWatch:
347 success = system.CurrentProcess()->InsertWatchpoint(system, addr, size, 347 success = system.ApplicationProcess()->InsertWatchpoint(system, addr, size,
348 Kernel::DebugWatchpointType::Read); 348 Kernel::DebugWatchpointType::Read);
349 break; 349 break;
350 case BreakpointType::AccessWatch: 350 case BreakpointType::AccessWatch:
351 success = system.CurrentProcess()->InsertWatchpoint( 351 success = system.ApplicationProcess()->InsertWatchpoint(
352 system, addr, size, Kernel::DebugWatchpointType::ReadOrWrite); 352 system, addr, size, Kernel::DebugWatchpointType::ReadOrWrite);
353 break; 353 break;
354 case BreakpointType::Hardware: 354 case BreakpointType::Hardware:
@@ -391,15 +391,15 @@ void GDBStub::HandleBreakpointRemove(std::string_view command) {
391 break; 391 break;
392 } 392 }
393 case BreakpointType::WriteWatch: 393 case BreakpointType::WriteWatch:
394 success = system.CurrentProcess()->RemoveWatchpoint(system, addr, size, 394 success = system.ApplicationProcess()->RemoveWatchpoint(system, addr, size,
395 Kernel::DebugWatchpointType::Write); 395 Kernel::DebugWatchpointType::Write);
396 break; 396 break;
397 case BreakpointType::ReadWatch: 397 case BreakpointType::ReadWatch:
398 success = system.CurrentProcess()->RemoveWatchpoint(system, addr, size, 398 success = system.ApplicationProcess()->RemoveWatchpoint(system, addr, size,
399 Kernel::DebugWatchpointType::Read); 399 Kernel::DebugWatchpointType::Read);
400 break; 400 break;
401 case BreakpointType::AccessWatch: 401 case BreakpointType::AccessWatch:
402 success = system.CurrentProcess()->RemoveWatchpoint( 402 success = system.ApplicationProcess()->RemoveWatchpoint(
403 system, addr, size, Kernel::DebugWatchpointType::ReadOrWrite); 403 system, addr, size, Kernel::DebugWatchpointType::ReadOrWrite);
404 break; 404 break;
405 case BreakpointType::Hardware: 405 case BreakpointType::Hardware:
@@ -482,7 +482,7 @@ static std::optional<std::string> GetNameFromThreadType64(Core::Memory::Memory&
482 482
483static std::optional<std::string> GetThreadName(Core::System& system, 483static std::optional<std::string> GetThreadName(Core::System& system,
484 const Kernel::KThread* thread) { 484 const Kernel::KThread* thread) {
485 if (system.CurrentProcess()->Is64BitProcess()) { 485 if (system.ApplicationProcess()->Is64BitProcess()) {
486 return GetNameFromThreadType64(system.Memory(), thread); 486 return GetNameFromThreadType64(system.Memory(), thread);
487 } else { 487 } else {
488 return GetNameFromThreadType32(system.Memory(), thread); 488 return GetNameFromThreadType32(system.Memory(), thread);
@@ -555,7 +555,7 @@ void GDBStub::HandleQuery(std::string_view command) {
555 SendReply(fmt::format("TextSeg={:x}", main->first)); 555 SendReply(fmt::format("TextSeg={:x}", main->first));
556 } else { 556 } else {
557 SendReply(fmt::format("TextSeg={:x}", 557 SendReply(fmt::format("TextSeg={:x}",
558 system.CurrentProcess()->PageTable().GetCodeRegionStart())); 558 system.ApplicationProcess()->PageTable().GetCodeRegionStart()));
559 } 559 }
560 } else if (command.starts_with("Xfer:libraries:read::")) { 560 } else if (command.starts_with("Xfer:libraries:read::")) {
561 Loader::AppLoader::Modules modules; 561 Loader::AppLoader::Modules modules;
@@ -729,7 +729,7 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) {
729 std::string_view command_str{reinterpret_cast<const char*>(&command[0]), command.size()}; 729 std::string_view command_str{reinterpret_cast<const char*>(&command[0]), command.size()};
730 std::string reply; 730 std::string reply;
731 731
732 auto* process = system.CurrentProcess(); 732 auto* process = system.ApplicationProcess();
733 auto& page_table = process->PageTable(); 733 auto& page_table = process->PageTable();
734 734
735 const char* commands = "Commands:\n" 735 const char* commands = "Commands:\n"
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index 1567da231..769065b6f 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -172,7 +172,7 @@ std::string SaveDataFactory::GetFullPath(Core::System& system, VirtualDir dir,
172 // be interpreted as the title id of the current process. 172 // be interpreted as the title id of the current process.
173 if (type == SaveDataType::SaveData || type == SaveDataType::DeviceSaveData) { 173 if (type == SaveDataType::SaveData || type == SaveDataType::DeviceSaveData) {
174 if (title_id == 0) { 174 if (title_id == 0) {
175 title_id = system.GetCurrentProcessProgramID(); 175 title_id = system.GetApplicationProcessProgramID();
176 } 176 }
177 } 177 }
178 178
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index a86bec252..38d6cfaff 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -148,7 +148,7 @@ public:
148 if (context->GetManager()->IsDomain()) { 148 if (context->GetManager()->IsDomain()) {
149 context->AddDomainObject(std::move(iface)); 149 context->AddDomainObject(std::move(iface));
150 } else { 150 } else {
151 kernel.CurrentProcess()->GetResourceLimit()->Reserve( 151 kernel.ApplicationProcess()->GetResourceLimit()->Reserve(
152 Kernel::LimitableResource::SessionCountMax, 1); 152 Kernel::LimitableResource::SessionCountMax, 1);
153 153
154 auto* session = Kernel::KSession::Create(kernel); 154 auto* session = Kernel::KSession::Create(kernel);
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp
index 9a540987b..c72a91a76 100644
--- a/src/core/hle/kernel/k_client_port.cpp
+++ b/src/core/hle/kernel/k_client_port.cpp
@@ -61,7 +61,7 @@ bool KClientPort::IsSignaled() const {
61Result KClientPort::CreateSession(KClientSession** out) { 61Result KClientPort::CreateSession(KClientSession** out) {
62 // Reserve a new session from the resource limit. 62 // Reserve a new session from the resource limit.
63 //! FIXME: we are reserving this from the wrong resource limit! 63 //! FIXME: we are reserving this from the wrong resource limit!
64 KScopedResourceReservation session_reservation(kernel.CurrentProcess()->GetResourceLimit(), 64 KScopedResourceReservation session_reservation(kernel.ApplicationProcess()->GetResourceLimit(),
65 LimitableResource::SessionCountMax); 65 LimitableResource::SessionCountMax);
66 R_UNLESS(session_reservation.Succeeded(), ResultLimitReached); 66 R_UNLESS(session_reservation.Succeeded(), ResultLimitReached);
67 67
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h
index 1bf68e6b0..d7660630c 100644
--- a/src/core/hle/kernel/k_handle_table.h
+++ b/src/core/hle/kernel/k_handle_table.h
@@ -90,7 +90,8 @@ public:
90 // Handle pseudo-handles. 90 // Handle pseudo-handles.
91 if constexpr (std::derived_from<KProcess, T>) { 91 if constexpr (std::derived_from<KProcess, T>) {
92 if (handle == Svc::PseudoHandle::CurrentProcess) { 92 if (handle == Svc::PseudoHandle::CurrentProcess) {
93 auto* const cur_process = GetCurrentProcessPointer(m_kernel); 93 //! FIXME: this is the wrong process!
94 auto* const cur_process = m_kernel.ApplicationProcess();
94 ASSERT(cur_process != nullptr); 95 ASSERT(cur_process != nullptr);
95 return cur_process; 96 return cur_process;
96 } 97 }
diff --git a/src/core/hle/kernel/k_session.cpp b/src/core/hle/kernel/k_session.cpp
index 819f39f12..7e677c028 100644
--- a/src/core/hle/kernel/k_session.cpp
+++ b/src/core/hle/kernel/k_session.cpp
@@ -34,7 +34,7 @@ void KSession::Initialize(KClientPort* port_, const std::string& name_) {
34 34
35 // Set our owner process. 35 // Set our owner process.
36 //! FIXME: this is the wrong process! 36 //! FIXME: this is the wrong process!
37 process = kernel.CurrentProcess(); 37 process = kernel.ApplicationProcess();
38 process->Open(); 38 process->Open();
39 39
40 // Set our port. 40 // Set our port.
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 5b72eaaa1..b1922659d 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -102,13 +102,13 @@ struct KernelCore::Impl {
102 102
103 void InitializeCores() { 103 void InitializeCores() {
104 for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { 104 for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
105 cores[core_id]->Initialize((*current_process).Is64BitProcess()); 105 cores[core_id]->Initialize((*application_process).Is64BitProcess());
106 system.Memory().SetCurrentPageTable(*current_process, core_id); 106 system.Memory().SetCurrentPageTable(*application_process, core_id);
107 } 107 }
108 } 108 }
109 109
110 void CloseCurrentProcess() { 110 void CloseApplicationProcess() {
111 KProcess* old_process = current_process.exchange(nullptr); 111 KProcess* old_process = application_process.exchange(nullptr);
112 if (old_process == nullptr) { 112 if (old_process == nullptr) {
113 return; 113 return;
114 } 114 }
@@ -182,7 +182,7 @@ struct KernelCore::Impl {
182 } 182 }
183 } 183 }
184 184
185 CloseCurrentProcess(); 185 CloseApplicationProcess();
186 186
187 // Track kernel objects that were not freed on shutdown 187 // Track kernel objects that were not freed on shutdown
188 { 188 {
@@ -363,8 +363,8 @@ struct KernelCore::Impl {
363 } 363 }
364 } 364 }
365 365
366 void MakeCurrentProcess(KProcess* process) { 366 void MakeApplicationProcess(KProcess* process) {
367 current_process = process; 367 application_process = process;
368 } 368 }
369 369
370 static inline thread_local u32 host_thread_id = UINT32_MAX; 370 static inline thread_local u32 host_thread_id = UINT32_MAX;
@@ -821,7 +821,7 @@ struct KernelCore::Impl {
821 821
822 // Lists all processes that exist in the current session. 822 // Lists all processes that exist in the current session.
823 std::vector<KProcess*> process_list; 823 std::vector<KProcess*> process_list;
824 std::atomic<KProcess*> current_process{}; 824 std::atomic<KProcess*> application_process{};
825 std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; 825 std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context;
826 std::unique_ptr<Kernel::KHardwareTimer> hardware_timer; 826 std::unique_ptr<Kernel::KHardwareTimer> hardware_timer;
827 827
@@ -941,20 +941,20 @@ void KernelCore::AppendNewProcess(KProcess* process) {
941 impl->process_list.push_back(process); 941 impl->process_list.push_back(process);
942} 942}
943 943
944void KernelCore::MakeCurrentProcess(KProcess* process) { 944void KernelCore::MakeApplicationProcess(KProcess* process) {
945 impl->MakeCurrentProcess(process); 945 impl->MakeApplicationProcess(process);
946} 946}
947 947
948KProcess* KernelCore::CurrentProcess() { 948KProcess* KernelCore::ApplicationProcess() {
949 return impl->current_process; 949 return impl->application_process;
950} 950}
951 951
952const KProcess* KernelCore::CurrentProcess() const { 952const KProcess* KernelCore::ApplicationProcess() const {
953 return impl->current_process; 953 return impl->application_process;
954} 954}
955 955
956void KernelCore::CloseCurrentProcess() { 956void KernelCore::CloseApplicationProcess() {
957 impl->CloseCurrentProcess(); 957 impl->CloseApplicationProcess();
958} 958}
959 959
960const std::vector<KProcess*>& KernelCore::GetProcessList() const { 960const std::vector<KProcess*>& KernelCore::GetProcessList() const {
@@ -1202,12 +1202,12 @@ const Kernel::KSharedMemory& KernelCore::GetHidBusSharedMem() const {
1202 return *impl->hidbus_shared_mem; 1202 return *impl->hidbus_shared_mem;
1203} 1203}
1204 1204
1205void KernelCore::Suspend(bool suspended) { 1205void KernelCore::SuspendApplication(bool suspended) {
1206 const bool should_suspend{exception_exited || suspended}; 1206 const bool should_suspend{exception_exited || suspended};
1207 const auto activity = should_suspend ? ProcessActivity::Paused : ProcessActivity::Runnable; 1207 const auto activity = should_suspend ? ProcessActivity::Paused : ProcessActivity::Runnable;
1208 1208
1209 //! This refers to the application process, not the current process. 1209 // Get the application process.
1210 KScopedAutoObject<KProcess> process = CurrentProcess(); 1210 KScopedAutoObject<KProcess> process = ApplicationProcess();
1211 if (process.IsNull()) { 1211 if (process.IsNull()) {
1212 return; 1212 return;
1213 } 1213 }
@@ -1218,8 +1218,8 @@ void KernelCore::Suspend(bool suspended) {
1218 // Wait for process execution to stop. 1218 // Wait for process execution to stop.
1219 bool must_wait{should_suspend}; 1219 bool must_wait{should_suspend};
1220 1220
1221 // KernelCore::Suspend must be called from locked context, or we 1221 // KernelCore::SuspendApplication must be called from locked context,
1222 // could race another call to SetActivity, interfering with waiting. 1222 // or we could race another call to SetActivity, interfering with waiting.
1223 while (must_wait) { 1223 while (must_wait) {
1224 KScopedSchedulerLock sl{*this}; 1224 KScopedSchedulerLock sl{*this};
1225 1225
@@ -1253,9 +1253,9 @@ bool KernelCore::IsShuttingDown() const {
1253 return impl->IsShuttingDown(); 1253 return impl->IsShuttingDown();
1254} 1254}
1255 1255
1256void KernelCore::ExceptionalExit() { 1256void KernelCore::ExceptionalExitApplication() {
1257 exception_exited = true; 1257 exception_exited = true;
1258 Suspend(true); 1258 SuspendApplication(true);
1259} 1259}
1260 1260
1261void KernelCore::EnterSVCProfile() { 1261void KernelCore::EnterSVCProfile() {
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index af0ae0e98..a236e6b42 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -131,17 +131,17 @@ public:
131 /// Adds the given shared pointer to an internal list of active processes. 131 /// Adds the given shared pointer to an internal list of active processes.
132 void AppendNewProcess(KProcess* process); 132 void AppendNewProcess(KProcess* process);
133 133
134 /// Makes the given process the new current process. 134 /// Makes the given process the new application process.
135 void MakeCurrentProcess(KProcess* process); 135 void MakeApplicationProcess(KProcess* process);
136 136
137 /// Retrieves a pointer to the current process. 137 /// Retrieves a pointer to the application process.
138 KProcess* CurrentProcess(); 138 KProcess* ApplicationProcess();
139 139
140 /// Retrieves a const pointer to the current process. 140 /// Retrieves a const pointer to the application process.
141 const KProcess* CurrentProcess() const; 141 const KProcess* ApplicationProcess() const;
142 142
143 /// Closes the current process. 143 /// Closes the application process.
144 void CloseCurrentProcess(); 144 void CloseApplicationProcess();
145 145
146 /// Retrieves the list of processes. 146 /// Retrieves the list of processes.
147 const std::vector<KProcess*>& GetProcessList() const; 147 const std::vector<KProcess*>& GetProcessList() const;
@@ -288,11 +288,11 @@ public:
288 /// Gets the shared memory object for HIDBus services. 288 /// Gets the shared memory object for HIDBus services.
289 const Kernel::KSharedMemory& GetHidBusSharedMem() const; 289 const Kernel::KSharedMemory& GetHidBusSharedMem() const;
290 290
291 /// Suspend/unsuspend all processes. 291 /// Suspend/unsuspend application process.
292 void Suspend(bool suspend); 292 void SuspendApplication(bool suspend);
293 293
294 /// Exceptional exit all processes. 294 /// Exceptional exit application process.
295 void ExceptionalExit(); 295 void ExceptionalExitApplication();
296 296
297 /// Notify emulated CPU cores to shut down. 297 /// Notify emulated CPU cores to shut down.
298 void ShutdownCores(); 298 void ShutdownCores();
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 6d1084fd1..1495d64de 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -762,7 +762,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
762 // processes emulated. As we don't actually have pid support we should assume we're just using 762 // processes emulated. As we don't actually have pid support we should assume we're just using
763 // our own process 763 // our own process
764 const auto launch_property = 764 const auto launch_property =
765 system.GetARPManager().GetLaunchProperty(system.GetCurrentProcessProgramID()); 765 system.GetARPManager().GetLaunchProperty(system.GetApplicationProcessProgramID());
766 766
767 if (launch_property.Failed()) { 767 if (launch_property.Failed()) {
768 LOG_ERROR(Service_ACC, "Failed to get launch property"); 768 LOG_ERROR(Service_ACC, "Failed to get launch property");
@@ -806,7 +806,7 @@ void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx
806 bool is_locked = false; 806 bool is_locked = false;
807 807
808 if (res != Loader::ResultStatus::Success) { 808 if (res != Loader::ResultStatus::Success) {
809 const FileSys::PatchManager pm{system.GetCurrentProcessProgramID(), 809 const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(),
810 system.GetFileSystemController(), 810 system.GetFileSystemController(),
811 system.GetContentProvider()}; 811 system.GetContentProvider()};
812 const auto nacp_unique = pm.GetControlMetadata().first; 812 const auto nacp_unique = pm.GetControlMetadata().first;
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index ebcf6e164..615dd65f3 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -79,7 +79,7 @@ IWindowController::IWindowController(Core::System& system_)
79IWindowController::~IWindowController() = default; 79IWindowController::~IWindowController() = default;
80 80
81void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx) { 81void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx) {
82 const u64 process_id = system.CurrentProcess()->GetProcessID(); 82 const u64 process_id = system.ApplicationProcess()->GetProcessID();
83 83
84 LOG_DEBUG(Service_AM, "called. Process ID=0x{:016X}", process_id); 84 LOG_DEBUG(Service_AM, "called. Process ID=0x{:016X}", process_id);
85 85
@@ -1252,7 +1252,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
1252 } 1252 }
1253 1253
1254 auto transfer_mem = 1254 auto transfer_mem =
1255 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle); 1255 system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle);
1256 1256
1257 if (transfer_mem.IsNull()) { 1257 if (transfer_mem.IsNull()) {
1258 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); 1258 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle);
@@ -1286,7 +1286,7 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
1286 } 1286 }
1287 1287
1288 auto transfer_mem = 1288 auto transfer_mem =
1289 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle); 1289 system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(handle);
1290 1290
1291 if (transfer_mem.IsNull()) { 1291 if (transfer_mem.IsNull()) {
1292 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); 1292 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle);
@@ -1465,11 +1465,12 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
1465 const auto backend = BCAT::CreateBackendFromSettings(system, [this](u64 tid) { 1465 const auto backend = BCAT::CreateBackendFromSettings(system, [this](u64 tid) {
1466 return system.GetFileSystemController().GetBCATDirectory(tid); 1466 return system.GetFileSystemController().GetBCATDirectory(tid);
1467 }); 1467 });
1468 const auto build_id_full = system.GetCurrentProcessBuildID(); 1468 const auto build_id_full = system.GetApplicationProcessBuildID();
1469 u64 build_id{}; 1469 u64 build_id{};
1470 std::memcpy(&build_id, build_id_full.data(), sizeof(u64)); 1470 std::memcpy(&build_id, build_id_full.data(), sizeof(u64));
1471 1471
1472 auto data = backend->GetLaunchParameter({system.GetCurrentProcessProgramID(), build_id}); 1472 auto data =
1473 backend->GetLaunchParameter({system.GetApplicationProcessProgramID(), build_id});
1473 if (data.has_value()) { 1474 if (data.has_value()) {
1474 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1475 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1475 rb.Push(ResultSuccess); 1476 rb.Push(ResultSuccess);
@@ -1521,7 +1522,7 @@ void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
1521 LOG_DEBUG(Service_AM, "called, uid={:016X}{:016X}", user_id[1], user_id[0]); 1522 LOG_DEBUG(Service_AM, "called, uid={:016X}{:016X}", user_id[1], user_id[0]);
1522 1523
1523 FileSys::SaveDataAttribute attribute{}; 1524 FileSys::SaveDataAttribute attribute{};
1524 attribute.title_id = system.GetCurrentProcessProgramID(); 1525 attribute.title_id = system.GetApplicationProcessProgramID();
1525 attribute.user_id = user_id; 1526 attribute.user_id = user_id;
1526 attribute.type = FileSys::SaveDataType::SaveData; 1527 attribute.type = FileSys::SaveDataType::SaveData;
1527 const auto res = system.GetFileSystemController().CreateSaveData( 1528 const auto res = system.GetFileSystemController().CreateSaveData(
@@ -1551,7 +1552,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
1551 std::array<u8, 0x10> version_string{}; 1552 std::array<u8, 0x10> version_string{};
1552 1553
1553 const auto res = [this] { 1554 const auto res = [this] {
1554 const auto title_id = system.GetCurrentProcessProgramID(); 1555 const auto title_id = system.GetApplicationProcessProgramID();
1555 1556
1556 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(), 1557 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
1557 system.GetContentProvider()}; 1558 system.GetContentProvider()};
@@ -1588,7 +1589,7 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
1588 u32 supported_languages = 0; 1589 u32 supported_languages = 0;
1589 1590
1590 const auto res = [this] { 1591 const auto res = [this] {
1591 const auto title_id = system.GetCurrentProcessProgramID(); 1592 const auto title_id = system.GetApplicationProcessProgramID();
1592 1593
1593 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(), 1594 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
1594 system.GetContentProvider()}; 1595 system.GetContentProvider()};
@@ -1696,7 +1697,8 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
1696 static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size); 1697 static_cast<u8>(type), user_id[1], user_id[0], new_normal_size, new_journal_size);
1697 1698
1698 system.GetFileSystemController().WriteSaveDataSize( 1699 system.GetFileSystemController().WriteSaveDataSize(
1699 type, system.GetCurrentProcessProgramID(), user_id, {new_normal_size, new_journal_size}); 1700 type, system.GetApplicationProcessProgramID(), user_id,
1701 {new_normal_size, new_journal_size});
1700 1702
1701 IPC::ResponseBuilder rb{ctx, 4}; 1703 IPC::ResponseBuilder rb{ctx, 4};
1702 rb.Push(ResultSuccess); 1704 rb.Push(ResultSuccess);
@@ -1720,7 +1722,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
1720 user_id[0]); 1722 user_id[0]);
1721 1723
1722 const auto size = system.GetFileSystemController().ReadSaveDataSize( 1724 const auto size = system.GetFileSystemController().ReadSaveDataSize(
1723 type, system.GetCurrentProcessProgramID(), user_id); 1725 type, system.GetApplicationProcessProgramID(), user_id);
1724 1726
1725 IPC::ResponseBuilder rb{ctx, 6}; 1727 IPC::ResponseBuilder rb{ctx, 6};
1726 rb.Push(ResultSuccess); 1728 rb.Push(ResultSuccess);
diff --git a/src/core/hle/service/am/applets/applet_error.cpp b/src/core/hle/service/am/applets/applet_error.cpp
index bae0d99a6..b013896b4 100644
--- a/src/core/hle/service/am/applets/applet_error.cpp
+++ b/src/core/hle/service/am/applets/applet_error.cpp
@@ -166,7 +166,7 @@ void Error::Execute() {
166 } 166 }
167 167
168 const auto callback = [this] { DisplayCompleted(); }; 168 const auto callback = [this] { DisplayCompleted(); };
169 const auto title_id = system.GetCurrentProcessProgramID(); 169 const auto title_id = system.GetApplicationProcessProgramID();
170 const auto& reporter{system.GetReporter()}; 170 const auto& reporter{system.GetReporter()};
171 171
172 switch (mode) { 172 switch (mode) {
diff --git a/src/core/hle/service/am/applets/applet_general_backend.cpp b/src/core/hle/service/am/applets/applet_general_backend.cpp
index e50acdaf6..1eefa85e3 100644
--- a/src/core/hle/service/am/applets/applet_general_backend.cpp
+++ b/src/core/hle/service/am/applets/applet_general_backend.cpp
@@ -186,7 +186,7 @@ void PhotoViewer::Execute() {
186 const auto callback = [this] { ViewFinished(); }; 186 const auto callback = [this] { ViewFinished(); };
187 switch (mode) { 187 switch (mode) {
188 case PhotoViewerAppletMode::CurrentApp: 188 case PhotoViewerAppletMode::CurrentApp:
189 frontend.ShowPhotosForApplication(system.GetCurrentProcessProgramID(), callback); 189 frontend.ShowPhotosForApplication(system.GetApplicationProcessProgramID(), callback);
190 break; 190 break;
191 case PhotoViewerAppletMode::AllApps: 191 case PhotoViewerAppletMode::AllApps:
192 frontend.ShowAllPhotos(callback); 192 frontend.ShowAllPhotos(callback);
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp
index 14aa6f69e..f061bae80 100644
--- a/src/core/hle/service/am/applets/applet_web_browser.cpp
+++ b/src/core/hle/service/am/applets/applet_web_browser.cpp
@@ -393,7 +393,7 @@ void WebBrowser::InitializeOffline() {
393 switch (document_kind) { 393 switch (document_kind) {
394 case DocumentKind::OfflineHtmlPage: 394 case DocumentKind::OfflineHtmlPage:
395 default: 395 default:
396 title_id = system.GetCurrentProcessProgramID(); 396 title_id = system.GetApplicationProcessProgramID();
397 nca_type = FileSys::ContentRecordType::HtmlDocument; 397 nca_type = FileSys::ContentRecordType::HtmlDocument;
398 additional_paths = "html-document"; 398 additional_paths = "html-document";
399 break; 399 break;
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index 368ccd52f..7264f23f9 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -155,7 +155,7 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
155 IPC::ResponseBuilder rb{ctx, 3}; 155 IPC::ResponseBuilder rb{ctx, 3};
156 rb.Push(ResultSuccess); 156 rb.Push(ResultSuccess);
157 157
158 const auto current = system.GetCurrentProcessProgramID(); 158 const auto current = system.GetApplicationProcessProgramID();
159 159
160 const auto& disabled = Settings::values.disabled_addons[current]; 160 const auto& disabled = Settings::values.disabled_addons[current];
161 if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) { 161 if (std::find(disabled.begin(), disabled.end(), "DLC") != disabled.end()) {
@@ -182,7 +182,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
182 LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count, 182 LOG_DEBUG(Service_AOC, "called with offset={}, count={}, process_id={}", offset, count,
183 process_id); 183 process_id);
184 184
185 const auto current = system.GetCurrentProcessProgramID(); 185 const auto current = system.GetApplicationProcessProgramID();
186 186
187 std::vector<u32> out; 187 std::vector<u32> out;
188 const auto& disabled = Settings::values.disabled_addons[current]; 188 const auto& disabled = Settings::values.disabled_addons[current];
@@ -228,7 +228,7 @@ void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
228 IPC::ResponseBuilder rb{ctx, 4}; 228 IPC::ResponseBuilder rb{ctx, 4};
229 rb.Push(ResultSuccess); 229 rb.Push(ResultSuccess);
230 230
231 const auto title_id = system.GetCurrentProcessProgramID(); 231 const auto title_id = system.GetApplicationProcessProgramID();
232 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(), 232 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
233 system.GetContentProvider()}; 233 system.GetContentProvider()};
234 234
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index 0ee28752c..7d730421d 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -455,7 +455,7 @@ void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
455 return; 455 return;
456 } 456 }
457 457
458 const auto& handle_table{system.CurrentProcess()->GetHandleTable()}; 458 const auto& handle_table{system.ApplicationProcess()->GetHandleTable()};
459 auto process{handle_table.GetObject<Kernel::KProcess>(process_handle)}; 459 auto process{handle_table.GetObject<Kernel::KProcess>(process_handle)};
460 auto transfer_memory{ 460 auto transfer_memory{
461 process->GetHandleTable().GetObject<Kernel::KTransferMemory>(transfer_memory_handle)}; 461 process->GetHandleTable().GetObject<Kernel::KTransferMemory>(transfer_memory_handle)};
diff --git a/src/core/hle/service/bcat/bcat_module.cpp b/src/core/hle/service/bcat/bcat_module.cpp
index cbe690a5d..6e6fed227 100644
--- a/src/core/hle/service/bcat/bcat_module.cpp
+++ b/src/core/hle/service/bcat/bcat_module.cpp
@@ -176,8 +176,8 @@ private:
176 void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) { 176 void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) {
177 LOG_DEBUG(Service_BCAT, "called"); 177 LOG_DEBUG(Service_BCAT, "called");
178 178
179 backend.Synchronize({system.GetCurrentProcessProgramID(), 179 backend.Synchronize({system.GetApplicationProcessProgramID(),
180 GetCurrentBuildID(system.GetCurrentProcessBuildID())}, 180 GetCurrentBuildID(system.GetApplicationProcessBuildID())},
181 GetProgressBackend(SyncType::Normal)); 181 GetProgressBackend(SyncType::Normal));
182 182
183 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 183 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -193,8 +193,8 @@ private:
193 193
194 LOG_DEBUG(Service_BCAT, "called, name={}", name); 194 LOG_DEBUG(Service_BCAT, "called, name={}", name);
195 195
196 backend.SynchronizeDirectory({system.GetCurrentProcessProgramID(), 196 backend.SynchronizeDirectory({system.GetApplicationProcessProgramID(),
197 GetCurrentBuildID(system.GetCurrentProcessBuildID())}, 197 GetCurrentBuildID(system.GetApplicationProcessBuildID())},
198 name, GetProgressBackend(SyncType::Directory)); 198 name, GetProgressBackend(SyncType::Directory));
199 199
200 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 200 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -554,7 +554,7 @@ private:
554void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) { 554void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) {
555 LOG_DEBUG(Service_BCAT, "called"); 555 LOG_DEBUG(Service_BCAT, "called");
556 556
557 const auto title_id = system.GetCurrentProcessProgramID(); 557 const auto title_id = system.GetApplicationProcessProgramID();
558 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 558 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
559 rb.Push(ResultSuccess); 559 rb.Push(ResultSuccess);
560 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id)); 560 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id));
diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp
index 27675615b..2e5919330 100644
--- a/src/core/hle/service/fatal/fatal.cpp
+++ b/src/core/hle/service/fatal/fatal.cpp
@@ -63,7 +63,7 @@ enum class FatalType : u32 {
63}; 63};
64 64
65static void GenerateErrorReport(Core::System& system, Result error_code, const FatalInfo& info) { 65static void GenerateErrorReport(Core::System& system, Result error_code, const FatalInfo& info) {
66 const auto title_id = system.GetCurrentProcessProgramID(); 66 const auto title_id = system.GetApplicationProcessProgramID();
67 std::string crash_report = fmt::format( 67 std::string crash_report = fmt::format(
68 "Yuzu {}-{} crash report\n" 68 "Yuzu {}-{} crash report\n"
69 "Title ID: {:016x}\n" 69 "Title ID: {:016x}\n"
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 11c604a0f..177447bc1 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -317,7 +317,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess()
317 return ResultUnknown; 317 return ResultUnknown;
318 } 318 }
319 319
320 return romfs_factory->OpenCurrentProcess(system.GetCurrentProcessProgramID()); 320 return romfs_factory->OpenCurrentProcess(system.GetApplicationProcessProgramID());
321} 321}
322 322
323ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS( 323ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS(
@@ -502,7 +502,7 @@ FileSys::SaveDataSize FileSystemController::ReadSaveDataSize(FileSys::SaveDataTy
502 const auto res = system.GetAppLoader().ReadControlData(nacp); 502 const auto res = system.GetAppLoader().ReadControlData(nacp);
503 503
504 if (res != Loader::ResultStatus::Success) { 504 if (res != Loader::ResultStatus::Success) {
505 const FileSys::PatchManager pm{system.GetCurrentProcessProgramID(), 505 const FileSys::PatchManager pm{system.GetApplicationProcessProgramID(),
506 system.GetFileSystemController(), 506 system.GetFileSystemController(),
507 system.GetContentProvider()}; 507 system.GetContentProvider()};
508 const auto metadata = pm.GetControlMetadata(); 508 const auto metadata = pm.GetControlMetadata();
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 447d624e1..e76346ca9 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -1036,8 +1036,9 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
1036 1036
1037 LOG_DEBUG(Service_FS, "called, program_index={}", program_index); 1037 LOG_DEBUG(Service_FS, "called, program_index={}", program_index);
1038 1038
1039 auto patched_romfs = fsc.OpenPatchedRomFSWithProgramIndex( 1039 auto patched_romfs =
1040 system.GetCurrentProcessProgramID(), program_index, FileSys::ContentRecordType::Program); 1040 fsc.OpenPatchedRomFSWithProgramIndex(system.GetApplicationProcessProgramID(), program_index,
1041 FileSys::ContentRecordType::Program);
1041 1042
1042 if (patched_romfs.Failed()) { 1043 if (patched_romfs.Failed()) {
1043 // TODO: Find the right error code to use here 1044 // TODO: Find the right error code to use here
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 5a1aa0903..b0d06ee55 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -1830,7 +1830,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1830 ASSERT_MSG(t_mem_1_size == 0x1000, "t_mem_1_size is not 0x1000 bytes"); 1830 ASSERT_MSG(t_mem_1_size == 0x1000, "t_mem_1_size is not 0x1000 bytes");
1831 ASSERT_MSG(t_mem_2_size == 0x7F000, "t_mem_2_size is not 0x7F000 bytes"); 1831 ASSERT_MSG(t_mem_2_size == 0x7F000, "t_mem_2_size is not 0x7F000 bytes");
1832 1832
1833 auto t_mem_1 = system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>( 1833 auto t_mem_1 = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
1834 t_mem_1_handle); 1834 t_mem_1_handle);
1835 1835
1836 if (t_mem_1.IsNull()) { 1836 if (t_mem_1.IsNull()) {
@@ -1840,7 +1840,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1840 return; 1840 return;
1841 } 1841 }
1842 1842
1843 auto t_mem_2 = system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>( 1843 auto t_mem_2 = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
1844 t_mem_2_handle); 1844 t_mem_2_handle);
1845 1845
1846 if (t_mem_2.IsNull()) { 1846 if (t_mem_2.IsNull()) {
@@ -2127,8 +2127,8 @@ void Hid::WritePalmaWaveEntry(Kernel::HLERequestContext& ctx) {
2127 2127
2128 ASSERT_MSG(t_mem_size == 0x3000, "t_mem_size is not 0x3000 bytes"); 2128 ASSERT_MSG(t_mem_size == 0x3000, "t_mem_size is not 0x3000 bytes");
2129 2129
2130 auto t_mem = 2130 auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
2131 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(t_mem_handle); 2131 t_mem_handle);
2132 2132
2133 if (t_mem.IsNull()) { 2133 if (t_mem.IsNull()) {
2134 LOG_ERROR(Service_HID, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle); 2134 LOG_ERROR(Service_HID, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle);
diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp
index 17252a84a..bd94e8f3d 100644
--- a/src/core/hle/service/hid/hidbus.cpp
+++ b/src/core/hle/service/hid/hidbus.cpp
@@ -449,8 +449,8 @@ void HidBus::EnableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) {
449 449
450 ASSERT_MSG(t_mem_size == 0x1000, "t_mem_size is not 0x1000 bytes"); 450 ASSERT_MSG(t_mem_size == 0x1000, "t_mem_size is not 0x1000 bytes");
451 451
452 auto t_mem = 452 auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
453 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(t_mem_handle); 453 t_mem_handle);
454 454
455 if (t_mem.IsNull()) { 455 if (t_mem.IsNull()) {
456 LOG_ERROR(Service_HID, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle); 456 LOG_ERROR(Service_HID, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle);
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index 52f402c56..3bd418e92 100644
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -196,8 +196,8 @@ void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
196 const auto parameters{rp.PopRaw<Parameters>()}; 196 const auto parameters{rp.PopRaw<Parameters>()};
197 const auto t_mem_handle{ctx.GetCopyHandle(0)}; 197 const auto t_mem_handle{ctx.GetCopyHandle(0)};
198 198
199 auto t_mem = 199 auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
200 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(t_mem_handle); 200 t_mem_handle);
201 201
202 if (t_mem.IsNull()) { 202 if (t_mem.IsNull()) {
203 LOG_ERROR(Service_IRS, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle); 203 LOG_ERROR(Service_IRS, "t_mem is a nullptr for handle=0x{:08X}", t_mem_handle);
@@ -445,8 +445,8 @@ void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
445 const auto parameters{rp.PopRaw<Parameters>()}; 445 const auto parameters{rp.PopRaw<Parameters>()};
446 const auto t_mem_handle{ctx.GetCopyHandle(0)}; 446 const auto t_mem_handle{ctx.GetCopyHandle(0)};
447 447
448 auto t_mem = 448 auto t_mem = system.ApplicationProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(
449 system.CurrentProcess()->GetHandleTable().GetObject<Kernel::KTransferMemory>(t_mem_handle); 449 t_mem_handle);
450 450
451 u8* transfer_memory = system.Memory().GetPointer(t_mem->GetSourceAddress()); 451 u8* transfer_memory = system.Memory().GetPointer(t_mem->GetSourceAddress());
452 452
diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp
index 1295a44c7..47a1277ea 100644
--- a/src/core/hle/service/jit/jit.cpp
+++ b/src/core/hle/service/jit/jit.cpp
@@ -353,9 +353,9 @@ public:
353 return; 353 return;
354 } 354 }
355 355
356 // Fetch using the handle table for the current process here, 356 // Fetch using the handle table for the application process here,
357 // since we are not multiprocess yet. 357 // since we are not multiprocess yet.
358 const auto& handle_table{system.CurrentProcess()->GetHandleTable()}; 358 const auto& handle_table{system.ApplicationProcess()->GetHandleTable()};
359 359
360 auto process{handle_table.GetObject<Kernel::KProcess>(process_handle)}; 360 auto process{handle_table.GetObject<Kernel::KProcess>(process_handle)};
361 if (process.IsNull()) { 361 if (process.IsNull()) {
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 652441bc2..2d4d6fe3e 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -246,7 +246,7 @@ public:
246 return; 246 return;
247 } 247 }
248 248
249 if (system.GetCurrentProcessProgramID() != header.application_id) { 249 if (system.GetApplicationProcessProgramID() != header.application_id) {
250 LOG_ERROR(Service_LDR, 250 LOG_ERROR(Service_LDR,
251 "Attempting to load NRR with title ID other than current process. (actual " 251 "Attempting to load NRR with title ID other than current process. (actual "
252 "{:016X})!", 252 "{:016X})!",
@@ -542,15 +542,16 @@ public:
542 } 542 }
543 543
544 // Map memory for the NRO 544 // Map memory for the NRO
545 const auto map_result{MapNro(system.CurrentProcess(), nro_address, nro_size, bss_address, 545 const auto map_result{MapNro(system.ApplicationProcess(), nro_address, nro_size,
546 bss_size, nro_size + bss_size)}; 546 bss_address, bss_size, nro_size + bss_size)};
547 if (map_result.Failed()) { 547 if (map_result.Failed()) {
548 IPC::ResponseBuilder rb{ctx, 2}; 548 IPC::ResponseBuilder rb{ctx, 2};
549 rb.Push(map_result.Code()); 549 rb.Push(map_result.Code());
550 } 550 }
551 551
552 // Load the NRO into the mapped memory 552 // Load the NRO into the mapped memory
553 if (const auto result{LoadNro(system.CurrentProcess(), header, nro_address, *map_result)}; 553 if (const auto result{
554 LoadNro(system.ApplicationProcess(), header, nro_address, *map_result)};
554 result.IsError()) { 555 result.IsError()) {
555 IPC::ResponseBuilder rb{ctx, 2}; 556 IPC::ResponseBuilder rb{ctx, 2};
556 rb.Push(map_result.Code()); 557 rb.Push(map_result.Code());
@@ -570,7 +571,7 @@ public:
570 571
571 Result UnmapNro(const NROInfo& info) { 572 Result UnmapNro(const NROInfo& info) {
572 // Each region must be unmapped separately to validate memory state 573 // Each region must be unmapped separately to validate memory state
573 auto& page_table{system.CurrentProcess()->PageTable()}; 574 auto& page_table{system.ApplicationProcess()->PageTable()};
574 575
575 if (info.bss_size != 0) { 576 if (info.bss_size != 0) {
576 CASCADE_CODE(page_table.UnmapCodeMemory( 577 CASCADE_CODE(page_table.UnmapCodeMemory(
@@ -641,7 +642,7 @@ public:
641 LOG_WARNING(Service_LDR, "(STUBBED) called"); 642 LOG_WARNING(Service_LDR, "(STUBBED) called");
642 643
643 initialized = true; 644 initialized = true;
644 current_map_addr = system.CurrentProcess()->PageTable().GetAliasCodeRegionStart(); 645 current_map_addr = system.ApplicationProcess()->PageTable().GetAliasCodeRegionStart();
645 646
646 IPC::ResponseBuilder rb{ctx, 2}; 647 IPC::ResponseBuilder rb{ctx, 2};
647 rb.Push(ResultSuccess); 648 rb.Push(ResultSuccess);
diff --git a/src/core/hle/service/nfp/nfp_device.cpp b/src/core/hle/service/nfp/nfp_device.cpp
index e67a76f55..7a6bbbba7 100644
--- a/src/core/hle/service/nfp/nfp_device.cpp
+++ b/src/core/hle/service/nfp/nfp_device.cpp
@@ -618,7 +618,7 @@ Result NfpDevice::RecreateApplicationArea(u32 access_id, std::span<const u8> dat
618 sizeof(ApplicationArea) - data.size()); 618 sizeof(ApplicationArea) - data.size());
619 619
620 // TODO: Investigate why the title id needs to be moddified 620 // TODO: Investigate why the title id needs to be moddified
621 tag_data.title_id = system.GetCurrentProcessProgramID(); 621 tag_data.title_id = system.GetApplicationProcessProgramID();
622 tag_data.title_id = tag_data.title_id | 0x30000000ULL; 622 tag_data.title_id = tag_data.title_id | 0x30000000ULL;
623 tag_data.settings.settings.appdata_initialized.Assign(1); 623 tag_data.settings.settings.appdata_initialized.Assign(1);
624 tag_data.application_area_id = access_id; 624 tag_data.application_area_id = access_id;
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
index 0cdde82a7..e12025560 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl.cpp
@@ -150,9 +150,9 @@ NvResult nvhost_ctrl::IocCtrlEventWait(std::span<const u8> input, std::vector<u8
150 const auto check_failing = [&]() { 150 const auto check_failing = [&]() {
151 if (events[slot].fails > 2) { 151 if (events[slot].fails > 2) {
152 { 152 {
153 auto lk = system.StallProcesses(); 153 auto lk = system.StallApplication();
154 host1x_syncpoint_manager.WaitHost(fence_id, target_value); 154 host1x_syncpoint_manager.WaitHost(fence_id, target_value);
155 system.UnstallProcesses(); 155 system.UnstallApplication();
156 } 156 }
157 params.value.raw = target_value; 157 params.value.raw = target_value;
158 return true; 158 return true;
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp
index 29c1e0f01..277afe0b4 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp
@@ -127,7 +127,7 @@ NvResult nvmap::IocAlloc(std::span<const u8> input, std::vector<u8>& output) {
127 return result; 127 return result;
128 } 128 }
129 bool is_out_io{}; 129 bool is_out_io{};
130 ASSERT(system.CurrentProcess() 130 ASSERT(system.ApplicationProcess()
131 ->PageTable() 131 ->PageTable()
132 .LockForMapDeviceAddressSpace(&is_out_io, handle_description->address, 132 .LockForMapDeviceAddressSpace(&is_out_io, handle_description->address,
133 handle_description->size, 133 handle_description->size,
@@ -254,7 +254,7 @@ NvResult nvmap::IocFree(std::span<const u8> input, std::vector<u8>& output) {
254 254
255 if (auto freeInfo{file.FreeHandle(params.handle, false)}) { 255 if (auto freeInfo{file.FreeHandle(params.handle, false)}) {
256 if (freeInfo->can_unlock) { 256 if (freeInfo->can_unlock) {
257 ASSERT(system.CurrentProcess() 257 ASSERT(system.ApplicationProcess()
258 ->PageTable() 258 ->PageTable()
259 .UnlockForDeviceAddressSpace(freeInfo->address, freeInfo->size) 259 .UnlockForDeviceAddressSpace(freeInfo->address, freeInfo->size)
260 .IsSuccess()); 260 .IsSuccess());
diff --git a/src/core/hle/service/pctl/pctl_module.cpp b/src/core/hle/service/pctl/pctl_module.cpp
index 2a123b42d..083609b34 100644
--- a/src/core/hle/service/pctl/pctl_module.cpp
+++ b/src/core/hle/service/pctl/pctl_module.cpp
@@ -187,7 +187,7 @@ private:
187 187
188 // TODO(ogniK): Recovery flag initialization for pctl:r 188 // TODO(ogniK): Recovery flag initialization for pctl:r
189 189
190 const auto tid = system.GetCurrentProcessProgramID(); 190 const auto tid = system.GetApplicationProcessProgramID();
191 if (tid != 0) { 191 if (tid != 0) {
192 const FileSys::PatchManager pm{tid, system.GetFileSystemController(), 192 const FileSys::PatchManager pm{tid, system.GetFileSystemController(),
193 system.GetContentProvider()}; 193 system.GetContentProvider()};
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp
index 01040b32a..90c5f8756 100644
--- a/src/core/hle/service/prepo/prepo.cpp
+++ b/src/core/hle/service/prepo/prepo.cpp
@@ -71,7 +71,7 @@ private:
71 Type, process_id, data1.size(), data2.size()); 71 Type, process_id, data1.size(), data2.size());
72 72
73 const auto& reporter{system.GetReporter()}; 73 const auto& reporter{system.GetReporter()};
74 reporter.SavePlayReport(Type, system.GetCurrentProcessProgramID(), {data1, data2}, 74 reporter.SavePlayReport(Type, system.GetApplicationProcessProgramID(), {data1, data2},
75 process_id); 75 process_id);
76 76
77 IPC::ResponseBuilder rb{ctx, 2}; 77 IPC::ResponseBuilder rb{ctx, 2};
@@ -99,7 +99,7 @@ private:
99 Type, user_id[1], user_id[0], process_id, data1.size(), data2.size()); 99 Type, user_id[1], user_id[0], process_id, data1.size(), data2.size());
100 100
101 const auto& reporter{system.GetReporter()}; 101 const auto& reporter{system.GetReporter()};
102 reporter.SavePlayReport(Type, system.GetCurrentProcessProgramID(), {data1, data2}, 102 reporter.SavePlayReport(Type, system.GetApplicationProcessProgramID(), {data1, data2},
103 process_id, user_id); 103 process_id, user_id);
104 104
105 IPC::ResponseBuilder rb{ctx, 2}; 105 IPC::ResponseBuilder rb{ctx, 2};
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index 4c3b3c655..a5c384fb5 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -145,7 +145,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core::
145 145
146 // Apply cheats if they exist and the program has a valid title ID 146 // Apply cheats if they exist and the program has a valid title ID
147 if (pm) { 147 if (pm) {
148 system.SetCurrentProcessBuildID(nso_header.build_id); 148 system.SetApplicationProcessBuildID(nso_header.build_id);
149 const auto cheats = pm->CreateCheatList(nso_header.build_id); 149 const auto cheats = pm->CreateCheatList(nso_header.build_id);
150 if (!cheats.empty()) { 150 if (!cheats.empty()) {
151 system.RegisterCheatList(cheats, nso_header.build_id, load_base, image_size); 151 system.RegisterCheatList(cheats, nso_header.build_id, load_base, image_size);
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index af9660b55..4397fcfb1 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -247,11 +247,11 @@ struct Memory::Impl {
247 } 247 }
248 248
249 void ReadBlock(const VAddr src_addr, void* dest_buffer, const std::size_t size) { 249 void ReadBlock(const VAddr src_addr, void* dest_buffer, const std::size_t size) {
250 ReadBlockImpl<false>(*system.CurrentProcess(), src_addr, dest_buffer, size); 250 ReadBlockImpl<false>(*system.ApplicationProcess(), src_addr, dest_buffer, size);
251 } 251 }
252 252
253 void ReadBlockUnsafe(const VAddr src_addr, void* dest_buffer, const std::size_t size) { 253 void ReadBlockUnsafe(const VAddr src_addr, void* dest_buffer, const std::size_t size) {
254 ReadBlockImpl<true>(*system.CurrentProcess(), src_addr, dest_buffer, size); 254 ReadBlockImpl<true>(*system.ApplicationProcess(), src_addr, dest_buffer, size);
255 } 255 }
256 256
257 template <bool UNSAFE> 257 template <bool UNSAFE>
@@ -279,11 +279,11 @@ struct Memory::Impl {
279 } 279 }
280 280
281 void WriteBlock(const VAddr dest_addr, const void* src_buffer, const std::size_t size) { 281 void WriteBlock(const VAddr dest_addr, const void* src_buffer, const std::size_t size) {
282 WriteBlockImpl<false>(*system.CurrentProcess(), dest_addr, src_buffer, size); 282 WriteBlockImpl<false>(*system.ApplicationProcess(), dest_addr, src_buffer, size);
283 } 283 }
284 284
285 void WriteBlockUnsafe(const VAddr dest_addr, const void* src_buffer, const std::size_t size) { 285 void WriteBlockUnsafe(const VAddr dest_addr, const void* src_buffer, const std::size_t size) {
286 WriteBlockImpl<true>(*system.CurrentProcess(), dest_addr, src_buffer, size); 286 WriteBlockImpl<true>(*system.ApplicationProcess(), dest_addr, src_buffer, size);
287 } 287 }
288 288
289 void ZeroBlock(const Kernel::KProcess& process, const VAddr dest_addr, const std::size_t size) { 289 void ZeroBlock(const Kernel::KProcess& process, const VAddr dest_addr, const std::size_t size) {
@@ -711,7 +711,7 @@ void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
711} 711}
712 712
713bool Memory::IsValidVirtualAddress(const VAddr vaddr) const { 713bool Memory::IsValidVirtualAddress(const VAddr vaddr) const {
714 const Kernel::KProcess& process = *system.CurrentProcess(); 714 const Kernel::KProcess& process = *system.ApplicationProcess();
715 const auto& page_table = process.PageTable().PageTableImpl(); 715 const auto& page_table = process.PageTable().PageTableImpl();
716 const size_t page = vaddr >> YUZU_PAGEBITS; 716 const size_t page = vaddr >> YUZU_PAGEBITS;
717 if (page >= page_table.pointers.size()) { 717 if (page >= page_table.pointers.size()) {
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp
index ffdbacc18..44ee39648 100644
--- a/src/core/memory/cheat_engine.cpp
+++ b/src/core/memory/cheat_engine.cpp
@@ -191,10 +191,10 @@ void CheatEngine::Initialize() {
191 }); 191 });
192 core_timing.ScheduleLoopingEvent(CHEAT_ENGINE_NS, CHEAT_ENGINE_NS, event); 192 core_timing.ScheduleLoopingEvent(CHEAT_ENGINE_NS, CHEAT_ENGINE_NS, event);
193 193
194 metadata.process_id = system.CurrentProcess()->GetProcessID(); 194 metadata.process_id = system.ApplicationProcess()->GetProcessID();
195 metadata.title_id = system.GetCurrentProcessProgramID(); 195 metadata.title_id = system.GetApplicationProcessProgramID();
196 196
197 const auto& page_table = system.CurrentProcess()->PageTable(); 197 const auto& page_table = system.ApplicationProcess()->PageTable();
198 metadata.heap_extents = { 198 metadata.heap_extents = {
199 .base = page_table.GetHeapRegionStart(), 199 .base = page_table.GetHeapRegionStart(),
200 .size = page_table.GetHeapRegionSize(), 200 .size = page_table.GetHeapRegionSize(),
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp
index 59dfb8767..708ae17aa 100644
--- a/src/core/reporter.cpp
+++ b/src/core/reporter.cpp
@@ -110,7 +110,7 @@ json GetProcessorStateData(const std::string& architecture, u64 entry_point, u64
110} 110}
111 111
112json GetProcessorStateDataAuto(Core::System& system) { 112json GetProcessorStateDataAuto(Core::System& system) {
113 const auto* process{system.CurrentProcess()}; 113 const auto* process{system.ApplicationProcess()};
114 auto& arm{system.CurrentArmInterface()}; 114 auto& arm{system.CurrentArmInterface()};
115 115
116 Core::ARM_Interface::ThreadContext64 context{}; 116 Core::ARM_Interface::ThreadContext64 context{};
@@ -234,7 +234,7 @@ void Reporter::SaveSvcBreakReport(u32 type, bool signal_debugger, u64 info1, u64
234 } 234 }
235 235
236 const auto timestamp = GetTimestamp(); 236 const auto timestamp = GetTimestamp();
237 const auto title_id = system.GetCurrentProcessProgramID(); 237 const auto title_id = system.GetApplicationProcessProgramID();
238 auto out = GetFullDataAuto(timestamp, title_id, system); 238 auto out = GetFullDataAuto(timestamp, title_id, system);
239 239
240 auto break_out = json{ 240 auto break_out = json{
@@ -261,7 +261,7 @@ void Reporter::SaveUnimplementedFunctionReport(Kernel::HLERequestContext& ctx, u
261 } 261 }
262 262
263 const auto timestamp = GetTimestamp(); 263 const auto timestamp = GetTimestamp();
264 const auto title_id = system.GetCurrentProcessProgramID(); 264 const auto title_id = system.GetApplicationProcessProgramID();
265 auto out = GetFullDataAuto(timestamp, title_id, system); 265 auto out = GetFullDataAuto(timestamp, title_id, system);
266 266
267 auto function_out = GetHLERequestContextData(ctx, system.Memory()); 267 auto function_out = GetHLERequestContextData(ctx, system.Memory());
@@ -283,7 +283,7 @@ void Reporter::SaveUnimplementedAppletReport(
283 } 283 }
284 284
285 const auto timestamp = GetTimestamp(); 285 const auto timestamp = GetTimestamp();
286 const auto title_id = system.GetCurrentProcessProgramID(); 286 const auto title_id = system.GetApplicationProcessProgramID();
287 auto out = GetFullDataAuto(timestamp, title_id, system); 287 auto out = GetFullDataAuto(timestamp, title_id, system);
288 288
289 out["applet_common_args"] = { 289 out["applet_common_args"] = {
@@ -376,7 +376,7 @@ void Reporter::SaveUserReport() const {
376 } 376 }
377 377
378 const auto timestamp = GetTimestamp(); 378 const auto timestamp = GetTimestamp();
379 const auto title_id = system.GetCurrentProcessProgramID(); 379 const auto title_id = system.GetApplicationProcessProgramID();
380 380
381 SaveToFile(GetFullDataAuto(timestamp, title_id, system), 381 SaveToFile(GetFullDataAuto(timestamp, title_id, system),
382 GetPath("user_report", title_id, timestamp)); 382 GetPath("user_report", title_id, timestamp));
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index d65991734..352300e88 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -67,7 +67,7 @@ void EmuThread::run() {
67 emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0); 67 emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
68 if (Settings::values.use_disk_shader_cache.GetValue()) { 68 if (Settings::values.use_disk_shader_cache.GetValue()) {
69 m_system.Renderer().ReadRasterizer()->LoadDiskResources( 69 m_system.Renderer().ReadRasterizer()->LoadDiskResources(
70 m_system.GetCurrentProcessProgramID(), stop_token, 70 m_system.GetApplicationProcessProgramID(), stop_token,
71 [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) { 71 [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
72 emit LoadProgress(stage, value, total); 72 emit LoadProgress(stage, value, total);
73 }); 73 });
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index c278d8dab..94ae441e5 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1779,7 +1779,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
1779 std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())} 1779 std::filesystem::path{Common::U16StringFromBuffer(filename.utf16(), filename.size())}
1780 .filename()); 1780 .filename());
1781 } 1781 }
1782 const bool is_64bit = system->Kernel().CurrentProcess()->Is64BitProcess(); 1782 const bool is_64bit = system->Kernel().ApplicationProcess()->Is64BitProcess();
1783 const auto instruction_set_suffix = is_64bit ? tr("(64-bit)") : tr("(32-bit)"); 1783 const auto instruction_set_suffix = is_64bit ? tr("(64-bit)") : tr("(32-bit)");
1784 title_name = tr("%1 %2", "%1 is the title name. %2 indicates if the title is 64-bit or 32-bit") 1784 title_name = tr("%1 %2", "%1 is the title name. %2 indicates if the title is 64-bit or 32-bit")
1785 .arg(QString::fromStdString(title_name), instruction_set_suffix) 1785 .arg(QString::fromStdString(title_name), instruction_set_suffix)
@@ -3532,7 +3532,7 @@ void GMainWindow::OnToggleGraphicsAPI() {
3532} 3532}
3533 3533
3534void GMainWindow::OnConfigurePerGame() { 3534void GMainWindow::OnConfigurePerGame() {
3535 const u64 title_id = system->GetCurrentProcessProgramID(); 3535 const u64 title_id = system->GetApplicationProcessProgramID();
3536 OpenPerGameConfiguration(title_id, current_game_path.toStdString()); 3536 OpenPerGameConfiguration(title_id, current_game_path.toStdString());
3537} 3537}
3538 3538
@@ -3691,7 +3691,7 @@ void GMainWindow::OnCaptureScreenshot() {
3691 return; 3691 return;
3692 } 3692 }
3693 3693
3694 const u64 title_id = system->GetCurrentProcessProgramID(); 3694 const u64 title_id = system->GetApplicationProcessProgramID();
3695 const auto screenshot_path = 3695 const auto screenshot_path =
3696 QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)); 3696 QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir));
3697 const auto date = 3697 const auto date =
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index d1f7b1d49..77edd58ca 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -405,7 +405,7 @@ int main(int argc, char** argv) {
405 405
406 if (Settings::values.use_disk_shader_cache.GetValue()) { 406 if (Settings::values.use_disk_shader_cache.GetValue()) {
407 system.Renderer().ReadRasterizer()->LoadDiskResources( 407 system.Renderer().ReadRasterizer()->LoadDiskResources(
408 system.GetCurrentProcessProgramID(), std::stop_token{}, 408 system.GetApplicationProcessProgramID(), std::stop_token{},
409 [](VideoCore::LoadCallbackStage, size_t value, size_t total) {}); 409 [](VideoCore::LoadCallbackStage, size_t value, size_t total) {});
410 } 410 }
411 411