early-access version 3412

This commit is contained in:
pineappleEA
2023-02-22 02:29:07 +01:00
parent 2dc56490ff
commit 9a82fd9a3b
24 changed files with 85 additions and 60 deletions

View File

@@ -112,7 +112,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name
void SM::Initialize(Kernel::HLERequestContext& ctx) {
LOG_DEBUG(Service_SM, "called");
is_initialized = true;
ctx.GetManager()->SetIsInitializedForSm();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
@@ -159,7 +159,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) {
}
ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& ctx) {
if (!is_initialized) {
if (!ctx.GetManager()->GetIsInitializedForSm()) {
return ERR_NOT_INITIALIZED;
}
@@ -168,6 +168,11 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext&
// Find the named port.
auto port_result = service_manager.GetServicePort(name);
if (port_result.Code() == ERR_INVALID_NAME) {
LOG_ERROR(Service_SM, "Invalid service name '{}'", name);
return ERR_INVALID_NAME;
}
if (port_result.Failed()) {
LOG_INFO(Service_SM, "Waiting for service {} to become available", name);
ctx.SetIsDeferred();

View File

@@ -19,6 +19,7 @@ enum class Errno : u32 {
INVAL = 22,
MFILE = 24,
MSGSIZE = 90,
CONNRESET = 104,
NOTCONN = 107,
TIMEDOUT = 110,
};

View File

@@ -27,6 +27,8 @@ Errno Translate(Network::Errno value) {
return Errno::NOTCONN;
case Network::Errno::TIMEDOUT:
return Errno::TIMEDOUT;
case Network::Errno::CONNRESET:
return Errno::CONNRESET;
default:
UNIMPLEMENTED_MSG("Unimplemented errno={}", value);
return Errno::SUCCESS;