[debug][panic] remove the wrapper panic #define and read the caller inside panic itself
Was always this way for some reason, which would tend to print the calling routine that called the routine that paniced, which was of dubious use. Simplify the panic logic and just call it as a standard varargs routine.
This commit is contained in:
@@ -51,8 +51,7 @@ static inline void hexdump8(const void *ptr, size_t len) {
|
||||
#define dprintf(level, x...) do { if ((level) <= LK_DEBUGLEVEL) { printf(x); } } while (0)
|
||||
|
||||
/* systemwide halts */
|
||||
void _panic(void *caller, const char *fmt, ...) __PRINTFLIKE(2, 3) __NO_RETURN;
|
||||
#define panic(x...) _panic(__GET_CALLER(), x)
|
||||
void panic(const char *fmt, ...) __PRINTFLIKE(1, 2) __NO_RETURN;
|
||||
|
||||
#define PANIC_UNIMPLEMENTED panic("%s unimplemented\n", __PRETTY_FUNCTION__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user