summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp25
-rw-r--r--src/core/core.h7
-rw-r--r--src/core/hle/service/am/am.cpp8
3 files changed, 29 insertions, 11 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 2f67e60a9..e95ae80da 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -273,7 +273,8 @@ struct System::Impl {
273 time_manager.Initialize(); 273 time_manager.Initialize();
274 274
275 is_powered_on = true; 275 is_powered_on = true;
276 exit_lock = false; 276 exit_locked = false;
277 exit_requested = false;
277 278
278 microprofile_cpu[0] = MICROPROFILE_TOKEN(ARM_CPU0); 279 microprofile_cpu[0] = MICROPROFILE_TOKEN(ARM_CPU0);
279 microprofile_cpu[1] = MICROPROFILE_TOKEN(ARM_CPU1); 280 microprofile_cpu[1] = MICROPROFILE_TOKEN(ARM_CPU1);
@@ -398,7 +399,8 @@ struct System::Impl {
398 } 399 }
399 400
400 is_powered_on = false; 401 is_powered_on = false;
401 exit_lock = false; 402 exit_locked = false;
403 exit_requested = false;
402 404
403 if (gpu_core != nullptr) { 405 if (gpu_core != nullptr) {
404 gpu_core->NotifyShutdown(); 406 gpu_core->NotifyShutdown();
@@ -507,7 +509,8 @@ struct System::Impl {
507 509
508 CpuManager cpu_manager; 510 CpuManager cpu_manager;
509 std::atomic_bool is_powered_on{}; 511 std::atomic_bool is_powered_on{};
510 bool exit_lock = false; 512 bool exit_locked = false;
513 bool exit_requested = false;
511 514
512 bool nvdec_active{}; 515 bool nvdec_active{};
513 516
@@ -943,12 +946,20 @@ const Service::Time::TimeManager& System::GetTimeManager() const {
943 return impl->time_manager; 946 return impl->time_manager;
944} 947}
945 948
946void System::SetExitLock(bool locked) { 949void System::SetExitLocked(bool locked) {
947 impl->exit_lock = locked; 950 impl->exit_locked = locked;
948} 951}
949 952
950bool System::GetExitLock() const { 953bool System::GetExitLocked() const {
951 return impl->exit_lock; 954 return impl->exit_locked;
955}
956
957void System::SetExitRequested(bool requested) {
958 impl->exit_requested = requested;
959}
960
961bool System::GetExitRequested() const {
962 return impl->exit_requested;
952} 963}
953 964
954void System::SetApplicationProcessBuildID(const CurrentBuildProcessID& id) { 965void System::SetApplicationProcessBuildID(const CurrentBuildProcessID& id) {
diff --git a/src/core/core.h b/src/core/core.h
index c70ea1965..a9ff9315e 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -412,8 +412,11 @@ public:
412 /// Gets an immutable reference to the Room Network. 412 /// Gets an immutable reference to the Room Network.
413 [[nodiscard]] const Network::RoomNetwork& GetRoomNetwork() const; 413 [[nodiscard]] const Network::RoomNetwork& GetRoomNetwork() const;
414 414
415 void SetExitLock(bool locked); 415 void SetExitLocked(bool locked);
416 [[nodiscard]] bool GetExitLock() const; 416 bool GetExitLocked() const;
417
418 void SetExitRequested(bool requested);
419 bool GetExitRequested() const;
417 420
418 void SetApplicationProcessBuildID(const CurrentBuildProcessID& id); 421 void SetApplicationProcessBuildID(const CurrentBuildProcessID& id);
419 [[nodiscard]] const CurrentBuildProcessID& GetApplicationProcessBuildID() const; 422 [[nodiscard]] const CurrentBuildProcessID& GetApplicationProcessBuildID() const;
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 8d057b3a8..d82a3169d 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -340,7 +340,7 @@ void ISelfController::Exit(HLERequestContext& ctx) {
340void ISelfController::LockExit(HLERequestContext& ctx) { 340void ISelfController::LockExit(HLERequestContext& ctx) {
341 LOG_DEBUG(Service_AM, "called"); 341 LOG_DEBUG(Service_AM, "called");
342 342
343 system.SetExitLock(true); 343 system.SetExitLocked(true);
344 344
345 IPC::ResponseBuilder rb{ctx, 2}; 345 IPC::ResponseBuilder rb{ctx, 2};
346 rb.Push(ResultSuccess); 346 rb.Push(ResultSuccess);
@@ -349,10 +349,14 @@ void ISelfController::LockExit(HLERequestContext& ctx) {
349void ISelfController::UnlockExit(HLERequestContext& ctx) { 349void ISelfController::UnlockExit(HLERequestContext& ctx) {
350 LOG_DEBUG(Service_AM, "called"); 350 LOG_DEBUG(Service_AM, "called");
351 351
352 system.SetExitLock(false); 352 system.SetExitLocked(false);
353 353
354 IPC::ResponseBuilder rb{ctx, 2}; 354 IPC::ResponseBuilder rb{ctx, 2};
355 rb.Push(ResultSuccess); 355 rb.Push(ResultSuccess);
356
357 if (system.GetExitRequested()) {
358 system.Exit();
359 }
356} 360}
357 361
358void ISelfController::EnterFatalSection(HLERequestContext& ctx) { 362void ISelfController::EnterFatalSection(HLERequestContext& ctx) {