mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-05 01:03:43 -04:00
stratosphere: Fix fs.mitm bis_protect race condition.
This commit is contained in:
parent
bcdfc53d7d
commit
49ad66e478
9 changed files with 41 additions and 10 deletions
|
@ -123,7 +123,22 @@ static void MountSdCard() {
|
|||
fsdevMountSdmc();
|
||||
}
|
||||
|
||||
void EmbeddedBoot2::Main() {
|
||||
void EmbeddedBoot2::Main() {
|
||||
/* Wait until fs.mitm has installed itself. We want this to happen as early as possible. */
|
||||
bool fs_mitm_installed = false;
|
||||
|
||||
Result rc = smManagerAmsInitialize();
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
while (R_FAILED((rc = smManagerAmsHasMitm(&fs_mitm_installed, "fsp-srv"))) || !fs_mitm_installed) {
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
svcSleepThread(1000ull);
|
||||
}
|
||||
smManagerAmsExit();
|
||||
|
||||
/* psc, bus, pcv is the minimal set of required titles to get SD card. */
|
||||
/* bus depends on pcie, and pcv depends on settings. */
|
||||
/* Launch psc. */
|
||||
|
|
|
@ -102,7 +102,6 @@ void __appInit(void) {
|
|||
rc = smManagerAmsInitialize();
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
smManagerAmsEndInitialDefers();
|
||||
smManagerAmsExit();
|
||||
} else {
|
||||
fatalSimple(0xCAFE << 4 | 2);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue