mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
debug
This commit is contained in:
commit
9ea4daecbd
@ -84,16 +84,6 @@ noreturn void __assert_handler(const char *, const char *, int, const char *);
|
||||
//
|
||||
#define KalAssert KalAlwaysAssert
|
||||
|
||||
#ifndef _OSK_SOURCE
|
||||
|
||||
// When not building for OS/K, use the system's assert
|
||||
#include <assert.h>
|
||||
|
||||
#undef KalAlwaysAssert
|
||||
#define KalAlwaysAssert assert
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------//
|
||||
// When not debugging //
|
||||
//------------------------------------------//
|
||||
|
@ -61,7 +61,6 @@ typedef enum TermColor_t TermColor_t;
|
||||
|
||||
// Get Process_t structure of current CPU
|
||||
#define GetCurCPU() (cpuTable[_GetCurCPU()])
|
||||
#define PANICSTR_SIZE 1024
|
||||
|
||||
//Get the BootInfo_t structure
|
||||
#define GetBootInfo(x) bootTab.x
|
||||
@ -75,9 +74,6 @@ struct Processor_t
|
||||
// CPU number, index in CPU list
|
||||
int index;
|
||||
|
||||
// Panic string
|
||||
char panicStr[PANICSTR_SIZE];
|
||||
|
||||
// Number of ticks since boot time
|
||||
ulong ticks;
|
||||
|
||||
|
@ -31,7 +31,8 @@
|
||||
|
||||
//------------------------------------------//
|
||||
|
||||
extern volatile char *PanicStr;
|
||||
#define PANICSTR_SIZE 1024
|
||||
extern volatile char PanicStr[PANICSTR_SIZE];
|
||||
|
||||
//------------------------------------------//
|
||||
|
||||
|
@ -29,6 +29,6 @@ Processor_t cpuTable[NCPUS] = {0};
|
||||
|
||||
BootInfo_t bootTab = {0};
|
||||
Terminal_t *StdOut = 0, *StdDbg = 0;
|
||||
volatile char *PanicStr = 0;
|
||||
|
||||
Terminal_t *stdOut = 0, *stdDbg = 0;
|
||||
volatile char PanicStr[PANICSTR_SIZE] = {0};
|
||||
|
||||
|
@ -37,8 +37,8 @@ noreturn void __assert_handler(const char *msg,
|
||||
|
||||
(void)file; (void)line; (void)func;
|
||||
|
||||
StartPanic("cpu%d: In function '%s', from %s line %d - assertion failed: '%s'",
|
||||
_GetCurCPU(), func, file, line, msg);
|
||||
StartPanic("In function '%s', from %s line %d - assertion failed: '%s'",
|
||||
func, file, line, msg);
|
||||
}
|
||||
|
||||
//
|
||||
@ -64,11 +64,11 @@ noreturn void StartPanic(const char *fmt, ...)
|
||||
}
|
||||
|
||||
va_start(ap, fmt);
|
||||
vsnprintf(PanicStr, PANICSTR_SIZE, fmt, ap);
|
||||
vsnprintf((char *)PanicStr, PANICSTR_SIZE, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
PrintOnTermUnlocked(StdOut, "\nPanic!\n\n");
|
||||
PrintOnTermUnlocked(StdOut, PanicStr);
|
||||
PrintOnTermUnlocked(StdOut, (char *)PanicStr);
|
||||
|
||||
HaltCPU();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user