void vappendPrintf(Logging *logging, const char *fmt, va_list arg) { efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#5b"); if (!intermediateLoggingBufferInited) { firmwareError("intermediateLoggingBufferInited not inited!"); return; } int is_locked = isLocked(); int icsr_vectactive = isIsrContext(); if (is_locked) { vappendPrintfI(logging, fmt, arg); } else { if (icsr_vectactive == 0) { chSysLock() ; vappendPrintfI(logging, fmt, arg); chSysUnlock() ; } else { chSysLockFromIsr() ; vappendPrintfI(logging, fmt, arg); chSysUnlockFromIsr() ; } } }
/** * this method acquires system lock to guard the shared intermediateLoggingBuffer memory stream */ void vappendPrintf(Logging *logging, const char *fmt, va_list arg) { efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#5b"); if (!intermediateLoggingBufferInited) { firmwareError("intermediateLoggingBufferInited not inited!"); return; } int wasLocked = lockAnyContext(); vappendPrintfI(logging, fmt, arg); if (!wasLocked) { unlockAnyContext(); } }