Skip to content

Commit

Permalink
virtio.h: add apis virtio_read/write_config_member
Browse files Browse the repository at this point in the history
Used to read/write the virtio deivces' configuration space member

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
  • Loading branch information
CV-Bowen committed Oct 8, 2024
1 parent 0cdd00d commit 0d9c1ce
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/include/openamp/virtio.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ struct virtio_device_id {
#define VIRTIO_TRANSPORT_F_START 28
#define VIRTIO_TRANSPORT_F_END 32

/*
* Read the virtio device configuration member.
*/
#define virtio_read_config_member(vdev, structname, member, ptr) do { \

Check warning on line 144 in lib/include/openamp/virtio.h

View workflow job for this annotation

GitHub Actions / checkpatch review

SINGLE_STATEMENT_DO_WHILE_MACRO

lib/include/openamp/virtio.h:144 Single statement macros should not use a do {} while (0) loop
virtio_read_config((vdev), metal_offset_of(structname, member), \
(ptr), sizeof(*(ptr))); \
} while (0)
/*
* Write the virtio device configuration member.
*/
#define virtio_write_config_member(vdev, structname, member, ptr) do { \

Check warning on line 151 in lib/include/openamp/virtio.h

View workflow job for this annotation

GitHub Actions / checkpatch review

SINGLE_STATEMENT_DO_WHILE_MACRO

lib/include/openamp/virtio.h:151 Single statement macros should not use a do {} while (0) loop
virtio_write_config((vdev), metal_offset_of(structname, member), \
(ptr), sizeof(*(ptr))); \
} while (0)

#ifdef VIRTIO_DEBUG
#include <metal/log.h>

Expand Down

0 comments on commit 0d9c1ce

Please sign in to comment.