//------------------------------------------------------------------------------ tOplkError eventucal_postKernelEvent(tEvent* pEvent_p) { tOplkError ret; /*TRACE("U2K type:%s(%d) sink:%s(%d) size:%d!\n", debugstr_getEventTypeStr(pEvent_p->eventType), pEvent_p->eventType, debugstr_getEventSinkStr(pEvent_p->eventSink), pEvent_p->eventSink, pEvent_p->eventArgSize);*/ target_enableGlobalInterrupt(FALSE); ret = eventk_process(pEvent_p); target_enableGlobalInterrupt(TRUE); return ret; }
//------------------------------------------------------------------------------ static void leaveCriticalSection(int nType_p) { #if (TARGET_SYSTEM == _NO_OS_) UNUSED_PARAMETER(nType_p); target_enableGlobalInterrupt(TRUE); #elif (TARGET_SYSTEM == _WIN32_ || TARGET_SYSTEM == _WINCE_ ) LeaveCriticalSection(&timeruInstance_l.aCriticalSections[nType_p]); #endif }
//------------------------------------------------------------------------------ void circbuf_unlock(tCircBufInstance* pInstance_p) { if (pInstance_p->pCircBufArchInstance != NULL) { tCircBufHostiBuffer* pHostifBuf = GET_QUEUE_BUF_BASE(pInstance_p->pCircBufHeader); // Write unlock value to queue HOSTIF_WR8(&(pHostifBuf->lock), 0, CIRCBUF_HOSTIF_UNLOCK); } target_enableGlobalInterrupt(TRUE); }
//------------------------------------------------------------------------------ void circbuf_lock(tCircBufInstance* pInstance_p) { target_enableGlobalInterrupt(FALSE); if (pInstance_p->pCircBufArchInstance != NULL) { tCircBufHostiBuffer* pHostifBuf = GET_QUEUE_BUF_BASE(pInstance_p->pCircBufHeader); UINT8 lockValue; do { lockValue = HOSTIF_RD8(&(pHostifBuf->lock), 0); if (lockValue == CIRCBUF_HOSTIF_UNLOCK) { // Write lock value to queue HOSTIF_WR8(&(pHostifBuf->lock), 0, CIRCBUF_HOSTIF_LOCK); continue; } } while (lockValue != CIRCBUF_HOSTIF_LOCK); } }