userspace: fix k_mem_partition definition

This properly is defined against CONFIG_USERSPACE, not
CONFIG_MEMORY_PROTECTION; memory domains are specifically
part of the userspace feature and its associated data
structures should not be used outside of it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-11-05 14:19:59 -08:00 committed by Anas Nashif
commit 0652d926e3

View file

@ -27,7 +27,7 @@ typedef struct k_thread *k_tid_t;
* @{
*/
#ifdef CONFIG_MEMORY_PROTECTION
#ifdef CONFIG_USERSPACE
/**
* @def K_MEM_PARTITION_DEFINE
*
@ -63,12 +63,7 @@ struct k_mem_partition {
/** attribute of memory partition */
k_mem_partition_attr_t attr;
};
#else
/* To support use of IS_ENABLED for the APIs below */
struct k_mem_partition;
#endif /* CONFIG_MEMORY_PROTECTION */
#ifdef CONFIG_USERSPACE
/**
* @brief Memory Domain
*
@ -111,6 +106,7 @@ extern struct k_mem_domain k_mem_domain_default;
#else
/* To support use of IS_ENABLED for the APIs below */
struct k_mem_domain;
struct k_mem_partition;
#endif /* CONFIG_USERSPACE */
/**