debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.
A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.
Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
The vhost driver uses work_queue() for deferred probe but was missing
the SCHED_WORKQUEUE Kconfig dependency, causing link errors on boards
that don't enable workqueue by default.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Convert VHOST_DEFERED_PROBE_PERIOD from a raw value to use MSEC2TICK()
macro, ensuring the delay is correctly converted from milliseconds to
system ticks regardless of the configured tick rate.
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Change DRIVERS_VIRTIO and DRIVERS_VHOST from menuconfig to hidden config
options. Each virtio/vhost sub-driver now automatically selects its parent
config, eliminating the need to manually enable DRIVERS_VIRTIO or
DRIVERS_VHOST in defconfig files.
This simplifies board configuration by removing redundant CONFIG_DRIVERS_VIRTIO
entries from affected defconfig files.
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Add vhost_get_vq_buffers() API to retrieve all chained buffers from a
virtqueue in one call. This simplifies handling of scatter-gather I/O
where data spans multiple descriptors.
The function populates an array of virtqueue_buf structures with buffer
pointers and lengths, returning the descriptor head index on success.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
virtio and vhost rpmsg device as standalone device registered to
the virtio and vhost bus.
virtio-rpmsg and vhost-rpmsg use the common virtio_rpmsg_common.c
implementation in rpmsg dir.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
OpenAMP already change virtqueue_get_available_buffer() to
virtqueue_get_first_avail_buffer(), so update them
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
vhost/vhost-rng.c:154:9: error: too few arguments to function 'virtio_create_virtqueues'
154 | ret = vhost_create_virtqueues(hdev, 0, 1, vqnames, callback);
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
vhost/vhost.c: In function 'vhost_status_driver_ok':
vhost/vhost.c:86:20: error: too few arguments to function 'virtio_get_status'
86 | uint8_t status = vhost_get_status(hdev);
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
1. Use the virtqueue_xxx_lock() api;
2. Add spinlock for some virtio and vhost drivers that do not
use spinlock to protect the virtqueues;
Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
So the driver can get the driver pointer by vdev/hdev->priv,
and later vdev/hdev->priv can be used to store other data such as the
virtio/vhost drivers' private data.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
vhost-rng is a simple virtio device implementation, it receives
the buffer receviced from the virtio-rng driver and fill the random
number to this buffer and return to virtio-rng.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
virtio is a framework to implement the virtio drivers
vhost (Virtual Host) is a framework to implement the virtio devices
With the virtio and vhost framework, we can use the virtio drivers
and vhost drivers to implement the cross-core communication.
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>