X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2Flogging.c;h=9617b834820d442193468975095d15edd0db0d5d;hb=4ebe00546574e97c5316881881f7f2562deea74b;hp=b419be3d695b28a4c0b1ecb8239dcd7da83f711c;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/logging.c b/KernelLand/Kernel/logging.c index b419be3d..9617b834 100644 --- a/KernelLand/Kernel/logging.c +++ b/KernelLand/Kernel/logging.c @@ -69,14 +69,16 @@ EXPORT(Log_Debug); // === GLOBALS === tShortSpinlock glLogOutput; -#if USE_RING_BUFFER +#if CACHE_MESSAGES +# if USE_RING_BUFFER Uint8 gaLog_RingBufferData[sizeof(tRingBuffer)+RING_BUFFER_SIZE]; tRingBuffer *gpLog_RingBuffer = (void*)gaLog_RingBufferData; -#else +# else tMutex glLog; tLogList gLog; tLogList gLog_Levels[NUM_LOG_LEVELS]; -#endif +# endif // USE_RING_BUFFER +#endif // CACHE_MESSAGES // === CODE === /** @@ -156,6 +158,8 @@ void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args */ void Log_Int_PrintMessage(tLogEntry *Entry) { + if( CPU_HAS_LOCK(&glLogOutput) ) + return ; // TODO: Error? SHORTLOCK( &glLogOutput ); LogF("%s%014lli%s [%-8s] %i - %s", csaLevelColours[Entry->Level],