Skip to content

Commit

Permalink
openamp: add VIRTIO_RING_F_MUST_NOTIFY event
Browse files Browse the repository at this point in the history
add VIRTIO_RING_F_MUST_NOTIFY support to can't suppress interrupt

Signed-off-by: ligd <[email protected]>
  • Loading branch information
GUIDINGLI authored and wyr-7 committed Sep 18, 2024
1 parent c468328 commit 8bb8e98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/include/openamp/virtqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ extern "C" {
/* Support to suppress interrupt until specific index is reached. */
#define VIRTIO_RING_F_EVENT_IDX (1 << 29)

/* Support to can't suppress interrupt. */
#define VIRTIO_RING_F_MUST_NOTIFY (1 << 30)

/* cache invalidation helpers */
#define CACHE_FLUSH(x, s) metal_cache_flush(x, s)
#define CACHE_INVALIDATE(x, s) metal_cache_invalidate(x, s)
Expand Down
3 changes: 3 additions & 0 deletions lib/virtio/virtqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ static int vq_ring_must_notify(struct virtqueue *vq)
{
uint16_t new_idx, prev_idx, event_idx;

if (vq->vq_dev->features & VIRTIO_RING_F_MUST_NOTIFY)
return 1;

if (vq->vq_dev->features & VIRTIO_RING_F_EVENT_IDX) {
if (VIRTIO_ROLE_IS_DRIVER(vq->vq_dev)) {
/* CACHE: no need to invalidate avail */
Expand Down

0 comments on commit 8bb8e98

Please sign in to comment.