git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel/x86 - Fixed possible issue with entrypoint not being in a PT_LOAD segment
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
logging.c
diff --git
a/KernelLand/Kernel/logging.c
b/KernelLand/Kernel/logging.c
index
b419be3
..
aab25a1
100644
(file)
--- a/
KernelLand/Kernel/logging.c
+++ b/
KernelLand/Kernel/logging.c
@@
-69,14
+69,16
@@
EXPORT(Log_Debug);
// === GLOBALS ===
tShortSpinlock glLogOutput;
// === 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;
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];
tMutex glLog;
tLogList gLog;
tLogList gLog_Levels[NUM_LOG_LEVELS];
-#endif
+# endif // USE_RING_BUFFER
+#endif // CACHE_MESSAGES
// === CODE ===
/**
// === CODE ===
/**
@@
-89,12
+91,10
@@
void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args
va_list args_tmp;
if( Level >= NUM_LOG_LEVELS ) return;
va_list args_tmp;
if( Level >= NUM_LOG_LEVELS ) return;
-
+
va_copy(args_tmp, Args);
len = vsnprintf(NULL, 256, Format, args_tmp);
va_copy(args_tmp, Args);
len = vsnprintf(NULL, 256, Format, args_tmp);
- //Log("len = %i", len);
-
#if USE_RING_BUFFER || !CACHE_MESSAGES
{
char buf[sizeof(tLogEntry)+len+1];
#if USE_RING_BUFFER || !CACHE_MESSAGES
{
char buf[sizeof(tLogEntry)+len+1];
@@
-156,10
+156,14
@@
void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args
*/
void Log_Int_PrintMessage(tLogEntry *Entry)
{
*/
void Log_Int_PrintMessage(tLogEntry *Entry)
{
+ if( CPU_HAS_LOCK(&glLogOutput) )
+ return ; // TODO: Error?
SHORTLOCK( &glLogOutput );
SHORTLOCK( &glLogOutput );
- LogF("%s%014lli
%s [%-8s] %i - %s
",
+ LogF("%s%014lli",
csaLevelColours[Entry->Level],
csaLevelColours[Entry->Level],
- Entry->Time,
+ Entry->Time
+ );
+ LogF("%s [%-8s] %i - %s",
csaLevelCodes[Entry->Level],
Entry->Ident,
Threads_GetTID(),
csaLevelCodes[Entry->Level],
Entry->Ident,
Threads_GetTID(),
UCC
git Repository :: git.ucc.asn.au