MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / panic_

Function panic_

rEFIt_UEFI/Platform/Posix/abort.cpp:29–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28#define FATAL_ERROR_MSG "\nA fatal error happened. System halted.\n"
29static void panic_(const char* format, VA_LIST va)
30{
31 if ( format ) {
32 vprintf(format, va);
33 #ifdef DEBUG_ON_SERIAL_PORT
34 char buf[500];
35 vsnprintf(buf, sizeof(buf)-1, format, va);
36 SerialPortWrite((UINT8*)buf, strlen(buf));
37 #endif
38 }
39 printf(FATAL_ERROR_MSG);
40 #ifdef DEBUG_ON_SERIAL_PORT
41 SerialPortWrite((UINT8*)FATAL_ERROR_MSG, strlen(FATAL_ERROR_MSG));
42 #endif
43 while (1) { // this will avoid warning : Function declared 'noreturn' should not return
44 CpuDeadLoop();
45 }
46}
47
48void panic(const char* format, ...)
49{

Callers 1

panicFunction · 0.85

Calls 5

vprintfFunction · 0.85
printfFunction · 0.85
strlenFunction · 0.70
SerialPortWriteFunction · 0.50
CpuDeadLoopFunction · 0.50

Tested by

no test coverage detected