From a233cc93bc9a6e37bc09ff337d7d7e30c086bc3d Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Tue, 9 Oct 2018 19:45:08 -0700 Subject: [PATCH] xrp-dsp: expose xrp_device_enable_cache Enable experimental support for caching shared memory on the DSP. Signed-off-by: Max Filippov --- xrp-dsp/xrp_dsp.c | 6 ++++++ xrp_api.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/xrp-dsp/xrp_dsp.c b/xrp-dsp/xrp_dsp.c index 5094e81..742668b 100644 --- a/xrp-dsp/xrp_dsp.c +++ b/xrp-dsp/xrp_dsp.c @@ -70,6 +70,12 @@ struct xrp_buffer_group { }; +void xrp_device_enable_cache(struct xrp_device *device, int enable) +{ + (void)device; + manage_cache = enable; +} + static inline void dcache_region_invalidate(void *p, size_t sz) { if (manage_cache) diff --git a/xrp_api.h b/xrp_api.h index 0bd4bbf..e19cc4c 100644 --- a/xrp_api.h +++ b/xrp_api.h @@ -443,6 +443,19 @@ void xrp_device_unregister_namespace(struct xrp_device *device, const void *nsid, enum xrp_status *status); +/* + * Enable or disable shared memory cache management. + * Note that this call does not change memory caching attributes, it only + * enables flushing and invalidating used regions of shared memory in the + * XRP code. + * + * \param device: device for which shared memory cache management state is + * changed + * \param enable: whether cache management shall be enabled (non-zero) or + * disabled (0) + */ +void xrp_device_enable_cache(struct xrp_device *device, int enable); + /* * Helper function that terminates fast simulation */