Changeset 82190 in vbox for trunk/src/VBox/Devices/Input/DevPS2.cpp
- Timestamp:
- Nov 25, 2019 5:44:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/DevPS2.cpp
r82189 r82190 745 745 } 746 746 747 /** 748 * Retrieve a byte from a queue. 749 * 750 * @param pQ Pointer to the queue. 751 * @param pVal Pointer to storage for the byte. 752 * 753 * @retval VINF_TRY_AGAIN if queue is empty, 754 * @retval VINF_SUCCESS if a byte was read. 755 */ 756 int PS2CmnRemoveQueue(GeneriQ *pQ, uint8_t *pVal) 757 { 758 int rc; 759 760 Assert(pVal); 761 if (pQ->cUsed) 762 { 763 *pVal = pQ->abQueue[pQ->rpos]; 764 if (++pQ->rpos == pQ->cSize) 765 pQ->rpos = 0; /* Roll over. */ 766 --pQ->cUsed; 767 LogFlowFunc(("removed 0x%02X from queue %p\n", *pVal, pQ)); 768 rc = VINF_SUCCESS; 769 } 770 else 771 { 772 LogFlowFunc(("queue %p empty\n", pQ)); 773 rc = VINF_TRY_AGAIN; 774 } 775 return rc; 776 } 777 747 778 #ifdef IN_RING3 748 779 … … 778 809 * @param pQ Pointer to the queue. 779 810 * 780 * @return intVBox status/error code.811 * @returns VBox status/error code. 781 812 */ 782 813 int PS2CmnR3LoadQueue(PCPDMDEVHLPR3 pHlp, PSSMHANDLE pSSM, GeneriQ *pQ)
Note:
See TracChangeset
for help on using the changeset viewer.