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() ; } } }
void unlockAnyContext(void) { if (isIsrContext()) { chSysUnlockFromIsr() ; } else { chSysUnlock() ; } }
void unlockAnyContext(void) { #if USE_PORT_LOCK port_unlock(); #else /* #if USE_PORT_LOCK */ if (isIsrContext()) { chSysUnlockFromISR() ; } else { chSysUnlock() ; } #endif /* #if USE_PORT_LOCK */ }
/** * @return TRUE if already in locked context */ bool lockAnyContext(void) { int alreadyLocked = isLocked(); if (alreadyLocked) return true; if (isIsrContext()) { chSysLockFromIsr() ; } else { chSysLock() ; } return false; }
/** * @return TRUE if already in locked context */ bool lockAnyContext(void) { int alreadyLocked = isLocked(); if (alreadyLocked) return true; #if USE_PORT_LOCK port_lock(); #else /* #if USE_PORT_LOCK */ if (isIsrContext()) { chSysLockFromISR() ; } else { chSysLock() ; } #endif /* #if USE_PORT_LOCK */ return false; }
void chVTSetAny(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) { if (isIsrContext()) { chSysLockFromIsr() ; if (chVTIsArmedI(vtp)) chVTResetI(vtp); chVTSetI(vtp, time, vtfunc, par); chSysUnlockFromIsr() ; } else { chSysLock() ; if (chVTIsArmedI(vtp)) chVTResetI(vtp); chVTSetI(vtp, time, vtfunc, par); chSysUnlock() ; } }