Lines Matching refs:Q

96 static void queueInit(MSG_QUEUE *Q, byte *Buffer, dword sizeBuffer) {  in queueInit()  argument
97 Q->Size = sizeBuffer; in queueInit()
98 Q->Base = Q->Head = Q->Tail = Buffer; in queueInit()
99 Q->High = Buffer + sizeBuffer; in queueInit()
100 Q->Wrap = NULL; in queueInit()
101 Q->Count = 0; in queueInit()
104 static byte *queueAllocMsg(MSG_QUEUE *Q, word size) { in queueAllocMsg() argument
116 if (Q->Tail == Q->Head) { in queueAllocMsg()
117 if (Q->Wrap || need > Q->Size) { in queueAllocMsg()
123 if (Q->Tail > Q->Head) { in queueAllocMsg()
124 if (Q->Tail + need <= Q->High) goto alloc; /* append */ in queueAllocMsg()
125 if (Q->Base + need > Q->Head) { in queueAllocMsg()
129 Q->Wrap = Q->Tail; in queueAllocMsg()
130 Q->Tail = Q->Base; in queueAllocMsg()
134 if (Q->Tail + need > Q->Head) { in queueAllocMsg()
139 Msg = (MSG_HEAD *)Q->Tail; in queueAllocMsg()
143 Q->Tail += need; in queueAllocMsg()
144 Q->Count += size; in queueAllocMsg()
151 static void queueFreeMsg(MSG_QUEUE *Q) { in queueFreeMsg() argument
154 word size = ((MSG_HEAD *)Q->Head)->Size & ~MSG_INCOMPLETE; in queueFreeMsg()
156 Q->Head += MSG_NEED(size); in queueFreeMsg()
157 Q->Count -= size; in queueFreeMsg()
159 if (Q->Wrap) { in queueFreeMsg()
160 if (Q->Head >= Q->Wrap) { in queueFreeMsg()
161 Q->Head = Q->Base; in queueFreeMsg()
162 Q->Wrap = NULL; in queueFreeMsg()
164 } else if (Q->Head >= Q->Tail) { in queueFreeMsg()
165 Q->Head = Q->Tail = Q->Base; in queueFreeMsg()
169 static byte *queuePeekMsg(MSG_QUEUE *Q, word *size) { in queuePeekMsg() argument
174 MSG_HEAD *Msg = (MSG_HEAD *)Q->Head; in queuePeekMsg()
176 if (((byte *)Msg == Q->Tail && !Q->Wrap) || in queuePeekMsg()