big_endian conversion: this should be more correct
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39279 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f058886908
commit
0ac16c5b3e
@ -199,8 +199,7 @@ ATADevice::ReadCapacity16(ATARequest *request)
|
||||
data.block_size = B_HOST_TO_BENDIAN_INT32(fBlockSize);
|
||||
|
||||
uint64 lastBlock = fTotalSectors - 1;
|
||||
data.lba = (((uint64)B_HOST_TO_BENDIAN_INT32(lastBlock >> 32)) << 32)
|
||||
| B_HOST_TO_BENDIAN_INT32(lastBlock);
|
||||
data.lba = B_HOST_TO_BENDIAN_INT64(lastBlock);
|
||||
TRACE("returning last block: %llu\n", data.lba);
|
||||
|
||||
copy_sg_data(ccb, 0, ccb->data_length, &data, sizeof(data), false);
|
||||
|
@ -76,9 +76,7 @@ periph_check_capacity(scsi_periph_device_info *device, scsi_ccb *request)
|
||||
ACQUIRE_BEN(&device->mutex);
|
||||
|
||||
if (res == B_OK && request->data_resid == 0) {
|
||||
capacity = (((uint64)B_BENDIAN_TO_HOST_INT32(
|
||||
capacityLongResult.lba >> 32)) << 32)
|
||||
| B_BENDIAN_TO_HOST_INT32(capacityLongResult.lba);
|
||||
capacity = B_BENDIAN_TO_HOST_INT64(capacityLongResult.lba);
|
||||
} else
|
||||
capacity = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user