libnx/nx/source/runtime/diag.c
fincs 970d982e57
Add diagAbortWithResult, see details:
- This is a (weak/overridable) function meant to be called when the
  program encounters an unrecoverable error, but it's not fatal enough
  to bring down the entire system with it.
- The default implementation uses svcBreak, passing the result code
  in the user buffer.
- Replaced all usages of fatalThrow with diagAbortWithResult throughout
  the entire library.
2020-10-29 13:40:35 +01:00

9 lines
206 B
C

#include "kernel/svc.h"
#include "runtime/diag.h"
__attribute__((weak)) void diagAbortWithResult(Result res)
{
svcBreak(BreakReason_Panic, (uintptr_t)&res, sizeof(res));
__builtin_unreachable();
}