fatal.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/logging/log.h"
  5. #include "core/hle/ipc_helpers.h"
  6. #include "core/hle/service/fatal/fatal.h"
  7. #include "core/hle/service/fatal/fatal_p.h"
  8. #include "core/hle/service/fatal/fatal_u.h"
  9. namespace Service::Fatal {
  10. Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
  11. : ServiceFramework(name), module(std::move(module)) {}
  12. Module::Interface::~Interface() = default;
  13. void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
  14. IPC::RequestParser rp(ctx);
  15. u32 error_code = rp.Pop<u32>();
  16. LOG_WARNING(Service_Fatal, "(STUBBED) called, error_code=0x{:X}", error_code);
  17. IPC::ResponseBuilder rb{ctx, 2};
  18. rb.Push(RESULT_SUCCESS);
  19. }
  20. void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) {
  21. LOG_WARNING(Service_Fatal, "(STUBBED) called");
  22. IPC::ResponseBuilder rb{ctx, 2};
  23. rb.Push(RESULT_SUCCESS);
  24. }
  25. void InstallInterfaces(SM::ServiceManager& service_manager) {
  26. auto module = std::make_shared<Module>();
  27. std::make_shared<Fatal_P>(module)->InstallAsService(service_manager);
  28. std::make_shared<Fatal_U>(module)->InstallAsService(service_manager);
  29. }
  30. } // namespace Service::Fatal