Changeset 75588 in vbox
- Timestamp:
- Nov 19, 2018 6:07:03 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126756
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r75547 r75588 107 107 * @return VBox status code. 108 108 */ 109 DECLR0VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, struct VMMDevMemory *pVMMDevMemory);109 DECLR0VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, VMMDevMemory *pVMMDevMemory, uint32_t *pfFeatures); 110 110 111 111 /** -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r75547 r75588 986 986 pDevExt->hGuestMappings = NIL_RTR0MEMOBJ; 987 987 pDevExt->EventSpinlock = NIL_RTSPINLOCK; 988 pDevExt->fHostFeatures = 0; 988 989 pDevExt->pIrqAckEvents = NULL; 989 990 pDevExt->PhysIrqAckEvents = NIL_RTCCPHYS; … … 1127 1128 */ 1128 1129 pDevExt->IOPortBase = IOPortBase; 1129 rc = VbglR0InitPrimary(pDevExt->IOPortBase, (VMMDevMemory *)pDevExt->pVMMDevMemory );1130 rc = VbglR0InitPrimary(pDevExt->IOPortBase, (VMMDevMemory *)pDevExt->pVMMDevMemory, &pDevExt->fHostFeatures); 1130 1131 if (RT_SUCCESS(rc)) 1131 1132 { 1132 rc = VbglR0GRAlloc((VMMDevRequestHeader **)&pDevExt->pIrqAckEvents, sizeof(VMMDevEvents), VMMDevReq_AcknowledgeEvents); 1133 VMMDevRequestHeader *pAckReq = NULL; 1134 rc = VbglR0GRAlloc(&pAckReq, sizeof(VMMDevEvents), VMMDevReq_AcknowledgeEvents); 1133 1135 if (RT_SUCCESS(rc)) 1134 1136 { 1135 pDevExt->PhysIrqAckEvents = VbglR0PhysHeapGetPhysAddr(p DevExt->pIrqAckEvents);1137 pDevExt->PhysIrqAckEvents = VbglR0PhysHeapGetPhysAddr(pAckReq); 1136 1138 Assert(pDevExt->PhysIrqAckEvents != 0); 1139 ASMCompilerBarrier(); /* linux + solaris already have IRQs hooked up at this point, so take care. */ 1140 pDevExt->pIrqAckEvents = (VMMDevEvents *)pAckReq; 1137 1141 1138 1142 rc = vgdrvReportGuestInfo(enmOSType); … … 1262 1266 1263 1267 /* 1268 * No more IRQs. 1269 */ 1270 pDevExt->pIrqAckEvents = NULL; /* Will be freed by VbglR0TerminatePrimary. */ 1271 ASMAtomicWriteU32(&pDevExt->fHostFeatures, 0); 1272 1273 /* 1264 1274 * Cleanup all the other resources. 1265 1275 */ … … 1279 1289 pDevExt->pVMMDevMemory = NULL; 1280 1290 pDevExt->IOPortBase = 0; 1281 pDevExt->pIrqAckEvents = NULL; /* Freed by VbglR0TerminatePrimary. */1282 1291 } 1283 1292 … … 1583 1592 * Destroys the VBoxGuest device extension. 1584 1593 * 1585 * The native code should call this before the driver is loaded,1594 * The native code should call this before the driver is unloaded, 1586 1595 * but don't call this on shutdown. 1587 1596 * … … 4362 4371 bool VGDrvCommonISR(PVBOXGUESTDEVEXT pDevExt) 4363 4372 { 4364 VMMDevEvents volatile *pReq = pDevExt->pIrqAckEvents;4373 VMMDevEvents volatile *pReq; 4365 4374 bool fMousePositionChanged = false; 4366 4375 int rc = 0; … … 4371 4380 * Make sure we've initialized the device extension. 4372 4381 */ 4373 if (RT_UNLIKELY(!pReq)) 4382 if (RT_LIKELY(pDevExt->fHostFeatures & VMMDEV_HVF_FAST_IRQ_ACK)) 4383 pReq = NULL; 4384 else if (RT_LIKELY((pReq = pDevExt->pIrqAckEvents) != NULL)) 4385 { /* likely */ } 4386 else 4374 4387 return false; 4375 4388 … … 4383 4396 { 4384 4397 /* 4385 * Acknowle gde events.4398 * Acknowledge events. 4386 4399 * We don't use VbglR0GRPerform here as it may take another spinlocks. 4387 4400 */ 4388 pReq->header.rc = VERR_INTERNAL_ERROR; 4389 pReq->events = 0; 4390 ASMCompilerBarrier(); 4391 ASMOutU32(pDevExt->IOPortBase + VMMDEV_PORT_OFF_REQUEST, (uint32_t)pDevExt->PhysIrqAckEvents); 4392 ASMCompilerBarrier(); /* paranoia */ 4393 if (RT_SUCCESS(pReq->header.rc)) 4394 { 4395 uint32_t fEvents = pReq->events; 4396 4401 uint32_t fEvents; 4402 if (!pReq) 4403 { 4404 fEvents = ASMInU32(pDevExt->IOPortBase + VMMDEV_PORT_OFF_REQUEST_FAST); 4405 ASMCompilerBarrier(); /* paranoia */ 4406 rc = fEvents != UINT32_MAX ? VINF_SUCCESS : VERR_INTERNAL_ERROR; 4407 } 4408 else 4409 { 4410 pReq->header.rc = VERR_INTERNAL_ERROR; 4411 pReq->events = 0; 4412 ASMCompilerBarrier(); 4413 ASMOutU32(pDevExt->IOPortBase + VMMDEV_PORT_OFF_REQUEST, (uint32_t)pDevExt->PhysIrqAckEvents); 4414 ASMCompilerBarrier(); /* paranoia */ 4415 fEvents = pReq->events; 4416 rc = pReq->header.rc; 4417 } 4418 if (RT_SUCCESS(rc)) 4419 { 4397 4420 Log3(("VGDrvCommonISR: acknowledge events succeeded %#RX32\n", fEvents)); 4398 4421 … … 4442 4465 } 4443 4466 else /* something is serious wrong... */ 4444 Log(("VGDrvCommonISR: acknowledge events failed rc=%Rrc (events=%#x)!!\n", 4445 pReq->header.rc, pReq->events)); 4467 Log(("VGDrvCommonISR: acknowledge events failed rc=%Rrc (events=%#x)!!\n", rc, fEvents)); 4446 4468 } 4447 4469 else … … 4479 4501 } 4480 4502 4481 Assert(rc == 0); 4482 NOREF(rc); 4503 AssertMsg(rc == 0, ("rc=%#x (%d)\n", rc, rc)); 4483 4504 return fOurIrq; 4484 4505 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
r70873 r75588 151 151 * semaphores as well as the event acking in the ISR. */ 152 152 RTSPINLOCK EventSpinlock; 153 /** Host feature flags (VMMDEV_HVF_XXX). */ 154 uint32_t fHostFeatures; 153 155 /** Preallocated VMMDevEvents for the IRQ handler. */ 154 156 VMMDevEvents *pIrqAckEvents; -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibInit.cpp
r72627 r75588 184 184 #ifdef VBGL_VBOXGUEST 185 185 186 DECL VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, VMMDevMemory *pVMMDevMemory)186 DECLR0VBGL(int) VbglR0InitPrimary(RTIOPORT portVMMDev, VMMDevMemory *pVMMDevMemory, uint32_t *pfFeatures) 187 187 { 188 188 int rc; … … 209 209 210 210 vbglR0QueryHostVersion(); 211 *pfFeatures = g_vbgldata.hostVersion.features; 211 212 return VINF_SUCCESS; 212 213 } … … 216 217 } 217 218 218 DECL VBGL(void) VbglR0TerminatePrimary(void)219 DECLR0VBGL(void) VbglR0TerminatePrimary(void) 219 220 { 220 221 vbglR0TerminateCommon(); … … 224 225 #else /* !VBGL_VBOXGUEST */ 225 226 226 DECL VBGL(int) VbglR0InitClient(void)227 DECLR0VBGL(int) VbglR0InitClient(void) 227 228 { 228 229 int rc; … … 269 270 } 270 271 271 DECL VBGL(void) VbglR0TerminateClient(void)272 DECLR0VBGL(void) VbglR0TerminateClient(void) 272 273 { 273 274 # ifdef VBOX_WITH_HGCM
Note:
See TracChangeset
for help on using the changeset viewer.