MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / virtio_queue_destroy

Function virtio_queue_destroy

components/drivers/virtio/virtio.c:151–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void virtio_queue_destroy(struct virtio_device *dev, rt_uint32_t queue_index)
152{
153 struct virtq *queue;
154
155 _virtio_dev_check(dev);
156
157 RT_ASSERT(dev->mmio_config->queue_num_max > 0);
158 RT_ASSERT(dev->mmio_config->queue_num_max > queue_index);
159
160 queue = &dev->queues[queue_index];
161
162 RT_ASSERT(queue->num > 0);
163
164 rt_free(queue->free);
165 rt_free_align((void *)queue->desc);
166
167 dev->mmio_config->queue_sel = queue_index;
168 dev->mmio_config->queue_pfn = RT_NULL;
169
170 queue->num = 0;
171 queue->desc = RT_NULL;
172 queue->avail = RT_NULL;
173 queue->used = RT_NULL;
174}
175
176void virtio_queue_notify(struct virtio_device *dev, rt_uint32_t queue_index)
177{

Callers 4

rt_virtio_console_initFunction · 0.85
rt_virtio_gpu_initFunction · 0.85
rt_virtio_input_initFunction · 0.85
rt_virtio_net_initFunction · 0.85

Calls 3

_virtio_dev_checkFunction · 0.85
rt_freeFunction · 0.85
rt_free_alignFunction · 0.85

Tested by

no test coverage detected