Sound Open Firmware
Loading...
Searching...
No Matches
userspace_helper.h File Reference
Include dependency graph for userspace_helper.h:

Go to the source code of this file.

Functions

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.
 
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 disabled).
 
static int user_memory_attach_system_user_partition (struct k_mem_domain *dom)
 Attach SOF system user memory partition to a memory domain.
 

Function Documentation

◆ module_driver_heap_remove()

void module_driver_heap_remove ( struct k_heap *  mod_drv_heap)

Free private processing module heap.

Parameters
mod_drv_heappointer to the k_heap structure.
Note
Function used only when CONFIG_USERSPACE is set. Frees private module heap.

◆ user_access_to_mailbox()

static int user_access_to_mailbox ( struct k_mem_domain *  domain,
k_tid_t  thread_id 
)
inlinestatic

Add access to mailbox.h interface to a user-space thread (no-op stub when CONFIG_USERSPACE is disabled).

Parameters
domainMemory domain.
thread_idUser-space thread identifier.
Returns
0 on success.

◆ user_memory_attach_system_user_partition()

static int user_memory_attach_system_user_partition ( struct k_mem_domain *  dom)
inlinestatic

Attach SOF system user memory partition to a memory domain.

Parameters
dom- memory domain to attach the sysuser partition to.
Returns
0 for success, error otherwise.
Note
Function used only when CONFIG_USERSPACE is set. The sysuser partition contains shared objects required by user-space modules.

◆ user_stack_allocate()

void * user_stack_allocate ( size_t  stack_size,
uint32_t  options 
)

Userspace support functions.

Allocates thread stack memory.

Parameters
stack_sizeRequired stack size.
optionsStack configuration options K_USER - when creating user thread 0 - when creating kernel thread
Returns
pointer to the stack or NULL if not created.

When CONFIG_USERSPACE not set function calls rballoc_align(), otherwise it uses k_thread_stack_alloc() routine.

◆ user_stack_free()

int user_stack_free ( void *  p_stack)

Free thread stack memory.

Parameters
p_stackPointer to the stack.
Returns
0 for success, error otherwise.
Note
When CONFIG_USERSPACE not set function calls rfree(), otherwise it uses k_thread_stack_free() routine.