Changeset 93832 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Feb 17, 2022 5:45:10 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150035
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPIC.cpp
r93115 r93832 682 682 PDEVPICCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PDEVPICCC); 683 683 uint32_t iPic = (uint32_t)(uintptr_t)pvUser; 684 int rc; 684 685 685 686 Assert(iPic == 0 || iPic == 1); 686 687 if (cb == 1) 687 688 { 688 int rc;689 689 PIC_LOCK_RET(pDevIns, pThisCC, VINF_IOM_R3_IOPORT_READ); 690 690 *pu32 = pic_ioport_read(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort, &rc); … … 692 692 return rc; 693 693 } 694 else if (cb == 2) 695 { 696 uint8_t u8Lo, u8Hi = 0; 697 /* Manually split access. Probably not 100% accurate! */ 698 PIC_LOCK_RET(pDevIns, pThisCC, VINF_IOM_R3_IOPORT_READ); 699 u8Lo = pic_ioport_read(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort, &rc); 700 Assert(rc == VINF_SUCCESS); 701 if (!(offPort & 1)) 702 u8Hi = pic_ioport_read(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort + 1, &rc); 703 PIC_UNLOCK(pDevIns, pThisCC); 704 *pu32 = RT_MAKE_U16(u8Lo, u8Hi); 705 return rc; 706 } 694 707 return VERR_IOM_IOPORT_UNUSED; 695 708 } … … 704 717 PDEVPICCC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PDEVPICCC); 705 718 uint32_t iPic = (uint32_t)(uintptr_t)pvUser; 719 VBOXSTRICTRC rc; 706 720 707 721 Assert(iPic == 0 || iPic == 1); … … 709 723 if (cb == 1) 710 724 { 711 VBOXSTRICTRC rc;712 725 PIC_LOCK_RET(pDevIns, pThisCC, VINF_IOM_R3_IOPORT_WRITE); 713 726 rc = pic_ioport_write(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort, u32); 727 PIC_UNLOCK(pDevIns, pThisCC); 728 return rc; 729 } 730 else if (cb == 2) 731 { 732 PIC_LOCK_RET(pDevIns, pThisCC, VINF_IOM_R3_IOPORT_WRITE); 733 /* Manually split access. Probably not 100% accurate! */ 734 rc = pic_ioport_write(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort, RT_LOBYTE(u32)); 735 if (RT_SUCCESS(rc) && !(offPort & 1)) 736 rc = pic_ioport_write(pDevIns, pThis, pThisCC, &RT_SAFE_SUBSCRIPT(pThis->aPics, iPic), offPort + 1, RT_HIBYTE(u32)); 714 737 PIC_UNLOCK(pDevIns, pThisCC); 715 738 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.