zephyr::raw

Function k_mem_domain_add_partition

source
pub unsafe extern "C" fn k_mem_domain_add_partition(
    domain: *mut k_mem_domain,
    part: *mut k_mem_partition,
) -> i32
Expand description

@brief Add a memory partition into a memory domain.

Add a memory partition into a memory domain. Partitions must conform to the following constraints:

  • Partitions in the same memory domain may not overlap each other.
  • Partitions must not be defined which expose private kernel data structures or kernel objects.
  • The starting address alignment, and the partition size must conform to the constraints of the underlying memory management hardware, which varies per architecture.
  • Memory domain partitions are only intended to control access to memory from user mode threads.
  • If CONFIG_EXECUTE_XOR_WRITE is enabled, the partition must not allow both writes and execution.

Violating these constraints may lead to CPU exceptions or undefined behavior.

@param domain The memory domain to be added a memory partition. @param part The memory partition to be added

@retval 0 if successful @retval -EINVAL if invalid parameters supplied @retval -ENOSPC if no free partition slots available