strat: automatic program id detection
This commit is contained in:
@@ -34,12 +34,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::AtmosphereProgramId::AtmosphereLogManager;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
#define AMS_LM_USE_FATAL_ERROR 1
|
||||
|
||||
@@ -35,12 +35,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::DevServer;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
#define AMS_TIO_SERVER_USE_FATAL_ERROR 1
|
||||
|
||||
@@ -45,8 +45,6 @@ extern "C" {
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::AtmosphereProgramId::Mitm;
|
||||
|
||||
/* Override. */
|
||||
void ExceptionHandler(FatalErrorContext *ctx) {
|
||||
/* We're bpc-mitm (or ams_mitm, anyway), so manually reboot to fatal error. */
|
||||
|
||||
@@ -56,8 +56,6 @@ extern "C" {
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Boot;
|
||||
|
||||
void ExceptionHandler(FatalErrorContext *ctx) {
|
||||
/* We're boot sysmodule, so manually reboot to fatal error. */
|
||||
boot::RebootForFatalError(ctx);
|
||||
|
||||
@@ -39,12 +39,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Boot2;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -42,12 +42,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Creport;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -34,12 +34,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Cs;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
#define AMS_CS_SERVER_USE_FATAL_ERROR 1
|
||||
|
||||
@@ -36,12 +36,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::DmntGen2;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
#define AMS_DMNT2_SERVER_USE_FATAL_ERROR 1
|
||||
|
||||
@@ -36,12 +36,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Dmnt;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_initheap(void) {
|
||||
|
||||
@@ -34,12 +34,6 @@ extern "C" {
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Eclct;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -39,12 +39,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Erpt;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -46,12 +46,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Fatal;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
namespace ams::fatal {
|
||||
|
||||
@@ -34,12 +34,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Htc;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
#define AMS_HTC_USE_FATAL_ERROR 1
|
||||
|
||||
@@ -36,11 +36,6 @@ extern "C" {
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::JpegDec;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -41,12 +41,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Loader;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -39,12 +39,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ncm;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -39,12 +39,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pgl;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
@@ -44,12 +44,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Pm;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
@@ -81,7 +75,7 @@ namespace {
|
||||
/* Doing this here works around a bug fixed in 6.0.0. */
|
||||
/* Not doing so will cause svcDebugActiveProcess to deadlock on lower firmwares if called for it's own process. */
|
||||
if (process_id == os::GetCurrentProcessId()) {
|
||||
return ams::CurrentProgramId;
|
||||
return os::GetCurrentProgramId();
|
||||
}
|
||||
|
||||
/* Get a debug handle. */
|
||||
|
||||
@@ -36,12 +36,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Ro;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
namespace ams::ro {
|
||||
|
||||
@@ -51,8 +51,6 @@ namespace {
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Sm;
|
||||
|
||||
void NORETURN Exit(int rc) {
|
||||
AMS_ABORT("Exit called by immortal process");
|
||||
}
|
||||
|
||||
@@ -49,12 +49,6 @@ extern "C" {
|
||||
void __libnx_free(void *mem);
|
||||
}
|
||||
|
||||
namespace ams {
|
||||
|
||||
ncm::ProgramId CurrentProgramId = ncm::SystemProgramId::Spl;
|
||||
|
||||
}
|
||||
|
||||
using namespace ams;
|
||||
|
||||
void __libnx_exception_handler(ThreadExceptionDump *ctx) {
|
||||
|
||||
Reference in New Issue
Block a user