12#ifndef __ZEPHYR_LIB_USERSPACE_HELPER_H__
13#define __ZEPHYR_LIB_USERSPACE_HELPER_H__
15#include <zephyr/kernel.h>
19#ifdef CONFIG_USERSPACE
20#include <zephyr/cache.h>
21#include <zephyr/app_memory/app_memdomain.h>
23#define USER_MOD_HEAP_SIZE ALIGN_UP(CONFIG_SOF_ZEPHYR_USERSPACE_MODULE_HEAP_SIZE, \
24 CONFIG_MM_DRV_PAGE_SIZE)
27struct userspace_context;
40struct k_heap *module_driver_heap_init(
void);
52int user_memory_attach_common_partition(
struct k_mem_domain *dom);
93#ifdef CONFIG_USERSPACE
109static inline uint32_t user_get_partition_cache_attr(uintptr_t ptr)
111 return sys_cache_is_ptr_cached(UINT_TO_POINTER(ptr)) ? XTENSA_MMU_CACHED_WB : 0;
119void user_grant_dai_access_all(
struct k_thread *thread);
126void user_grant_dma_access_all(
struct k_thread *thread);
143#ifdef CONFIG_SOF_USERSPACE_LL
Placement of data that user-space threads must be able to access.
static int user_access_to_mailbox(struct k_mem_domain *domain, k_tid_t thread_id)
Add access to mailbox.h interface to a user-space thread (no-op stub when CONFIG_USERSPACE is disable...
Definition userspace_helper.h:136
static int user_memory_attach_system_user_partition(struct k_mem_domain *dom)
Attach SOF system user memory partition to a memory domain.
Definition userspace_helper.h:159
void * user_stack_allocate(size_t stack_size, uint32_t options)
Userspace support functions.
int user_stack_free(void *p_stack)
Free thread stack memory.
void module_driver_heap_remove(struct k_heap *mod_drv_heap)
Free private processing module heap.