Lines Matching defs:pQ

472  * @param   pQ                  Pointer to the queue.
474 static void ps2kClearQueue(GeneriQ *pQ)
476 LogFlowFunc(("Clearing queue %p\n", pQ));
477 pQ->wpos = pQ->rpos;
478 pQ->cUsed = 0;
485 * @param pQ Pointer to the queue.
488 static void ps2kInsertQueue(GeneriQ *pQ, uint8_t val)
491 if (pQ->cUsed >= pQ->cSize)
493 LogFlowFunc(("queue %p full (%d entries)\n", pQ, pQ->cUsed));
497 pQ->abQueue[pQ->wpos] = val;
498 if (++pQ->wpos == pQ->cSize)
499 pQ->wpos = 0; /* Roll over. */
500 ++pQ->cUsed;
501 LogFlowFunc(("inserted 0x%02X into queue %p\n", val, pQ));
510 * @param pQ Pointer to the queue.
512 static void ps2kSaveQueue(PSSMHANDLE pSSM, GeneriQ *pQ)
514 uint32_t cItems = pQ->cUsed;
522 LogFlow(("Storing %d items from queue %p\n", cItems, pQ));
525 for (i = pQ->rpos; cItems-- > 0; i = (i + 1) % pQ->cSize)
526 SSMR3PutU8(pSSM, pQ->abQueue[i]);
533 * @param pQ Pointer to the queue.
537 static int ps2kLoadQueue(PSSMHANDLE pSSM, GeneriQ *pQ)
540 int rc = SSMR3GetU32(pSSM, &pQ->cUsed);
542 LogFlow(("Loading %u items to queue %p\n", pQ->cUsed, pQ));
543 AssertMsgReturn(pQ->cUsed <= pQ->cSize, ("Saved size=%u, actual=%u\n", pQ->cUsed, pQ->cSize),
547 pQ->rpos = 0;
548 pQ->wpos = pQ->cUsed;
549 rc = SSMR3GetMem(pSSM, pQ->abQueue, pQ->cUsed);
580 * @param pQ Pointer to the queue.
586 static int ps2kRemoveQueue(GeneriQ *pQ, uint8_t *pVal)
591 if (pQ->cUsed)
593 *pVal = pQ->abQueue[pQ->rpos];
594 if (++pQ->rpos == pQ->cSize)
595 pQ->rpos = 0; /* Roll over. */
596 --pQ->cUsed;
598 LogFlowFunc(("removed 0x%02X from queue %p\n", *pVal, pQ));
600 LogFlowFunc(("queue %p empty\n", pQ));