Changeset 32457 in vbox
- Timestamp:
- Sep 13, 2010 3:51:34 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
r32322 r32457 445 445 } 446 446 447 /* Cleanup. */448 vboxguestwinCleanup(pDevObj);447 /* Don't do any cleanup here; there might be still coming in some IOCtls after we got this 448 * power action and would assert/crash when we already cleaned up all the stuff! */ 449 449 break; 450 450 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
r32443 r32457 62 62 RT_C_DECLS_BEGIN 63 63 #ifdef DEBUG 64 static VOID vboxguestwinDoTests(VOID);64 static void vboxguestwinDoTests(void); 65 65 #endif 66 66 RT_C_DECLS_END … … 278 278 * @param pResourceList list of device resources. 279 279 */ 280 static VOIDvboxguestwinShowDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList)280 static void vboxguestwinShowDeviceResources(PCM_PARTIAL_RESOURCE_LIST pResourceList) 281 281 { 282 282 #ifdef LOG_ENABLED … … 561 561 NTSTATUS vboxguestwinCreate(PDEVICE_OBJECT pDevObj, PIRP pIrp) 562 562 { 563 Log(("VBoxGuest::vboxguestwinGuestCreate\n"));564 565 563 /** @todo AssertPtrReturn(pIrp); */ 566 564 PIO_STACK_LOCATION pStack = IoGetCurrentIrpStackLocation(pIrp); … … 584 582 if (pFileObj) 585 583 { 584 Log(("VBoxGuest::vboxguestwinGuestCreate: File object type = %d\n", 585 pFileObj->Type)); 586 586 587 int vrc; 587 588 PVBOXGUESTSESSION pSession; … … 838 839 839 840 /** 840 * DPC handler 841 * 842 * @param dpcDPC descriptor.841 * DPC handler. 842 * 843 * @param pDPC DPC descriptor. 843 844 * @param pDevObj Device object. 844 * @param irpInterrupt request packet.845 * @param contextContext specific pointer.846 */ 847 VOIDvboxguestwinDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj,845 * @param pIrp Interrupt request packet. 846 * @param pContext Context specific pointer. 847 */ 848 void vboxguestwinDpcHandler(PKDPC pDPC, PDEVICE_OBJECT pDevObj, 848 849 PIRP pIrp, PVOID pContext) 849 850 { 850 /* Unblock handlers waiting for arrived events.851 *852 * Events are very low things, there is one event flag (1 or more bit)853 * for each event. Each event is processed by exactly one handler.854 *855 * Assume that we trust additions and that other drivers will856 * handle its respective events without trying to fetch all events.857 *858 * Anyway design assures that wrong event processing will affect only guest.859 *860 * Event handler calls VMMDev IOCTL for waiting an event.861 * It supplies event mask. IOCTL blocks on EventNotification.862 * Here we just signal an the EventNotification to all waiting863 * threads, the IOCTL handler analyzes events and either864 * return to caller or blocks again.865 *866 * If we do not have too many events this is a simple and good867 * approach. Other way is to have as many Event objects as the callers868 * and wake up only callers waiting for the specific event.869 *870 * Now with the 'wake up all' appoach we probably do not need the DPC871 * handler and can signal event directly from ISR.872 *873 */874 875 851 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pDevObj->DeviceExtension; 876 877 852 Log(("VBoxGuest::vboxguestwinGuestDpcHandler: pDevExt=0x%p\n", pDevExt)); 878 853 879 #ifdef VBOX_WITH_HGCM 880 if (pDevExt) 881 KePulseEvent(&pDevExt->win.s.hgcm.s.keventNotification, 0, FALSE); 882 #endif 854 /* Process the wake-up list we were asked by the scheduling a DPC 855 * in vboxguestwinIsrHandler(). */ 856 VBoxGuestWaitDoWakeUps(pDevExt); 883 857 } 884 858 … … 887 861 * ISR handler. 888 862 * 889 * @return BOOLEAN Indicates whether the IRQ came from us (TRUE) or not (FALSE).890 * @param interrupt Interrupt that was triggered.891 * @param serviceContext Context specific pointer.892 */ 893 BOOLEAN vboxguestwinIsrHandler(PKINTERRUPT interrupt, PVOID serviceContext)894 { 895 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT) serviceContext;863 * @return BOOLEAN Indicates whether the IRQ came from us (TRUE) or not (FALSE). 864 * @param pInterrupt Interrupt that was triggered. 865 * @param pServiceContext Context specific pointer. 866 */ 867 BOOLEAN vboxguestwinIsrHandler(PKINTERRUPT pInterrupt, PVOID pServiceContext) 868 { 869 PVBOXGUESTDEVEXT pDevExt = (PVBOXGUESTDEVEXT)pServiceContext; 896 870 BOOLEAN fIRQTaken = FALSE; 897 871 … … 899 873 pDevExt, pDevExt ? pDevExt->pVMMDevMemory : NULL));*/ 900 874 901 if (VBoxGuestCommonISR(pDevExt)) 902 { 903 /*Log(("VBoxGuest::vboxguestwinGuestIsrHandler: IRQ was taken! pDeviceObject = 0x%p, pCurrentIrp = 0x%p\n", 904 pDevExt->win.s.pDeviceObject, pDevExt->win.s.pCurrentIrp));*/ 905 875 /* Enter the common ISR routine and do the actual work. */ 876 fIRQTaken = VBoxGuestCommonISR(pDevExt); 877 878 /* If we need to wake up some events we do that in a DPC to make 879 * sure we're called at the right IRQL. */ 880 if (fIRQTaken && !RTListIsEmpty(&pDevExt->WakeUpList)) 906 881 IoRequestDpc(pDevExt->win.s.pDeviceObject, pDevExt->win.s.pCurrentIrp, NULL); 907 fIRQTaken = TRUE; 908 } 909 882 883 /*if (fIRQTaken) 884 Log(("VBoxGuest::vboxguestwinGuestIsrHandler: IRQ was taken! pDeviceObject = 0x%p, pCurrentIrp = 0x%p\n", 885 pDevExt->win.s.pDeviceObject, pDevExt->win.s.pCurrentIrp));*/ 910 886 return fIRQTaken; 911 887 } … … 1057 1033 1058 1034 1035 /** 1036 * Maps the I/O space from VMMDev to virtual kernel adress space. 1037 * 1038 * @return NTSTATUS 1039 * 1040 * @param pDevExt The device extension. 1041 * @param physicalAdr Physical address to map. 1042 * @param ulLength Length (in bytes) to map. 1043 * @param ppvMMIOBase Pointer of mapped I/O base. 1044 * @param pcbMMIO Length of mapped I/O base. 1045 */ 1059 1046 NTSTATUS vboxguestwinMapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt, PHYSICAL_ADDRESS physicalAdr, ULONG ulLength, 1060 1047 void **ppvMMIOBase, uint32_t *pcbMMIO) … … 1102 1089 1103 1090 1091 /** 1092 * Unmaps the VMMDev I/O range from kernel space. 1093 * 1094 * @param pDevExt The device extension. 1095 */ 1104 1096 void vboxguestwinUnmapVMMDevMemory(PVBOXGUESTDEVEXT pDevExt) 1105 1097 { … … 1151 1143 * bits. 1152 1144 */ 1153 static uint32_t guestAtomicBitsTestAndClear(void *pu32Bits, uint32_t u32Mask)1145 static uint32_t vboxugestwinAtomicBitsTestAndClear(void *pu32Bits, uint32_t u32Mask) 1154 1146 { 1155 1147 AssertPtrReturn(pu32Bits, 0); … … 1172 1164 } 1173 1165 1174 static VOID vboxguestwinTestAtomicTestAndClearBitsU32(uint32_t u32Mask, uint32_t u32Bits, 1166 1167 static void vboxguestwinTestAtomicTestAndClearBitsU32(uint32_t u32Mask, uint32_t u32Bits, 1175 1168 uint32_t u32Exp) 1176 1169 { 1177 1170 ULONG u32Bits2 = u32Bits; 1178 uint32_t u32Result = guestAtomicBitsTestAndClear(&u32Bits2, u32Mask);1171 uint32_t u32Result = vboxugestwinAtomicBitsTestAndClear(&u32Bits2, u32Mask); 1179 1172 if ( u32Result != u32Exp 1180 1173 || (u32Bits2 & u32Mask) … … 1187 1180 } 1188 1181 1189 static VOID vboxguestwinDoTests(VOID) 1182 1183 static void vboxguestwinDoTests() 1190 1184 { 1191 1185 vboxguestwinTestAtomicTestAndClearBitsU32(0x00, 0x23, 0);
Note:
See TracChangeset
for help on using the changeset viewer.