diff options
author | german77 <juangerman-13@hotmail.com> | 2022-06-26 05:44:19 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-06-27 03:21:37 +0200 |
commit | a7d9be13840acd65d0d684666390758ede72c826 (patch) | |
tree | 37485f63b09576444173d6a765abe0bb95dd45db /src/core/hle/service/sm | |
parent | Merge pull request #8475 from liamwhite/x18 (diff) | |
download | yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar.gz yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar.bz2 yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar.lz yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar.xz yuzu-a7d9be13840acd65d0d684666390758ede72c826.tar.zst yuzu-a7d9be13840acd65d0d684666390758ede72c826.zip |
Diffstat (limited to 'src/core/hle/service/sm')
-rw-r--r-- | src/core/hle/service/sm/sm.cpp | 18 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/sm/sm_controller.cpp | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index 925608875..246c94623 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp @@ -17,10 +17,10 @@ namespace Service::SM { -constexpr ResultCode ERR_NOT_INITIALIZED(ErrorModule::SM, 2); -constexpr ResultCode ERR_ALREADY_REGISTERED(ErrorModule::SM, 4); -constexpr ResultCode ERR_INVALID_NAME(ErrorModule::SM, 6); -constexpr ResultCode ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7); +constexpr Result ERR_NOT_INITIALIZED(ErrorModule::SM, 2); +constexpr Result ERR_ALREADY_REGISTERED(ErrorModule::SM, 4); +constexpr Result ERR_INVALID_NAME(ErrorModule::SM, 6); +constexpr Result ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7); ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} {} ServiceManager::~ServiceManager() = default; @@ -29,7 +29,7 @@ void ServiceManager::InvokeControlRequest(Kernel::HLERequestContext& context) { controller_interface->InvokeRequest(context); } -static ResultCode ValidateServiceName(const std::string& name) { +static Result ValidateServiceName(const std::string& name) { if (name.empty() || name.size() > 8) { LOG_ERROR(Service_SM, "Invalid service name! service={}", name); return ERR_INVALID_NAME; @@ -43,8 +43,8 @@ Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core return self.sm_interface->CreatePort(); } -ResultCode ServiceManager::RegisterService(std::string name, u32 max_sessions, - Kernel::SessionRequestHandlerPtr handler) { +Result ServiceManager::RegisterService(std::string name, u32 max_sessions, + Kernel::SessionRequestHandlerPtr handler) { CASCADE_CODE(ValidateServiceName(name)); @@ -58,7 +58,7 @@ ResultCode ServiceManager::RegisterService(std::string name, u32 max_sessions, return ResultSuccess; } -ResultCode ServiceManager::UnregisterService(const std::string& name) { +Result ServiceManager::UnregisterService(const std::string& name) { CASCADE_CODE(ValidateServiceName(name)); const auto iter = registered_services.find(name); @@ -94,7 +94,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name * Inputs: * 0: 0x00000000 * Outputs: - * 0: ResultCode + * 0: Result */ void SM::Initialize(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_SM, "called"); diff --git a/src/core/hle/service/sm/sm.h b/src/core/hle/service/sm/sm.h index 43d445e97..878decc6f 100644 --- a/src/core/hle/service/sm/sm.h +++ b/src/core/hle/service/sm/sm.h @@ -55,9 +55,9 @@ public: explicit ServiceManager(Kernel::KernelCore& kernel_); ~ServiceManager(); - ResultCode RegisterService(std::string name, u32 max_sessions, - Kernel::SessionRequestHandlerPtr handler); - ResultCode UnregisterService(const std::string& name); + Result RegisterService(std::string name, u32 max_sessions, + Kernel::SessionRequestHandlerPtr handler); + Result UnregisterService(const std::string& name); ResultVal<Kernel::KPort*> GetServicePort(const std::string& name); template <Common::DerivedFrom<Kernel::SessionRequestHandler> T> diff --git a/src/core/hle/service/sm/sm_controller.cpp b/src/core/hle/service/sm/sm_controller.cpp index a4ed4193e..2a4bd64ab 100644 --- a/src/core/hle/service/sm/sm_controller.cpp +++ b/src/core/hle/service/sm/sm_controller.cpp @@ -33,7 +33,7 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { // Create a session. Kernel::KClientSession* session{}; - const ResultCode result = parent_port.CreateSession(std::addressof(session), session_manager); + const Result result = parent_port.CreateSession(std::addressof(session), session_manager); if (result.IsError()) { LOG_CRITICAL(Service, "CreateSession failed with error 0x{:08X}", result.raw); IPC::ResponseBuilder rb{ctx, 2}; |