diff options
| author | 2019-07-06 13:41:38 -0400 | |
|---|---|---|
| committer | 2019-09-21 22:25:18 -0400 | |
| commit | a7fda849023664212f152adbb0ceed17b246acb0 (patch) | |
| tree | a044ce020d218eacedebd2cca77e7c87185a55da /src | |
| parent | am: Add RequestExit event to AppletMessageQueue (diff) | |
| download | yuzu-a7fda849023664212f152adbb0ceed17b246acb0.tar.gz yuzu-a7fda849023664212f152adbb0ceed17b246acb0.tar.xz yuzu-a7fda849023664212f152adbb0ceed17b246acb0.zip | |
am: Implement ISelfController Exit
Closes the current application.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 3 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_ae.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_oe.h | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index c98fefdeb..7d8649642 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -232,12 +232,12 @@ IDebugFunctions::IDebugFunctions() : ServiceFramework{"IDebugFunctions"} { | |||
| 232 | 232 | ||
| 233 | IDebugFunctions::~IDebugFunctions() = default; | 233 | IDebugFunctions::~IDebugFunctions() = default; |
| 234 | 234 | ||
| 235 | ISelfController::ISelfController(Core::System& system_, | 235 | ISelfController::ISelfController(Core::System& system, |
| 236 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger_) | 236 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger) |
| 237 | : ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger_)) { | 237 | : ServiceFramework("ISelfController"), system(system), nvflinger(std::move(nvflinger)) { |
| 238 | // clang-format off | 238 | // clang-format off |
| 239 | static const FunctionInfo functions[] = { | 239 | static const FunctionInfo functions[] = { |
| 240 | {0, nullptr, "Exit"}, | 240 | {0, &ISelfController::Exit, "Exit"}, |
| 241 | {1, &ISelfController::LockExit, "LockExit"}, | 241 | {1, &ISelfController::LockExit, "LockExit"}, |
| 242 | {2, &ISelfController::UnlockExit, "UnlockExit"}, | 242 | {2, &ISelfController::UnlockExit, "UnlockExit"}, |
| 243 | {3, &ISelfController::EnterFatalSection, "EnterFatalSection"}, | 243 | {3, &ISelfController::EnterFatalSection, "EnterFatalSection"}, |
| @@ -298,6 +298,15 @@ ISelfController::ISelfController(Core::System& system_, | |||
| 298 | 298 | ||
| 299 | ISelfController::~ISelfController() = default; | 299 | ISelfController::~ISelfController() = default; |
| 300 | 300 | ||
| 301 | void ISelfController::Exit(Kernel::HLERequestContext& ctx) { | ||
| 302 | LOG_DEBUG(Service_AM, "called"); | ||
| 303 | |||
| 304 | system.Shutdown(); | ||
| 305 | |||
| 306 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 307 | rb.Push(RESULT_SUCCESS); | ||
| 308 | } | ||
| 309 | |||
| 301 | void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { | 310 | void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { |
| 302 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 311 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 303 | 312 | ||
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 9d2c8b2ca..a3baeb673 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -125,6 +125,7 @@ public: | |||
| 125 | ~ISelfController() override; | 125 | ~ISelfController() override; |
| 126 | 126 | ||
| 127 | private: | 127 | private: |
| 128 | void Exit(Kernel::HLERequestContext& ctx); | ||
| 128 | void LockExit(Kernel::HLERequestContext& ctx); | 129 | void LockExit(Kernel::HLERequestContext& ctx); |
| 129 | void UnlockExit(Kernel::HLERequestContext& ctx); | 130 | void UnlockExit(Kernel::HLERequestContext& ctx); |
| 130 | void EnterFatalSection(Kernel::HLERequestContext& ctx); | 131 | void EnterFatalSection(Kernel::HLERequestContext& ctx); |
| @@ -153,6 +154,8 @@ private: | |||
| 153 | u32 idle_time_detection_extension = 0; | 154 | u32 idle_time_detection_extension = 0; |
| 154 | u64 num_fatal_sections_entered = 0; | 155 | u64 num_fatal_sections_entered = 0; |
| 155 | bool is_auto_sleep_disabled = false; | 156 | bool is_auto_sleep_disabled = false; |
| 157 | |||
| 158 | Core::System& system; | ||
| 156 | }; | 159 | }; |
| 157 | 160 | ||
| 158 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { | 161 | class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { |
diff --git a/src/core/hle/service/am/applet_ae.h b/src/core/hle/service/am/applet_ae.h index 0e0d10858..2e3e45915 100644 --- a/src/core/hle/service/am/applet_ae.h +++ b/src/core/hle/service/am/applet_ae.h | |||
| @@ -19,6 +19,8 @@ class NVFlinger; | |||
| 19 | 19 | ||
| 20 | namespace AM { | 20 | namespace AM { |
| 21 | 21 | ||
| 22 | class AppletMessageQueue; | ||
| 23 | |||
| 22 | class AppletAE final : public ServiceFramework<AppletAE> { | 24 | class AppletAE final : public ServiceFramework<AppletAE> { |
| 23 | public: | 25 | public: |
| 24 | explicit AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, | 26 | explicit AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, |
diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index 99a65e7b5..758da792d 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h | |||
| @@ -19,6 +19,8 @@ class NVFlinger; | |||
| 19 | 19 | ||
| 20 | namespace AM { | 20 | namespace AM { |
| 21 | 21 | ||
| 22 | class AppletMessageQueue; | ||
| 23 | |||
| 22 | class AppletOE final : public ServiceFramework<AppletOE> { | 24 | class AppletOE final : public ServiceFramework<AppletOE> { |
| 23 | public: | 25 | public: |
| 24 | explicit AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, | 26 | explicit AppletOE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger, |