MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / queue_notify

Function queue_notify

tinyemu/virtio.c:518–544  ·  view source on GitHub ↗

XXX: test if the queue is ready ? */

Source from the content-addressed store, hash-verified

516
517/* XXX: test if the queue is ready ? */
518static void queue_notify(VIRTIODevice *s, int queue_idx)
519{
520 QueueState *qs = &s->queue[queue_idx];
521 uint16_t avail_idx;
522 int desc_idx, read_size, write_size;
523
524 if (qs->manual_recv)
525 return;
526
527 avail_idx = virtio_read16(s, qs->avail_addr + 2);
528 while (qs->last_avail_idx != avail_idx) {
529 desc_idx = virtio_read16(s, qs->avail_addr + 4 +
530 (qs->last_avail_idx & (qs->num - 1)) * 2);
531 if (!get_desc_rw_size(s, &read_size, &write_size, queue_idx, desc_idx)) {
532#ifdef DEBUG_VIRTIO
533 if (s->debug & VIRTIO_DEBUG_IO) {
534 printf("queue_notify: idx=%d read_size=%d write_size=%d\n",
535 queue_idx, read_size, write_size);
536 }
537#endif
538 if (s->device_recv(s, queue_idx, desc_idx,
539 read_size, write_size) < 0)
540 break;
541 }
542 qs->last_avail_idx++;
543 }
544}
545
546static uint32_t virtio_config_read(VIRTIODevice *s, uint32_t offset,
547 int size_log2)

Callers 4

virtio_mmio_writeFunction · 0.85
virtio_pci_writeFunction · 0.85
virtio_block_req_cbFunction · 0.85
virtio_9p_open_cbFunction · 0.85

Calls 2

virtio_read16Function · 0.85
get_desc_rw_sizeFunction · 0.85

Tested by

no test coverage detected