Skip to content

Commit

Permalink
virtio.h: add virtio_has_feature api for virtio driver
Browse files Browse the repository at this point in the history
Virtio driver can used this api to judge whether the this feature
is supported by both virtio driver and device.

Signed-off-by: Bowen Wang <[email protected]>
  • Loading branch information
CV-Bowen authored and xiaoxiang781216 committed Dec 11, 2023
1 parent 8b9c64e commit 449197c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/nuttx/virtio/virtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
* Pre-processor Definitions
****************************************************************************/

#define virtio_has_feature(vdev, fbit) \
(((vdev)->features & (1UL << (fbit))) != 0)

#define virtio_read_config_member(vdev, structname, member, ptr) \
virtio_read_config((vdev), offsetof(structname, member), \
(ptr), sizeof(*(ptr)));
Expand Down

0 comments on commit 449197c

Please sign in to comment.