mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Use FatalType_ErrorReportAndErrorScreen instead of FatalType_ErrorScreen, on pre-3.0.0. FatalType_ErrorScreen is only available with 3.0.0+, this fixes a regression where using fatalSimple on pre-3.0.0 caused a system hang.
This commit is contained in:
parent
347e3b3156
commit
42d3c32b37
@ -11,18 +11,19 @@
|
||||
typedef enum {
|
||||
FatalType_ErrorReportAndErrorScreen = 0,
|
||||
FatalType_ErrorReport = 1,
|
||||
FatalType_ErrorScreen = 2
|
||||
FatalType_ErrorScreen = 2 ///< Only available with 3.0.0+. If specified, FatalType_ErrorReportAndErrorScreen will be used instead on pre-3.0.0.
|
||||
} FatalType;
|
||||
|
||||
/**
|
||||
* @brief Triggers a system fatal error.
|
||||
* @param err[in] Result code to throw.
|
||||
* @note This function does not return.
|
||||
* @note This uses \ref fatalWithType with \ref FatalType_ErrorScreen internally.
|
||||
*/
|
||||
void NORETURN fatalSimple(Result err);
|
||||
|
||||
/**
|
||||
* @brief Triggers a system fatal error with a custom FatalType.
|
||||
* @brief Triggers a system fatal error with a custom \ref FatalType.
|
||||
* @param err[in] Result code to throw.
|
||||
* @param err[in] Type of fatal error to throw.
|
||||
* @note This function may not return, depending on \ref FatalType.
|
||||
|
@ -17,6 +17,9 @@ void NORETURN fatalSimple(Result err) {
|
||||
void fatalWithType(Result err, FatalType type) {
|
||||
Result rc = 0;
|
||||
|
||||
//Only 3.0.0+ supports FatalType_ErrorScreen, when specified on pre-3.0.0 use FatalType_ErrorReportAndErrorScreen instead.
|
||||
if (type == FatalType_ErrorScreen && !kernelAbove300()) type = FatalType_ErrorReportAndErrorScreen;
|
||||
|
||||
if (detectDebugger()) {
|
||||
svcBreak(0x80000000, err, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user