mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
ro: only hold sm session open when needed
This commit is contained in:
parent
30485f1df9
commit
13c825a8bb
2 changed files with 31 additions and 33 deletions
|
@ -69,32 +69,29 @@ void __appInit(void) {
|
|||
|
||||
SetFirmwareVersionForLibnx();
|
||||
|
||||
rc = smInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
rc = setsysInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
rc = fsInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
if (GetRuntimeFirmwareVersion() < FirmwareVersion_300) {
|
||||
rc = pminfoInitialize();
|
||||
DoWithSmSession([&]() {
|
||||
rc = setsysInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
rc = fsdevMountSdmc();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
rc = fsInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
if (GetRuntimeFirmwareVersion() < FirmwareVersion_300) {
|
||||
rc = pminfoInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
rc = fsdevMountSdmc();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
});
|
||||
|
||||
CheckAtmosphereVersion(CURRENT_ATMOSPHERE_VERSION);
|
||||
}
|
||||
|
@ -106,7 +103,6 @@ void __appExit(void) {
|
|||
pminfoExit();
|
||||
}
|
||||
setsysExit();
|
||||
smExit();
|
||||
}
|
||||
|
||||
/* Helpers to create RO objects. */
|
||||
|
|
|
@ -30,9 +30,11 @@ static Registration::RoProcessContext g_process_contexts[Registration::MaxSessio
|
|||
static bool g_is_development_hardware, g_is_development_function_enabled;
|
||||
|
||||
void Registration::Initialize() {
|
||||
if (R_FAILED(splInitialize())) {
|
||||
std::abort();
|
||||
}
|
||||
DoWithSmSession([&]() {
|
||||
if (R_FAILED(splInitialize())) {
|
||||
std::abort();
|
||||
}
|
||||
});
|
||||
ON_SCOPE_EXIT { splExit(); };
|
||||
|
||||
if (R_FAILED(splIsDevelopment(&g_is_development_hardware))) {
|
||||
|
|
Loading…
Reference in a new issue