pm: increase dmnt sessions. sm: remove session limit hack

This commit is contained in:
Michael Scire 2019-12-10 20:36:19 -08:00
parent d3bafc5b3b
commit 5448332009
2 changed files with 5 additions and 12 deletions

View file

@ -163,23 +163,23 @@ namespace {
using ServerOptions = sf::hipc::DefaultServerManagerOptions;
constexpr sm::ServiceName ShellServiceName = sm::ServiceName::Encode("pm:shell");
constexpr size_t ShellMaxSessions = 3;
constexpr size_t ShellMaxSessions = 8; /* Official maximum is 3. */
constexpr sm::ServiceName DebugMonitorServiceName = sm::ServiceName::Encode("pm:dmnt");
constexpr size_t DebugMonitorMaxSessions = 3;
constexpr size_t DebugMonitorMaxSessions = 16;
constexpr sm::ServiceName BootModeServiceName = sm::ServiceName::Encode("pm:bm");
constexpr size_t BootModeMaxSessions = 6;
constexpr size_t BootModeMaxSessions = 8; /* Official maximum is 4. */
constexpr sm::ServiceName InformationServiceName = sm::ServiceName::Encode("pm:info");
constexpr size_t InformationMaxSessions = 32 - (ShellMaxSessions + DebugMonitorMaxSessions + BootModeMaxSessions);
constexpr size_t InformationMaxSessions = 64 - (ShellMaxSessions + DebugMonitorMaxSessions + BootModeMaxSessions);
static_assert(InformationMaxSessions >= 16, "InformationMaxSessions");
/* pm:shell, pm:dmnt, pm:bm, pm:info. */
constexpr size_t NumServers = 4;
constexpr size_t MaxSessions = ShellMaxSessions + DebugMonitorMaxSessions + BootModeMaxSessions + InformationMaxSessions;
static_assert(MaxSessions == 32, "MaxSessions");
static_assert(MaxSessions == 64, "MaxSessions");
sf::hipc::ServerManager<NumServers, ServerOptions, MaxSessions> g_server_manager;
}

View file

@ -399,13 +399,6 @@ namespace ams::sm::impl {
/* Don't try to register something already registered. */
R_UNLESS(!HasServiceInfo(service), sm::ResultAlreadyRegistered());
/* Adjust session limit, if compile flags tell us to. */
#ifdef SM_MINIMUM_SESSION_LIMIT
if (max_sessions < SM_MINIMUM_SESSION_LIMIT) {
max_sessions = SM_MINIMUM_SESSION_LIMIT;
}
#endif
/* Get free service. */
ServiceInfo *free_service = GetFreeServiceInfo();
R_UNLESS(free_service != nullptr, sm::ResultOutOfServices());