Changeset 55421 in vbox for trunk/src/VBox/Devices/Graphics/HGSMI
- Timestamp:
- Apr 24, 2015 12:00:21 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99763
- Location:
- trunk/src/VBox/Devices/Graphics/HGSMI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
r55401 r55421 67 67 68 68 #include <VBox/err.h> 69 #define LOG_GROUP LOG_GROUP_ DEV_VGA69 #define LOG_GROUP LOG_GROUP_HGSMI 70 70 #include <VBox/log.h> 71 71 #include <VBox/vmm/ssm.h> … … 133 133 134 134 135 /* Host heap types. */ 136 #define HGSMI_HEAP_TYPE_NULL 0 /* Heap not initialized. */ 137 #define HGSMI_HEAP_TYPE_POINTER 1 /* Deprecated, used only for old saved states. RTHEAPSIMPLE. */ 138 #define HGSMI_HEAP_TYPE_OFFSET 2 /* Deprecated, used only for old saved states. RTHEAPOFFSET. */ 139 #define HGSMI_HEAP_TYPE_MA 3 /* Memory allocator. */ 140 141 typedef struct HGSMIHOSTHEAP 142 { 143 uint32_t u32HeapType; /* HGSMI_HEAP_TYPE_* */ 144 int32_t volatile cRefs; /* How many blocks allocated. */ 145 HGSMIAREA area; /* Host heap location. */ 146 union 147 { 148 HGSMIMADATA ma; /* Memory allocator for the default host heap implementation. */ 149 struct /* Legacy heap implementations. For old saved states. */ 150 { 151 union 152 { 153 RTHEAPSIMPLE hPtr; /* Pointer based heap. */ 154 RTHEAPOFFSET hOff; /* Offset based heap. */ 155 } u; 156 } legacy; 157 } u; 158 } HGSMIHOSTHEAP; 159 135 160 typedef struct HGSMIINSTANCE 136 161 { … … 142 167 143 168 HGSMIAREA area; /* The shared memory description. */ 144 HGSMIH EAP hostHeap;/* Host heap instance. */169 HGSMIHOSTHEAP hostHeap; /* Host heap instance. */ 145 170 RTCRITSECT hostHeapCritSect; /* Heap serialization lock. */ 146 171 … … 182 207 volatile uint32_t fl; /* Status flags of the entry. */ 183 208 184 HGSMIOFFSET offBuffer; /* Offset in the memory region of the entry data. */ 209 HGSMIOFFSET offBuffer; /* Offset of the HGSMI buffer header in the HGSMI host heap: 210 * [pIns->hostHeap.area.offBase .. offLast]. */ 185 211 186 212 #if 0 … … 510 536 } 511 537 538 static HGSMIOFFSET hgsmiHostHeapOffset(HGSMIHOSTHEAP *pHeap) 539 { 540 return pHeap->area.offBase; 541 } 542 543 static HGSMISIZE hgsmiHostHeapSize(HGSMIHOSTHEAP *pHeap) 544 { 545 return pHeap->area.cbArea; 546 } 547 548 static void *hgsmiHostHeapBufferAlloc(HGSMIHOSTHEAP *pHeap, 549 HGSMISIZE cbBuffer) 550 { 551 void *pvBuf = NULL; 552 553 if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_MA) 554 { 555 pvBuf = HGSMIMAAlloc(&pHeap->u.ma, cbBuffer); 556 } 557 else if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_POINTER) 558 { 559 pvBuf = RTHeapSimpleAlloc(pHeap->u.legacy.u.hPtr, cbBuffer, 0); 560 } 561 else if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_OFFSET) 562 { 563 pvBuf = RTHeapOffsetAlloc(pHeap->u.legacy.u.hOff, cbBuffer, 0); 564 } 565 566 if (pvBuf) 567 { 568 ++pHeap->cRefs; 569 } 570 571 return pvBuf; 572 } 573 574 static void hgsmiHostHeapBufferFree(HGSMIHOSTHEAP *pHeap, 575 void *pvBuf) 576 { 577 if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_MA) 578 { 579 HGSMIMAFree(&pHeap->u.ma, pvBuf); 580 } 581 else if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_POINTER) 582 { 583 RTHeapSimpleFree(pHeap->u.legacy.u.hPtr, pvBuf); 584 } 585 else if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_OFFSET) 586 { 587 RTHeapOffsetFree(pHeap->u.legacy.u.hOff, pvBuf); 588 } 589 --pHeap->cRefs; 590 } 591 592 static void *hgsmiHostHeapDataAlloc(HGSMIHOSTHEAP *pHeap, 593 HGSMISIZE cbData, 594 uint8_t u8Channel, 595 uint16_t u16ChannelInfo) 596 { 597 HGSMISIZE cbAlloc = HGSMIBufferRequiredSize(cbData); 598 HGSMIBUFFERHEADER *pHeader = (HGSMIBUFFERHEADER *)hgsmiHostHeapBufferAlloc(pHeap, cbAlloc); 599 if (!pHeader) 600 return NULL; 601 602 HGSMIBufferInitializeSingle(&pHeap->area, pHeader, cbAlloc, u8Channel, u16ChannelInfo); 603 604 return HGSMIBufferDataFromPtr(pHeader); 605 } 606 607 static void hgsmiHostHeapDataFree(HGSMIHOSTHEAP *pHeap, 608 void *pvData) 609 { 610 if ( pvData 611 && pHeap->u32HeapType != HGSMI_HEAP_TYPE_NULL) 612 { 613 HGSMIBUFFERHEADER *pHeader = HGSMIBufferHeaderFromData(pvData); 614 hgsmiHostHeapBufferFree(pHeap, pHeader); 615 } 616 } 617 618 /* Needed for heap relocation: offset of the heap handle relative to the start of heap area. */ 619 static HGSMIOFFSET hgsmiHostHeapHandleLocationOffset(HGSMIHOSTHEAP *pHeap) 620 { 621 HGSMIOFFSET offHeapHandle; 622 if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_POINTER) 623 { 624 offHeapHandle = (HGSMIOFFSET)((uintptr_t)pHeap->u.legacy.u.hPtr - (uintptr_t)pHeap->area.pu8Base); 625 } 626 else if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_OFFSET) 627 { 628 offHeapHandle = (HGSMIOFFSET)((uintptr_t)pHeap->u.legacy.u.hOff - (uintptr_t)pHeap->area.pu8Base); 629 } 630 else 631 { 632 offHeapHandle = HGSMIOFFSET_VOID; 633 } 634 return offHeapHandle; 635 } 636 637 static int hgsmiHostHeapRelocate(HGSMIHOSTHEAP *pHeap, 638 uint32_t u32HeapType, 639 void *pvBase, 640 uint32_t offHeapHandle, 641 uintptr_t offDelta, 642 HGSMISIZE cbArea, 643 HGSMIOFFSET offBase) 644 { 645 int rc = HGSMIAreaInitialize(&pHeap->area, pvBase, cbArea, offBase); 646 if (RT_SUCCESS(rc)) 647 { 648 if (u32HeapType == HGSMI_HEAP_TYPE_OFFSET) 649 { 650 pHeap->u.legacy.u.hOff = (RTHEAPOFFSET)((uint8_t *)pvBase + offHeapHandle); 651 } 652 else if (u32HeapType == HGSMI_HEAP_TYPE_POINTER) 653 { 654 pHeap->u.legacy.u.hPtr = (RTHEAPSIMPLE)((uint8_t *)pvBase + offHeapHandle); 655 rc = RTHeapSimpleRelocate(pHeap->u.legacy.u.hPtr, offDelta); AssertRC(rc); 656 } 657 else 658 { 659 /* HGSMI_HEAP_TYPE_MA does not need the relocation. */ 660 rc = VERR_NOT_SUPPORTED; 661 } 662 663 if (RT_SUCCESS(rc)) 664 { 665 pHeap->u32HeapType = u32HeapType; 666 } 667 else 668 { 669 HGSMIAreaClear(&pHeap->area); 670 } 671 } 672 673 return rc; 674 } 675 676 static int hgsmiHostHeapRestoreMA(HGSMIHOSTHEAP *pHeap, 677 void *pvBase, 678 HGSMISIZE cbArea, 679 HGSMIOFFSET offBase, 680 uint32_t cBlocks, 681 HGSMIOFFSET *paDescriptors, 682 HGSMISIZE cbMaxBlock, 683 HGSMIENV *pEnv) 684 { 685 int rc = HGSMIAreaInitialize(&pHeap->area, pvBase, cbArea, offBase); 686 if (RT_SUCCESS(rc)) 687 { 688 rc = HGSMIMAInit(&pHeap->u.ma, &pHeap->area, paDescriptors, cBlocks, cbMaxBlock, pEnv); 689 690 if (RT_FAILURE(rc)) 691 { 692 HGSMIAreaClear(&pHeap->area); 693 } 694 } 695 696 return rc; 697 } 698 699 static void hgsmiHostHeapSetupUninitialized(HGSMIHOSTHEAP *pHeap) 700 { 701 RT_ZERO(*pHeap); 702 pHeap->u32HeapType = HGSMI_HEAP_TYPE_NULL; 703 } 704 705 static void hgsmiHostHeapDestroy(HGSMIHOSTHEAP *pHeap) 706 { 707 if (pHeap->u32HeapType == HGSMI_HEAP_TYPE_MA) 708 { 709 HGSMIMAUninit(&pHeap->u.ma); 710 } 711 hgsmiHostHeapSetupUninitialized(pHeap); 712 } 713 512 714 static int hgsmiHostFIFOAlloc (HGSMIINSTANCE *pIns, HGSMIHOSTFIFOENTRY **ppEntry) 513 715 { … … 557 759 static int hgsmiHostCommandFreeByEntry (HGSMIHOSTFIFOENTRY *pEntry) 558 760 { 761 LogFlowFunc(("offBuffer 0x%08X\n", pEntry->offBuffer)); 762 559 763 HGSMIINSTANCE *pIns = pEntry->pIns; 560 764 int rc = hgsmiFIFOLock (pIns); … … 564 768 hgsmiFIFOUnlock (pIns); 565 769 566 void *pv Mem = HGSMIBufferDataFromOffset(&pIns->area, pEntry->offBuffer);770 void *pvData = HGSMIBufferDataFromOffset(&pIns->hostHeap.area, pEntry->offBuffer); 567 771 568 772 rc = hgsmiHostHeapLock (pIns); … … 570 774 { 571 775 /* Deallocate the host heap memory. */ 572 HGSMIHeapFree (&pIns->hostHeap, pvMem);776 hgsmiHostHeapDataFree(&pIns->hostHeap, pvData); 573 777 574 778 hgsmiHostHeapUnlock(pIns); … … 577 781 hgsmiHostFIFOFree (pIns, pEntry); 578 782 } 783 784 LogFlowFunc(("%Rrc\n", rc)); 579 785 return rc; 580 786 } 581 787 582 788 static int hgsmiHostCommandFree (HGSMIINSTANCE *pIns, 583 void *pvMem) 584 { 585 HGSMIOFFSET offMem = HGSMIHeapBufferOffset (&pIns->hostHeap, pvMem); 789 void *pvData) 790 { 586 791 int rc = VINF_SUCCESS; 587 if (offMem != HGSMIOFFSET_VOID) 588 { 792 if (HGSMIAreaContainsPointer(&pIns->hostHeap.area, pvData)) 793 { 794 HGSMIHOSTFIFOENTRY *pEntry = NULL; 795 HGSMIOFFSET offBuffer = HGSMIBufferOffsetFromData(&pIns->hostHeap.area, pvData); 796 589 797 rc = hgsmiFIFOLock (pIns); 590 798 if(RT_SUCCESS(rc)) 591 799 { 592 /* Search the Processed list for the given offMem. */ 593 HGSMIHOSTFIFOENTRY *pEntry = NULL; 594 800 /* Search the Processed list for the given offBuffer. */ 595 801 HGSMIHOSTFIFOENTRY *pIter; 596 802 RTListForEach(&pIns->hostFIFOProcessed, pIter, HGSMIHOSTFIFOENTRY, nodeEntry) … … 598 804 Assert(pIter->fl == (HGSMI_F_HOST_FIFO_ALLOCATED | HGSMI_F_HOST_FIFO_PROCESSED)); 599 805 600 if (pIter->offBuffer == off Mem)806 if (pIter->offBuffer == offBuffer) 601 807 { 602 808 pEntry = pIter; … … 611 817 else 612 818 { 613 LogRel(("HGSMI[%s]: the host frees unprocessed FIFO entry: 0x%08X\n", pIns->pszName, offMem));614 AssertFailed ();819 AssertLogRelMsgFailed(("HGSMI[%s]: the host frees unprocessed FIFO entry: 0x%08X\n", 820 pIns->pszName, offBuffer)); 615 821 } 616 822 … … 621 827 { 622 828 /* Deallocate the host heap memory. */ 623 HGSMIHeapFree (&pIns->hostHeap, pvMem);829 hgsmiHostHeapDataFree(&pIns->hostHeap, pvData); 624 830 625 831 hgsmiHostHeapUnlock(pIns); … … 636 842 else 637 843 { 844 AssertLogRelMsgFailed(("HGSMI[%s]: the host frees invalid FIFO entry: %p\n", 845 pIns->pszName, pvData)); 638 846 rc = VERR_INVALID_POINTER; 639 LogRel(("HGSMI[%s]: the host frees invalid FIFO entry: %p\n", pIns->pszName, pvMem));640 AssertFailed ();641 847 } 642 848 return rc; … … 776 982 #endif 777 983 /** 778 * Allocate a shared memory block. The host can write command/data to the memory. 779 * 780 * @param pIns Pointer to HGSMI instance, 781 * @param ppvMem Where to store the allocated memory pointer to data. 782 * @param cbMem How many bytes of data to allocate. 984 * Allocate a shared memory buffer. The host can write command/data to the memory. 985 * The allocated buffer contains the 'header', 'data' and the 'tail', but *ppvData 986 * will point to the 'data'. 987 * 988 * @return VBox status code. Pointer to the payload data in *ppvData. 989 * @param pIns HGSMI instance, 990 * @param ppvData Where to store the allocated memory pointer to data. 991 * @param cbData How many bytes of data to allocate. 992 * @param u8Channel HGSMI channel. 993 * @param u16ChannelInfo Command parameter. 783 994 */ 784 995 int HGSMIHostCommandAlloc (HGSMIINSTANCE *pIns, 785 void **ppv Mem,786 HGSMISIZE cb Mem,996 void **ppvData, 997 HGSMISIZE cbData, 787 998 uint8_t u8Channel, 788 999 uint16_t u16ChannelInfo) 789 1000 { 790 LogFlowFunc (("pIns = %p, cb Mem = 0x%08X(%d)\n", pIns, cbMem, cbMem));1001 LogFlowFunc (("pIns = %p, cbData = 0x%08X(%d)\n", pIns, cbData, cbData)); 791 1002 792 1003 int rc = hgsmiHostHeapLock (pIns); 793 1004 if(RT_SUCCESS(rc)) 794 1005 { 795 void *pv Mem = HGSMIHeapAlloc(&pIns->hostHeap,796 cbMem,797 u8Channel,798 u16ChannelInfo);1006 void *pvData = hgsmiHostHeapDataAlloc(&pIns->hostHeap, 1007 cbData, 1008 u8Channel, 1009 u16ChannelInfo); 799 1010 hgsmiHostHeapUnlock(pIns); 800 1011 801 if (pv Mem)802 { 803 *ppv Mem = pvMem;1012 if (pvData) 1013 { 1014 *ppvData = pvData; 804 1015 } 805 1016 else 806 1017 { 807 LogRel((0, "HGSMIHeapAlloc: HGSMIHeapAlloc failed\n")); 808 rc = VERR_GENERAL_FAILURE; 809 } 810 } 811 812 LogFlowFunc (("rc = %Rrc, pvMem = %p\n", rc, *ppvMem)); 813 1018 LogRel(("HGSMI[%s]: host heap allocation failed %dbytes\n", pIns->pszName, cbData)); 1019 rc = VERR_NO_MEMORY; 1020 } 1021 } 1022 1023 LogFlowFunc(("%Rrc, pvData = %p\n", rc, *ppvData)); 814 1024 return rc; 815 1025 } … … 819 1029 * and make it freed on completion. 820 1030 * The caller does not get notified in any way on command completion, 821 * on success return the pvMem buffer can not be used after being passed to this function 822 * 823 * @param pIns Pointer to HGSMI instance, 824 * @param pvMem The pointer returned by 'HGSMIHostCommandAlloc'. 825 * @param bDoIrq specifies whether the guest interrupt should be generated, 826 * i.e. in case the command is not urgent(e.g. some guest command completion notification that does not require post-processing) 827 * the command could be posted without raising an irq. 1031 * on successful return the pvData buffer can not be used after being passed to this function. 1032 * 1033 * @param pIns HGSMI instance, 1034 * @param pvData The pointer returned by 'HGSMIHostCommandAlloc'. 1035 * @param bDoIrq Specifies whether the guest interrupt should be generated. 1036 * In case the command is not urgent (e.g. some guest command 1037 * completion notification that does not require post-processing) 1038 * the command could be posted without raising an irq. 828 1039 */ 829 1040 int HGSMIHostCommandProcessAndFreeAsynch (PHGSMIINSTANCE pIns, 830 void *pv Mem,1041 void *pvData, 831 1042 bool bDoIrq) 832 1043 { 833 LogFlowFunc(("pIns = %p, pv Mem = %p\n", pIns, pvMem));1044 LogFlowFunc(("pIns = %p, pvData = %p\n", pIns, pvData)); 834 1045 835 1046 #if 0 … … 837 1048 #endif 838 1049 839 HGSMIOFFSET offBuffer = HGSMI HeapBufferOffset (&pIns->hostHeap, pvMem);1050 HGSMIOFFSET offBuffer = HGSMIBufferOffsetFromData(&pIns->hostHeap.area, pvData); 840 1051 841 1052 int rc = hgsmiHostCommandProcess (pIns, offBuffer, … … 925 1136 }; 926 1137 927 int HGSMI SetupHostHeap(PHGSMIINSTANCE pIns,928 929 1138 int HGSMIHostHeapSetup(PHGSMIINSTANCE pIns, 1139 HGSMIOFFSET offHeap, 1140 HGSMISIZE cbHeap) 930 1141 { 931 1142 LogFlowFunc(("pIns %p, offHeap 0x%08X, cbHeap = 0x%08X\n", pIns, offHeap, cbHeap)); … … 933 1144 int rc = VINF_SUCCESS; 934 1145 935 Assert (pIns); 936 937 // if ( offHeap >= pIns->cbMem 938 // || cbHeap > pIns->cbMem 939 // || offHeap + cbHeap > pIns->cbMem) 940 // { 941 // rc = VERR_INVALID_PARAMETER; 942 // } 943 // else 1146 AssertPtrReturn(pIns, VERR_INVALID_PARAMETER); 1147 1148 if ( offHeap >= pIns->area.cbArea 1149 || cbHeap > pIns->area.cbArea 1150 || offHeap > pIns->area.cbArea - cbHeap) 1151 { 1152 AssertLogRelMsgFailed(("offHeap 0x%08X, cbHeap = 0x%08X, pIns->area.cbArea 0x%08X\n", 1153 offHeap, cbHeap, pIns->area.cbArea)); 1154 rc = VERR_INVALID_PARAMETER; 1155 } 1156 else 944 1157 { 945 1158 rc = hgsmiHostHeapLock (pIns); … … 949 1162 if (pIns->hostHeap.cRefs) 950 1163 { 951 AssertFailed(); 1164 AssertLogRelMsgFailed(("HGSMI[%s]: host heap setup ignored. %d allocated.\n", 1165 pIns->pszName, pIns->hostHeap.cRefs)); 952 1166 /* It is possible to change the heap only if there is no pending allocations. */ 953 1167 rc = VERR_ACCESS_DENIED; … … 955 1169 else 956 1170 { 957 rc = HGSMIHeapSetup (&pIns->hostHeap, 958 HGSMI_HEAP_TYPE_MA, 959 pIns->area.pu8Base+offHeap, 960 cbHeap, 961 offHeap, 962 &g_hgsmiEnv); 1171 rc = HGSMIAreaInitialize(&pIns->hostHeap.area, pIns->area.pu8Base + offHeap, cbHeap, offHeap); 1172 if (RT_SUCCESS(rc)) 1173 { 1174 rc = HGSMIMAInit(&pIns->hostHeap.u.ma, &pIns->hostHeap.area, NULL, 0, 0, &g_hgsmiEnv); 1175 } 1176 1177 if (RT_SUCCESS(rc)) 1178 { 1179 pIns->hostHeap.u32HeapType = HGSMI_HEAP_TYPE_MA; 1180 } 1181 else 1182 { 1183 HGSMIAreaClear(&pIns->hostHeap.area); 1184 } 963 1185 } 964 1186 … … 1205 1427 off = pIns->hostHeap.u32HeapType == HGSMI_HEAP_TYPE_MA? 1206 1428 0: 1207 HGSMIHeapHandleLocationOffset(&pIns->hostHeap);1429 hgsmiHostHeapHandleLocationOffset(&pIns->hostHeap); 1208 1430 rc = SSMR3PutU32 (pSSM, off); 1209 1431 if(off != HGSMIOFFSET_VOID) 1210 1432 { 1211 SSMR3PutU32 (pSSM, HGSMIHeapOffset(&pIns->hostHeap));1212 SSMR3PutU32 (pSSM, HGSMIHeapSize(&pIns->hostHeap));1433 SSMR3PutU32 (pSSM, hgsmiHostHeapOffset(&pIns->hostHeap)); 1434 SSMR3PutU32 (pSSM, hgsmiHostHeapSize(&pIns->hostHeap)); 1213 1435 /* need save mem pointer to calculate offset on restore */ 1214 1436 SSMR3PutU64 (pSSM, (uint64_t)(uintptr_t)pIns->area.pu8Base); … … 1261 1483 pIns->pHGFlags = (off != HGSMIOFFSET_VOID) ? (HGSMIHOSTFLAGS*)HGSMIOffsetToPointer (&pIns->area, off) : NULL; 1262 1484 1263 HGSMIH EAP hHeap = pIns->hostHeap;1485 HGSMIHOSTHEAP hHeap = pIns->hostHeap; 1264 1486 rc = SSMR3GetU32(pSSM, &off); 1265 1487 AssertRCReturn(rc, rc); … … 1311 1533 if (RT_SUCCESS(rc)) 1312 1534 { 1313 rc = HGSMIHeapRestoreMA(&pIns->hostHeap,1314 pIns->area.pu8Base+offHeap,1315 cbHeap,1316 offHeap,1317 cBlocks,1318 paDescriptors,1319 cbMaxBlock,1320 &g_hgsmiEnv);1535 rc = hgsmiHostHeapRestoreMA(&pIns->hostHeap, 1536 pIns->area.pu8Base+offHeap, 1537 cbHeap, 1538 offHeap, 1539 cBlocks, 1540 paDescriptors, 1541 cbMaxBlock, 1542 &g_hgsmiEnv); 1321 1543 1322 1544 RTMemFree(paDescriptors); … … 1332 1554 pIns->hostHeap.cRefs = 0; 1333 1555 1334 rc = HGSMIHeapRelocate(&pIns->hostHeap,1335 u32HeapType,1336 pIns->area.pu8Base+offHeap,1337 off,1338 uintptr_t(pIns->area.pu8Base) - uintptr_t(oldMem),1339 cbHeap,1340 offHeap);1556 rc = hgsmiHostHeapRelocate(&pIns->hostHeap, 1557 u32HeapType, 1558 pIns->area.pu8Base+offHeap, 1559 off, 1560 uintptr_t(pIns->area.pu8Base) - uintptr_t(oldMem), 1561 cbHeap, 1562 offHeap); 1341 1563 1342 1564 hgsmiHostHeapUnlock (pIns); … … 1534 1756 size_t cbContext) 1535 1757 { 1536 LogFlowFunc(("ppIns = %p, pVM = %p, pszName = [%s], pu8MemBase = %p, cbMem = 0x%08X, offMemBase= 0x%08X, "1758 LogFlowFunc(("ppIns = %p, pVM = %p, pszName = [%s], offBase = 0x%08X, pu8MemBase = %p, cbMem = 0x%08X, " 1537 1759 "pfnNotifyGuest = %p, pvNotifyGuest = %p, cbContext = %d\n", 1538 1760 ppIns, 1539 1761 pVM, 1540 1762 pszName, 1763 offBase, 1541 1764 pu8MemBase, 1542 1765 cbMem, … … 1585 1808 pIns->pszName = VALID_PTR(pszName)? pszName: ""; 1586 1809 1587 HGSMIHeapSetupUninitialized(&pIns->hostHeap);1810 hgsmiHostHeapSetupUninitialized(&pIns->hostHeap); 1588 1811 1589 1812 pIns->pfnNotifyGuest = pfnNotifyGuest; … … 1634 1857 #endif 1635 1858 1636 HGSMIHeapDestroy(&pIns->hostHeap); 1637 1638 HGSMIHeapSetupUninitialized(&pIns->hostHeap); 1859 hgsmiHostHeapDestroy(&pIns->hostHeap); 1639 1860 1640 1861 return flags; … … 1647 1868 if (pIns) 1648 1869 { 1649 HGSMIHeapDestroy(&pIns->hostHeap);1870 hgsmiHostHeapDestroy(&pIns->hostHeap); 1650 1871 1651 1872 if (RTCritSectIsInitialized (&pIns->hostHeapCritSect)) -
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.h
r55401 r55421 69 69 uint8_t *pu8Channel); 70 70 71 int HGSMI SetupHostHeap(PHGSMIINSTANCE pIns,72 73 71 int HGSMIHostHeapSetup(PHGSMIINSTANCE pIns, 72 HGSMIOFFSET offHeap, 73 HGSMISIZE cbHeap); 74 74 75 75 int HGSMISaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM); … … 107 107 /* Allocate a buffer in the host heap. */ 108 108 int HGSMIHostCommandAlloc (PHGSMIINSTANCE pIns, 109 void **ppv Mem,110 HGSMISIZE cb Mem,109 void **ppvData, 110 HGSMISIZE cbData, 111 111 uint8_t u8Channel, 112 112 uint16_t u16ChannelInfo); … … 116 116 117 117 int HGSMIHostCommandProcessAndFreeAsynch (PHGSMIINSTANCE pIns, 118 void *pv Mem,118 void *pvData, 119 119 bool bDoIrq); 120 120
Note:
See TracChangeset
for help on using the changeset viewer.