diff --git a/kaleid/include/base/assert.h b/kaleid/include/base/assert.h index 97fadac..3f962bd 100644 --- a/kaleid/include/base/assert.h +++ b/kaleid/include/base/assert.h @@ -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 - -#undef KalAlwaysAssert -#define KalAlwaysAssert assert - -#endif - //------------------------------------------// // When not debugging // //------------------------------------------// diff --git a/kaleid/include/kernel/base.h b/kaleid/include/kernel/base.h index 055a2c9..476c647 100644 --- a/kaleid/include/kernel/base.h +++ b/kaleid/include/kernel/base.h @@ -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; diff --git a/kaleid/include/kernel/panic.h b/kaleid/include/kernel/panic.h index ac80e6e..cdb53be 100644 --- a/kaleid/include/kernel/panic.h +++ b/kaleid/include/kernel/panic.h @@ -31,7 +31,8 @@ //------------------------------------------// -extern volatile char *PanicStr; +#define PANICSTR_SIZE 1024 +extern volatile char PanicStr[PANICSTR_SIZE]; //------------------------------------------// diff --git a/kaleid/kernel/init/table.c b/kaleid/kernel/init/table.c index ebca750..bc32fdb 100644 --- a/kaleid/kernel/init/table.c +++ b/kaleid/kernel/init/table.c @@ -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}; + diff --git a/kaleid/kernel/ke/panic.c b/kaleid/kernel/ke/panic.c index 4de0bfe..134ab33 100644 --- a/kaleid/kernel/ke/panic.c +++ b/kaleid/kernel/ke/panic.c @@ -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(); }