From b8abc398027a324f71a408c7f4d0cba4ba243981 Mon Sep 17 00:00:00 2001 From: Carlo Caione Date: Fri, 18 Jun 2021 16:27:25 +0200 Subject: [PATCH] Introduce CMake options to enable cache operations Introduce WITH_DCACHE_VRINGS and WITH_DCACHE_BUFFERS. Signed-off-by: Carlo Caione --- README.md | 4 ++++ cmake/options.cmake | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 4aff63d..f983c36 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,10 @@ library for it project: * **WITH_SHARED_LIB** (default ON): Build with a shared library. * **WITH_ZEPHYR** (default OFF): Build open-amp as a zephyr library. This option is mandatory in a Zephyr environment. +* **WITH_DCACHE_VRINGS** (default OFF): Build with data cache operations + enabled on vrings. +* **WITH_DCACHE_BUFFERS** (default OFF): Build with data cache operations + enabled on buffers. * **RPMSG_BUFFER_SIZE** (default 512): adjust the size of the RPMsg buffers. The default value of the RPMsg size is compatible with the Linux Kernel hard coded value. If you AMP configuration is Linux kernel master/ OpenAMP remote, diff --git a/cmake/options.cmake b/cmake/options.cmake index edb3689..269f179 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -74,6 +74,18 @@ if (NOT WITH_VIRTIO_SLAVE) add_definitions(-DVIRTIO_MASTER_ONLY) endif (NOT WITH_VIRTIO_SLAVE) +option (WITH_DCACHE_VRINGS "Build with vrings cache operations enabled" OFF) + +if (WITH_DCACHE_VRINGS) + add_definitions(-DVIRTIO_CACHED_VRINGS) +endif (WITH_DCACHE_VRINGS) + +option (WITH_DCACHE_BUFFERS "Build with vrings cache operations enabled" OFF) + +if (WITH_DCACHE_BUFFERS) + add_definitions(-DVIRTIO_CACHED_BUFFERS) +endif (WITH_DCACHE_BUFFERS) + # Set the complication flags set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")