mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-27 03:54:17 +01:00
Merge pull request #4494 from FearlessTobi/port-1874
Port yuzu-emu/yuzu#1874: "hle/service, hle/sm: Minor cleanup"
This commit is contained in:
commit
80f1076a07
@ -54,11 +54,6 @@
|
||||
#include "core/hle/service/ssl_c.h"
|
||||
#include "core/hle/service/y2r_u.h"
|
||||
|
||||
using Kernel::ClientPort;
|
||||
using Kernel::ServerPort;
|
||||
using Kernel::ServerSession;
|
||||
using Kernel::SharedPtr;
|
||||
|
||||
namespace Service {
|
||||
|
||||
const std::array<ServiceModuleInfo, 40> service_module_map{
|
||||
@ -143,9 +138,7 @@ void ServiceFrameworkBase::InstallAsService(SM::ServiceManager& service_manager)
|
||||
|
||||
void ServiceFrameworkBase::InstallAsNamedPort(Kernel::KernelSystem& kernel) {
|
||||
ASSERT(port == nullptr);
|
||||
SharedPtr<ServerPort> server_port;
|
||||
SharedPtr<ClientPort> client_port;
|
||||
std::tie(server_port, client_port) = kernel.CreatePortPair(max_sessions, service_name);
|
||||
auto [server_port, client_port] = kernel.CreatePortPair(max_sessions, service_name);
|
||||
server_port->SetHleHandler(shared_from_this());
|
||||
kernel.AddNamedPort(service_name, std::move(client_port));
|
||||
}
|
||||
@ -176,7 +169,8 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(u32* cmd_buf, const Funct
|
||||
cmd_buf[1] = 0;
|
||||
}
|
||||
|
||||
void ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_session) {
|
||||
void ServiceFrameworkBase::HandleSyncRequest(
|
||||
Kernel::SharedPtr<Kernel::ServerSession> server_session) {
|
||||
Kernel::KernelSystem& kernel = Core::System::GetInstance().Kernel();
|
||||
auto thread = kernel.GetThreadManager().GetCurrentThread();
|
||||
// TODO(wwylele): avoid GetPointer
|
||||
@ -224,7 +218,7 @@ static bool AttemptLLE(const ServiceModuleInfo& service_module) {
|
||||
service_module.name);
|
||||
return false;
|
||||
}
|
||||
SharedPtr<Kernel::Process> process;
|
||||
Kernel::SharedPtr<Kernel::Process> process;
|
||||
loader->Load(process);
|
||||
LOG_DEBUG(Service, "Service module \"{}\" has been successfully loaded.", service_module.name);
|
||||
return true;
|
||||
|
@ -40,12 +40,10 @@ ResultVal<Kernel::SharedPtr<Kernel::ServerPort>> ServiceManager::RegisterService
|
||||
if (registered_services.find(name) != registered_services.end())
|
||||
return ERR_ALREADY_REGISTERED;
|
||||
|
||||
Kernel::SharedPtr<Kernel::ServerPort> server_port;
|
||||
Kernel::SharedPtr<Kernel::ClientPort> client_port;
|
||||
std::tie(server_port, client_port) = system.Kernel().CreatePortPair(max_sessions, name);
|
||||
auto [server_port, client_port] = system.Kernel().CreatePortPair(max_sessions, name);
|
||||
|
||||
registered_services.emplace(std::move(name), std::move(client_port));
|
||||
return MakeResult<Kernel::SharedPtr<Kernel::ServerPort>>(std::move(server_port));
|
||||
return MakeResult(std::move(server_port));
|
||||
}
|
||||
|
||||
ResultVal<Kernel::SharedPtr<Kernel::ClientPort>> ServiceManager::GetServicePort(
|
||||
@ -57,7 +55,7 @@ ResultVal<Kernel::SharedPtr<Kernel::ClientPort>> ServiceManager::GetServicePort(
|
||||
return ERR_SERVICE_NOT_REGISTERED;
|
||||
}
|
||||
|
||||
return MakeResult<Kernel::SharedPtr<Kernel::ClientPort>>(it->second);
|
||||
return MakeResult(it->second);
|
||||
}
|
||||
|
||||
ResultVal<Kernel::SharedPtr<Kernel::ClientSession>> ServiceManager::ConnectToService(
|
||||
|
Loading…
Reference in New Issue
Block a user