OpenAMP / open-amp

The main OpenAMP library implementing RPMSG, Virtio, and Remoteproc for RTOS etc
https://www.openampproject.org/
Other
721 stars 291 forks source link

virtio.h: add some user-friendly apis #622

Open CV-Bowen opened 1 month ago

CV-Bowen commented 1 month ago

And assgin feature to vdev->feature for virtio device role when get features, so the virtio device side can use virtio_has_featrue() to check weather the virtio device support a feature.


-    virtio.h: add new feature bit VIRTIO_F_ANY_LAYOUT
```c
Follow the virtio spec, this feature bit indicates that the device
accepts arbitrary descriptor layouts.
CV-Bowen commented 1 month ago

@arnopo Hi, I meet a CI issue:

#define virtio_read_config_member(vdev, structname, member, _ptr) \
    virtio_read_config((vdev), metal_offset_of(structname, member), \
               _ptr, sizeof(*(_ptr)))

This code reports MACRO_ARG_REUSE: Macro argument reuse '_ptr' - possible side-effects? So can we use typeof to avoid this issue?

CV-Bowen commented 1 month ago

@glneo @arnopo Please review again.