libstrat: namespace remaining non-namespaced code. more new-ipc updates

This commit is contained in:
Michael Scire 2019-10-19 17:42:53 -07:00 committed by SciresM
parent ae2fa2fa60
commit 0b22af1206
68 changed files with 1257 additions and 2118 deletions

View file

@ -46,16 +46,20 @@ extern "C" {
alignas(16) u8 __nx_exception_stack[0x1000];
u64 __nx_exception_stack_size = sizeof(__nx_exception_stack);
void __libnx_exception_handler(ThreadExceptionDump *ctx);
void __libstratosphere_exception_handler(AtmosphereFatalErrorContext *ctx);
}
sts::ncm::TitleId __stratosphere_title_id = sts::ncm::TitleId::Loader;
namespace sts::ams {
ncm::TitleId StratosphereTitleId = ncm::TitleId::Loader;
}
using namespace sts;
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
StratosphereCrashHandler(ctx);
ams::CrashHandler(ctx);
}
void __libnx_initheap(void) {
void* addr = nx_inner_heap;
size_t size = nx_inner_heap_size;
@ -68,19 +72,17 @@ void __libnx_initheap(void) {
fake_heap_end = (char*)addr + size;
}
using namespace sts;
void __appInit(void) {
hos::SetVersionForLibnx();
/* Initialize services we need. */
DoWithSmSession([&]() {
sm::DoWithSession([&]() {
R_ASSERT(fsInitialize());
R_ASSERT(lrInitialize());
R_ASSERT(fsldrInitialize());
});
CheckAtmosphereVersion(CURRENT_ATMOSPHERE_VERSION);
ams::CheckApiVersion();
}
void __appExit(void) {

View file

@ -723,10 +723,9 @@ namespace sts::ldr {
R_TRY(LoadNsosIntoProcessMemory(&info, loc.title_id, nso_headers, has_nso, arg_info));
/* Register NSOs with ro manager. */
os::ProcessId process_id = os::InvalidProcessId;
{
/* Nintendo doesn't validate this result, but we will. */
R_ASSERT(svcGetProcessId(&process_id.value, info.process_handle.Get()));
/* Nintendo doesn't validate this get, but we do. */
os::ProcessId process_id = os::GetProcessId(info.process_handle.Get());
/* Register new process. */
ldr::ro::RegisterProcess(pin_id, process_id, loc.title_id);