mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-13 06:32:13 +02:00
fatalThrow: use hosversion instead of kerneldetect (and remove old alias)
This commit is contained in:
parent
4c6abe1e41
commit
d0d64ce1ce
@ -6,12 +6,13 @@
|
||||
#include "sf/service.h"
|
||||
#include "services/fatal.h"
|
||||
#include "services/sm.h"
|
||||
#include "runtime/hosversion.h"
|
||||
|
||||
static void _fatalCmd(Result err, FatalPolicy type, FatalCpuContext *ctx, u32 cmd_id) {
|
||||
Result rc = 0;
|
||||
|
||||
//Only [3.0.0+] supports FatalPolicy_ErrorScreen, when specified on pre-3.0.0 use FatalPolicy_ErrorReportAndErrorScreen instead.
|
||||
if (type == FatalPolicy_ErrorScreen && !kernelAbove300()) type = FatalPolicy_ErrorReportAndErrorScreen;
|
||||
if (type == FatalPolicy_ErrorScreen && hosversionBefore(3,0,0)) type = FatalPolicy_ErrorReportAndErrorScreen;
|
||||
|
||||
if (detectDebugger()) {
|
||||
svcBreak(BreakReason_Panic | BreakReason_NotificationOnlyFlag, (uintptr_t)&err, sizeof(err));
|
||||
@ -66,5 +67,3 @@ void fatalThrowWithPolicy(Result err, FatalPolicy type) {
|
||||
void fatalThrowWithContext(Result err, FatalPolicy type, FatalCpuContext *ctx) {
|
||||
_fatalCmd(err, type, ctx, 2);
|
||||
}
|
||||
|
||||
void NORETURN fatalSimple(Result) __attribute__((alias("fatalThrow")));
|
||||
|
Loading…
Reference in New Issue
Block a user