coherent: add a missing coherent_shared_thread() implementation

Under Zephyr when CONFIG_INCOHERENT isn't selected,
coherent_shared_thread() is undefined, add a missing implementation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-06-13 12:25:28 +02:00 committed by Liam Girdwood
parent dff5c1bbc8
commit 8871bb3087
1 changed files with 10 additions and 0 deletions

View File

@ -386,6 +386,16 @@ static inline void __coherent_init_thread(struct coherent *c, const size_t size)
#define coherent_init_thread(object, member) __coherent_init_thread(&(object)->member, \
sizeof(*object))
static inline void __coherent_shared_thread(struct coherent *c, const size_t size)
{
k_mutex_lock(&c->mutex, K_FOREVER);
c->shared = true;
k_mutex_unlock(&c->mutex);
}
#define coherent_shared_thread(object, member) __coherent_shared_thread(&(object)->member, \
sizeof(*object))
#endif /* __ZEPHYR__ */
#endif /* CONFIG_INCOHERENT */