diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2019-09-22 16:37:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-22 16:37:12 +0200 |
commit | aaec1562f8631303d1a5abb6c75f2422d6d7cf71 (patch) | |
tree | 283ac1330252c06b3a1741730ce49f4182330150 /src/core/hle/service/am/am.cpp | |
parent | Merge pull request #2889 from FearlessTobi/adwsawdawd (diff) | |
parent | main: Use const on all variable initializations (diff) | |
download | yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar.gz yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar.bz2 yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar.lz yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar.xz yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.tar.zst yuzu-aaec1562f8631303d1a5abb6c75f2422d6d7cf71.zip |
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 3366fd8ce..797c9a06f 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"} { IDebugFunctions::~IDebugFunctions() = default; -ISelfController::ISelfController(Core::System& system_, - std::shared_ptr<NVFlinger::NVFlinger> nvflinger_) - : ServiceFramework("ISelfController"), nvflinger(std::move(nvflinger_)) { +ISelfController::ISelfController(Core::System& system, + std::shared_ptr<NVFlinger::NVFlinger> nvflinger) + : ServiceFramework("ISelfController"), system(system), nvflinger(std::move(nvflinger)) { // clang-format off static const FunctionInfo functions[] = { - {0, nullptr, "Exit"}, + {0, &ISelfController::Exit, "Exit"}, {1, &ISelfController::LockExit, "LockExit"}, {2, &ISelfController::UnlockExit, "UnlockExit"}, {3, &ISelfController::EnterFatalSection, "EnterFatalSection"}, @@ -282,7 +282,7 @@ ISelfController::ISelfController(Core::System& system_, RegisterHandlers(functions); - auto& kernel = system_.Kernel(); + auto& kernel = system.Kernel(); launchable_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, "ISelfController:LaunchableEvent"); @@ -298,15 +298,28 @@ ISelfController::ISelfController(Core::System& system_, ISelfController::~ISelfController() = default; +void ISelfController::Exit(Kernel::HLERequestContext& ctx) { + LOG_DEBUG(Service_AM, "called"); + + system.Shutdown(); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); +} + void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_AM, "(STUBBED) called"); + LOG_DEBUG(Service_AM, "called"); + + system.SetExitLock(true); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); } void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_AM, "(STUBBED) called"); + LOG_DEBUG(Service_AM, "called"); + + system.SetExitLock(false); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(RESULT_SUCCESS); @@ -550,6 +563,10 @@ void AppletMessageQueue::OperationModeChanged() { on_operation_mode_changed.writable->Signal(); } +void AppletMessageQueue::RequestExit() { + PushMessage(AppletMessage::ExitRequested); +} + ICommonStateGetter::ICommonStateGetter(Core::System& system, std::shared_ptr<AppletMessageQueue> msg_queue) : ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) { |