ams: communicate status to libnx

This commit is contained in:
Michael Scire 2021-01-27 14:20:30 -08:00
parent 48830d190f
commit 4190281b2f
2 changed files with 10 additions and 1 deletions

View file

@ -76,7 +76,7 @@ namespace ams::hos {
const u32 major = (hos_version_val >> 24) & 0xFF;
const u32 minor = (hos_version_val >> 16) & 0xFF;
const u32 micro = (hos_version_val >> 8) & 0xFF;
hosversionSet(MAKEHOSVERSION(major, minor, micro));
hosversionSet((BIT(31)) | (MAKEHOSVERSION(major, minor, micro)));
}
}

View file

@ -124,6 +124,15 @@ void __libnx_free(void *mem) {
}
int main(int argc, char **argv) {
/* Register "ams" port, use up its session. */
{
svc::Handle ams_port;
R_ABORT_UNLESS(svc::ManageNamedPort(std::addressof(ams_port), "ams", 1));
svc::Handle ams_session;
R_ABORT_UNLESS(svc::ConnectToNamedPort(std::addressof(ams_session), "ams"));
}
/* Launch all mitm modules in sequence. */
mitm::LaunchAllModules();