Skip to content

Commit

Permalink
xrp-dsp: expose xrp_device_enable_cache
Browse files Browse the repository at this point in the history
Enable experimental support for caching shared memory on the DSP.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  • Loading branch information
jcmvbkbc committed Oct 10, 2018
1 parent 55df787 commit a233cc9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xrp-dsp/xrp_dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions xrp_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit a233cc9

Please sign in to comment.