Lines Matching defs:tail
68 const UInt32 tail = dataQueue->tail;
74 if ( tail >= head )
77 if ( (tail + entrySize) <= getQueueSize() )
79 entry = (IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail);
84 // The tail can be out of bound when the size of the new entry
86 // The tail can range from 0 to getQueueSize() inclusive.
89 OSAddAtomic(entrySize, (SInt32 *)&dataQueue->tail);
93 // Wrap around to the beginning, but do not allow the tail to catch
102 if ( ( getQueueSize() - tail ) >= DATA_QUEUE_ENTRY_HEADER_SIZE )
104 ((IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail))->size = dataSize;
110 OSCompareAndSwap(dataQueue->tail, entrySize, &dataQueue->tail);
120 // Do not allow the tail to catch up to the head when the queue is full.
123 if ( (head - tail) > entrySize )
125 entry = (IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail);
131 OSAddAtomic(entrySize, (SInt32 *)&dataQueue->tail);
142 if ( ( head == tail ) || ( dataQueue->head == tail ) || queueFull) {
159 if (dataQueue->head != dataQueue->tail)