Changeset 9528 in vbox
- Timestamp:
- Jun 9, 2008 10:12:30 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r9212 r9528 4926 4926 4927 4927 /** 4928 * Sets a bit range within a bitmap. 4929 * 4930 * @param pvBitmap Pointer to the bitmap. 4931 * @param iBitStart The First bit to set. 4932 * @param iBitEnd The first bit not to set. 4933 */ 4934 DECLINLINE(void) ASMBitSetRange(volatile void *pvBitmap, int32_t iBitStart, int32_t iBitEnd) 4935 { 4936 if (iBitStart < iBitEnd) 4937 { 4938 volatile uint32_t *pu32 = (volatile uint32_t *)pvBitmap + (iBitStart >> 5); 4939 int iStart = iBitStart & ~31; 4940 int iEnd = iBitEnd & ~31; 4941 if (iStart == iEnd) 4942 *pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << iBitStart; 4943 else 4944 { 4945 /* bits in first dword. */ 4946 if (iBitStart & 31) 4947 { 4948 *pu32 |= ~((1 << (iBitStart & 31)) - 1); 4949 pu32++; 4950 iBitStart = iStart + 32; 4951 } 4952 4953 /* whole dword. */ 4954 if (iBitStart != iEnd) 4955 ASMMemFill32(pu32, (iEnd - iBitStart) >> 3, ~0); 4956 4957 /* bits in last dword. */ 4958 if (iBitEnd & 31) 4959 { 4960 pu32 = (volatile uint32_t *)pvBitmap + (iBitEnd >> 5); 4961 *pu32 |= (1 << (iBitEnd & 31)) - 1; 4962 } 4963 } 4964 } 4965 } 4966 4967 4968 /** 4928 4969 * Finds the first clear bit in a bitmap. 4929 4970 * -
trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp
r9262 r9528 1484 1484 pImage->uOpenFlags = uOpenFlags & VD_OPEN_FLAGS_HONOR_SAME; 1485 1485 rc = pImage->Backend->pfnCreate(pImage->pszFilename, 1486 VD_IMAGE_TYPE_ NORMAL, pDisk->cbSize,1486 VD_IMAGE_TYPE_DIFF, pDisk->cbSize, 1487 1487 uImageFlags, pszComment, 1488 1488 &pDisk->PCHSGeometry, -
trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp
r9263 r9528 812 812 if ( !VALID_PTR(pszFilename) 813 813 || !*pszFilename 814 || (enmType != VD_IMAGE_TYPE_NORMAL && enmType != VD_IMAGE_TYPE_FIXED) 814 || (enmType != VD_IMAGE_TYPE_NORMAL && enmType != VD_IMAGE_TYPE_FIXED 815 && enmType != VD_IMAGE_TYPE_DIFF) 815 816 || cbSize < VDI_IMAGE_DEFAULT_BLOCK_SIZE 816 817 || !VALID_PTR(pPCHSGeometry) -
trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp
r9084 r9528 3588 3588 goto out; 3589 3589 } 3590 3591 /* @todo A quick hack to support differencing images in VMDK. */ 3592 if (enmType == VD_IMAGE_TYPE_DIFF) 3593 enmType = VD_IMAGE_TYPE_NORMAL; 3590 3594 3591 3595 /* Check remaining arguments. */ -
trunk/src/VBox/Devices/Storage/testcase/tstVD.cpp
r9490 r9528 393 393 if (((uint8_t*)pvBuf)[i] != pSegment->u8Value) 394 394 { 395 RTPrintf("ERROR: Segment at %Lx of % dbytes is corrupt at offset %x (found %x instead of %x)\n",395 RTPrintf("ERROR: Segment at %Lx of %x bytes is corrupt at offset %x (found %x instead of %x)\n", 396 396 pSegment->u64Offset, pSegment->u32Length, i, ((uint8_t*)pvBuf)[i], 397 397 pSegment->u8Value); 398 RTLogPrintf("ERROR: Segment at %Lx of % dbytes is corrupt at offset %x (found %x instead of %x)\n",398 RTLogPrintf("ERROR: Segment at %Lx of %x bytes is corrupt at offset %x (found %x instead of %x)\n", 399 399 pSegment->u64Offset, pSegment->u32Length, i, ((uint8_t*)pvBuf)[i], 400 400 pSegment->u8Value); … … 476 476 generateRandomSegments(&ctx, paDiffSegments, nSegments, _1M, u64DiskSize, u32SectorSize, 128u, 255u); 477 477 478 /*PSEGMENT pSegment;479 RTPrintf("Base segments:\n");478 PSEGMENT pSegment; 479 /*RTPrintf("Base segments:\n"); 480 480 for (pSegment = paBaseSegments; pSegment->u32Length; pSegment++) 481 RTPrintf("off: %08Lx len: %0 4x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/481 RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/ 482 482 writeSegmentsToDisk(pVD, pvBuf, paBaseSegments); 483 483 … … 489 489 /*RTPrintf("\nDiff segments:\n"); 490 490 for (pSegment = paDiffSegments; pSegment->u32Length; pSegment++) 491 RTPrintf("off: %08Lx len: %0 4x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/491 RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/ 492 492 writeSegmentsToDisk(pVD, pvBuf, paDiffSegments); 493 493 … … 501 501 /*RTPrintf("\nMerged segments:\n"); 502 502 for (pSegment = paMergeSegments; pSegment->u32Length; pSegment++) 503 RTPrintf("off: %08Lx len: %0 4x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/503 RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/ 504 504 rc = readAndCompareSegments(pVD, pvBuf, paMergeSegments); 505 505 CHECK("readAndCompareSegments()"); … … 565 565 initializeRandomGenerator(&ctx, u32Seed); 566 566 generateRandomSegments(&ctx, paSegments, nSegments, _1M, u64DiskSize, u32SectorSize, 0u, 127u); 567 /*for (PSEGMENT pSegment = paSegments; pSegment->u32Length; pSegment++) 568 RTPrintf("off: %08Lx len: %05x val: %02x\n", pSegment->u64Offset, pSegment->u32Length, pSegment->u8Value);*/ 567 569 568 570 writeSegmentsToDisk(pVD, pvBuf, paSegments); … … 611 613 RTFileDelete("tmpVDBase.vhd"); 612 614 RTFileDelete("tmpVDDiff.vhd"); 613 615 #if 1 614 616 rc = tstVDCreateDelete("VDI", "tmpVDCreate.vdi", 2 * _4G, 615 617 VD_IMAGE_TYPE_NORMAL, VD_IMAGE_FLAGS_NONE, … … 708 710 g_cErrors++; 709 711 } 710 #if 0 712 #endif 713 711 714 rc = tstVDOpenCreateWriteMerge("VHD", "tmpVDBase.vhd", "tmpVDDiff.vhd", u32Seed); 712 715 if (VBOX_FAILURE(rc)) … … 715 718 g_cErrors++; 716 719 } 717 #endif 720 718 721 /* 719 722 * Clean up any leftovers.
Note:
See TracChangeset
for help on using the changeset viewer.