rpmsg: buffers flush/invalidate

Do buffers flush and invalidate the same as with vrings
and resource table:
- add defines in header file;
- call BUFFER_FLUSH/BUFFER_INVALIDATE where necessary.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
This commit is contained in:
Iuliana Prodan
2023-09-18 09:12:36 +02:00
committed by Arnaud Pouliquen
parent ca0747ebec
commit 95a9038ca6
2 changed files with 12 additions and 10 deletions
+9
View File
@@ -14,6 +14,7 @@
#include <metal/io.h>
#include <metal/mutex.h>
#include <metal/cache.h>
#include <openamp/rpmsg.h>
#include <openamp/virtio.h>
@@ -29,6 +30,14 @@ extern "C" {
/* The feature bitmap for virtio rpmsg */
#define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */
#ifdef VIRTIO_CACHED_BUFFERS
#define BUFFER_FLUSH(x, s) metal_cache_flush(x, s)
#define BUFFER_INVALIDATE(x, s) metal_cache_invalidate(x, s)
#else
#define BUFFER_FLUSH(x, s) do { } while (0)
#define BUFFER_INVALIDATE(x, s) do { } while (0)
#endif /* VIRTIO_CACHED_BUFFERS */
/**
* struct rpmsg_virtio_shm_pool - shared memory pool used for rpmsg buffers
* @base: base address of the memory pool