Lines Matching defs:dataQueue
48 IODataQueue *dataQueue = new IODataQueue;
50 if (dataQueue) {
51 if (!dataQueue->initWithCapacity(size)) {
52 dataQueue->release();
53 dataQueue = 0;
57 return dataQueue;
62 IODataQueue *dataQueue = new IODataQueue;
64 if (dataQueue) {
65 if (!dataQueue->initWithEntries(numEntries, entrySize)) {
66 dataQueue->release();
67 dataQueue = 0;
71 return dataQueue;
80 dataQueue = (IODataQueueMemory *)IOMallocAligned(round_page_32(size + DATA_QUEUE_MEMORY_HEADER_SIZE), PAGE_SIZE);
81 if (dataQueue == 0) {
85 dataQueue->queueSize = size;
86 dataQueue->head = 0;
87 dataQueue->tail = 0;
99 if (dataQueue) {
100 IOFreeAligned(dataQueue, round_page_32(dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE));
110 const UInt32 head = dataQueue->head; // volatile
111 const UInt32 tail = dataQueue->tail;
118 if ( (tail + entrySize) <= dataQueue->queueSize )
120 entry = (IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail);
127 // The tail can range from 0 to dataQueue->queueSize inclusive.
129 dataQueue->tail += entrySize;
136 dataQueue->queue->size = dataSize;
142 if ( ( dataQueue->queueSize - tail ) >= DATA_QUEUE_ENTRY_HEADER_SIZE )
144 ((IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail))->size = dataSize;
147 memcpy(&dataQueue->queue->data, data, dataSize);
148 dataQueue->tail = entrySize;
162 entry = (IODataQueueEntry *)((UInt8 *)dataQueue->queue + tail);
166 dataQueue->tail += entrySize;
177 || ( dataQueue->head == tail ) ) /* queue was emptied during enqueue() */
228 if (dataQueue != 0) {
229 descriptor = IOMemoryDescriptor::withAddress(dataQueue, dataQueue->queueSize + DATA_QUEUE_MEMORY_HEADER_SIZE, kIODirectionOutIn);