Changeset 64650 in vbox for trunk/src/VBox
- Timestamp:
- Nov 11, 2016 2:55:07 PM (8 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r64337 r64650 44 44 HGSMIBUFFERHEADER *pHdr = HGSMIBufferHeaderFromData(pvMem); 45 45 HGSMIOFFSET offMem = HGSMIPointerToOffset(&pCtx->areaCtx, pHdr); 46 Assert(offMem != HGSMIOFFSET_VOID);46 VBVOAssert(offMem != HGSMIOFFSET_VOID); 47 47 if(offMem != HGSMIOFFSET_VOID) 48 48 { … … 57 57 { 58 58 int rc = HGSMIBufferProcess(&pCtx->areaCtx, &pCtx->channels, offBuffer); 59 Assert(!RT_FAILURE(rc));59 VBVOAssert(!RT_FAILURE(rc)); 60 60 if(RT_FAILURE(rc)) 61 61 { … … 78 78 { 79 79 HGSMIOFFSET offset = hgsmiGetHostBuffer(pCtx); 80 AssertReturnVoid(offset != HGSMIOFFSET_VOID);80 VBVOAssertReturnVoid(offset != HGSMIOFFSET_VOID); 81 81 hgsmiHostCmdProcess(pCtx, offset); 82 82 } … … 162 162 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (HGSMIGUESTCMDHEAP_GET(&pCtx->heapCtx), pvBuffer); 163 163 164 Assert(offBuffer != HGSMIOFFSET_VOID);164 VBVOAssert(offBuffer != HGSMIOFFSET_VOID); 165 165 if (offBuffer != HGSMIOFFSET_VOID) 166 166 { … … 242 242 if (RT_SUCCESS(rc)) 243 243 { 244 AssertRC(pCaps->rc);244 VBVOAssertRC(pCaps->rc); 245 245 rc = pCaps->rc; 246 246 } … … 318 318 uint32_t *poffHostFlags) 319 319 { 320 AssertPtrNullReturnVoid(poffVRAMBaseMapping);321 AssertPtrNullReturnVoid(pcbMapping);322 AssertPtrNullReturnVoid(poffGuestHeapMemory);323 AssertPtrNullReturnVoid(pcbGuestHeapMemory);324 AssertPtrNullReturnVoid(poffHostFlags);320 VBVOAssertPtrNullReturnVoid(poffVRAMBaseMapping); 321 VBVOAssertPtrNullReturnVoid(pcbMapping); 322 VBVOAssertPtrNullReturnVoid(poffGuestHeapMemory); 323 VBVOAssertPtrNullReturnVoid(pcbGuestHeapMemory); 324 VBVOAssertPtrNullReturnVoid(poffHostFlags); 325 325 if (poffVRAMBaseMapping) 326 326 *poffVRAMBaseMapping = cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE; … … 386 386 uint32_t offVRAMHostArea = offVRAMBaseMapping, cbHostArea = 0; 387 387 388 AssertPtrReturnVoid(poffVRAMHostArea);389 AssertPtrReturnVoid(pcbHostArea);388 VBVOAssertPtrReturnVoid(poffVRAMHostArea); 389 VBVOAssertPtrReturnVoid(pcbHostArea); 390 390 VBoxQueryConfHGSMI(pCtx, VBOX_VBVA_CONF32_HOST_HEAP_SIZE, &cbHostArea); 391 391 if (cbHostArea != 0) … … 464 464 * host heap is ready */ 465 465 int rc = vboxHGSMIReportFlagsLocation(pCtx, offVRAMFlagsLocation); 466 AssertRC(rc);466 VBVOAssertRC(rc); 467 467 if (RT_SUCCESS(rc) && fCaps) 468 468 { 469 469 /* Inform about caps */ 470 470 rc = vboxHGSMISendCapsInfo(pCtx, fCaps); 471 AssertRC(rc);471 VBVOAssertRC(rc); 472 472 } 473 473 if (RT_SUCCESS (rc)) … … 475 475 /* Report the host heap location. */ 476 476 rc = vboxHGSMIReportHostArea(pCtx, offVRAMHostArea, cbHostArea); 477 AssertRC(rc);477 VBVOAssertRC(rc); 478 478 } 479 479 // Log(("VBoxVideo::vboxSetupAdapterInfo finished rc = %d\n", rc)); -
trunk/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp
r64425 r64650 23 23 #ifndef VBOX_GUESTR3XF86MOD 24 24 # include <iprt/string.h> 25 #endif26 27 #ifndef LINUX_VERSION_CODE28 # define VBVOAssertPtr AssertPtr29 #else30 # define VBVOAssertPtr(a) do {} while(0)31 25 #endif 32 26 -
trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp
r64425 r64650 21 21 #include <VBox/err.h> 22 22 // #include <VBox/log.h> 23 #ifndef LINUX_VERSION_CODE24 # include <iprt/assert.h>25 # define VBVOAssert Assert26 #else27 # define VBVOAssert(a) do {} while(0)28 #endif29 23 #include <iprt/string.h> 30 24 -
trunk/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp
r64164 r64650 42 42 #define HGSMI_STRICT_ASSERT(expr) do {} while (0) 43 43 #endif /* !HGSMI_STRICT */ 44 45 /* 46 * We do not want assertions in Linux kernel code to reduce symbol dependencies. 47 */ 48 #if defined(IN_RING0) && defined(RT_OS_LINUX) 49 # define HGSMI_ASSERT_PTR_RETURN(a, b) if (!(a)) return (b) 50 #else 51 # define HGSMI_ASSERT_PTR_RETURN(a, b) if (!(a)) return (b) 52 #endif /* !IN_RING0 && RT_OS_LINUX */ 44 53 45 54 /* One-at-a-Time Hash from … … 189 198 const HGSMIENV *pEnv) 190 199 { 191 AssertPtrReturn(pHeap, VERR_INVALID_PARAMETER);192 AssertPtrReturn(pvBase, VERR_INVALID_PARAMETER);200 HGSMI_ASSERT_PTR_RETURN(pHeap, VERR_INVALID_PARAMETER); 201 HGSMI_ASSERT_PTR_RETURN(pvBase, VERR_INVALID_PARAMETER); 193 202 194 203 int rc = HGSMIAreaInitialize(&pHeap->area, pvBase, cbArea, offBase); … … 368 377 // LogFlowFunc(("pArea %p, offBuffer 0x%x\n", pArea, offBuffer)); 369 378 370 AssertPtrReturn(pArea, VERR_INVALID_PARAMETER);371 AssertPtrReturn(pChannelInfo, VERR_INVALID_PARAMETER);379 HGSMI_ASSERT_PTR_RETURN(pArea, VERR_INVALID_PARAMETER); 380 HGSMI_ASSERT_PTR_RETURN(pChannelInfo, VERR_INVALID_PARAMETER); 372 381 373 382 /* Guest has prepared a command description at 'offBuffer'. */ -
trunk/src/VBox/GuestHost/HGSMI/HGSMIMemAlloc.cpp
r62492 r64650 59 59 #include <iprt/string.h> 60 60 61 /* 62 * We do not want assertions in Linux kernel code to reduce symbol dependencies. 63 */ 64 #if defined(IN_RING0) && defined(RT_OS_LINUX) 65 # define HGSMI_ASSERT_RETURN(a, b) if (!(a)) return (b) 66 # define HGSMI_ASSERT_FAILED() do {} while (0) 67 # define HGSMI_ASSERT(expr) do {} while (0) 68 #else 69 # define HGSMI_ASSERT_RETURN(a, b) AssertReturn(a, b) 70 # define HGSMI_ASSERT_FAILED() AssertFailed() 71 # define HGSMI_ASSERT(expr) Assert(expr) 72 #endif /* !IN_RING0 && RT_OS_LINUX */ 61 73 62 74 DECLINLINE(HGSMIOFFSET) hgsmiMADescriptor(HGSMIOFFSET off, bool fFree, HGSMIOFFSET order) … … 222 234 if (pBlock) 223 235 { 224 AssertReturn(HGSMI_MA_DESC_IS_FREE(pBlock->descriptor), NULL);236 HGSMI_ASSERT_RETURN(HGSMI_MA_DESC_IS_FREE(pBlock->descriptor), NULL); 225 237 226 238 /* Where the block starts. */ … … 298 310 { 299 311 /* Should never happen because the new set of blocks is supposed to be smaller. */ 300 AssertFailed();312 HGSMI_ASSERT_FAILED(); 301 313 rc = VERR_OUT_OF_RESOURCES; 302 314 break; … … 325 337 } 326 338 327 Assert(cbRemaining == 0);339 HGSMI_ASSERT(cbRemaining == 0); 328 340 329 341 if (RT_SUCCESS(rc)) … … 354 366 HGSMIMABLOCK **ppStart, HGSMIMABLOCK **ppEnd, HGSMISIZE *pcbBlocks) 355 367 { 356 Assert(HGSMI_MA_DESC_IS_FREE(pBlock->descriptor));368 HGSMI_ASSERT(HGSMI_MA_DESC_IS_FREE(pBlock->descriptor)); 357 369 358 370 *pcbBlocks = HGSMIMAOrder2Size(HGSMI_MA_DESC_ORDER(pBlock->descriptor)); … … 418 430 RTListForEach(&pMA->aListFreeBlocks[i], pIter, HGSMIMABLOCK, nodeFree) 419 431 { 420 Assert(HGSMI_MA_DESC_ORDER(pIter->descriptor) == i);432 HGSMI_ASSERT(HGSMI_MA_DESC_ORDER(pIter->descriptor) == i); 421 433 422 434 HGSMISIZE cbBlocks; … … 425 437 hgsmiMAQueryFreeRange(pMA, pIter, cbRequired, &pFreeStart, &pFreeEnd, &cbBlocks); 426 438 427 Assert((cbBlocks / HGSMI_MA_BLOCK_SIZE_MIN) * HGSMI_MA_BLOCK_SIZE_MIN == cbBlocks);439 HGSMI_ASSERT((cbBlocks / HGSMI_MA_BLOCK_SIZE_MIN) * HGSMI_MA_BLOCK_SIZE_MIN == cbBlocks); 428 440 429 441 /* Verify whether cbBlocks is enough for the requested block. */ … … 460 472 HGSMIOFFSET order = HGSMIPopCnt32(cb - 1) - HGSMI_MA_DESC_ORDER_BASE; 461 473 462 AssertReturn(HGSMIMAOrder2Size(order) >= cb, HGSMIOFFSET_VOID);463 AssertReturn(order < RT_ELEMENTS(pMA->aListFreeBlocks), HGSMIOFFSET_VOID);474 HGSMI_ASSERT_RETURN(HGSMIMAOrder2Size(order) >= cb, HGSMIOFFSET_VOID); 475 HGSMI_ASSERT_RETURN(order < RT_ELEMENTS(pMA->aListFreeBlocks), HGSMIOFFSET_VOID); 464 476 465 477 HGSMIMABLOCK *pBlock = hgsmiMAGetFreeBlock(pMA, order); … … 489 501 490 502 /* Find the block corresponding to the offset. */ 491 Assert((off / HGSMI_MA_BLOCK_SIZE_MIN) * HGSMI_MA_BLOCK_SIZE_MIN == off);503 HGSMI_ASSERT((off / HGSMI_MA_BLOCK_SIZE_MIN) * HGSMI_MA_BLOCK_SIZE_MIN == off); 492 504 493 505 HGSMIMABLOCK *pBlock = HGSMIMASearchOffset(pMA, off); … … 503 515 } 504 516 505 AssertFailed();517 HGSMI_ASSERT_FAILED(); 506 518 } 507 519 … … 510 522 const HGSMIENV *pEnv) 511 523 { 512 AssertReturn(pArea->cbArea < UINT32_C(0x80000000), VERR_INVALID_PARAMETER);513 AssertReturn(pArea->cbArea >= HGSMI_MA_BLOCK_SIZE_MIN, VERR_INVALID_PARAMETER);524 HGSMI_ASSERT_RETURN(pArea->cbArea < UINT32_C(0x80000000), VERR_INVALID_PARAMETER); 525 HGSMI_ASSERT_RETURN(pArea->cbArea >= HGSMI_MA_BLOCK_SIZE_MIN, VERR_INVALID_PARAMETER); 514 526 515 527 RT_ZERO(*pMA); … … 568 580 } 569 581 570 AssertFailed();582 HGSMI_ASSERT_FAILED(); 571 583 return HGSMIOFFSET_VOID; 572 584 } … … 579 591 } 580 592 581 AssertFailed();593 HGSMI_ASSERT_FAILED(); 582 594 return NULL; 583 595 } … … 598 610 else 599 611 { 600 AssertFailed();612 HGSMI_ASSERT_FAILED(); 601 613 } 602 614 }
Note:
See TracChangeset
for help on using the changeset viewer.