- Timestamp:
- Nov 25, 2019 1:41:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/virtio.c
r82174 r82176 467 467 468 468 /* Put it into the queue. */ 469 virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree ] = 0;469 virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree % VIRTIO_SCSI_RING_ELEM] = 0; 470 470 virtio->Queue.AvailRing.idxNextFree++; 471 virtio->Queue.AvailRing.idxNextFree %= VIRTIO_SCSI_RING_ELEM;472 471 473 472 /* Notify the device about the new command. */ … … 523 522 virtio->Queue.aDescTbl[2].idxNext = 0; 524 523 525 /* Put it into the queue. */ 526 virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree] = 0; 524 /* Put it into the queue, the index is supposed to be free-running and clipped to the ring size 525 * internally. The free running index is what the driver sees. */ 526 virtio->Queue.AvailRing.au16Ring[virtio->Queue.AvailRing.idxNextFree % VIRTIO_SCSI_RING_ELEM] = 0; 527 527 virtio->Queue.AvailRing.idxNextFree++; 528 virtio->Queue.AvailRing.idxNextFree %= VIRTIO_SCSI_RING_ELEM;529 528 530 529 /* Notify the device about the new command. */
Note:
See TracChangeset
for help on using the changeset viewer.