1# Kernel configuration options 2 3# Copyright (c) 2014-2015 Wind River Systems, Inc. 4# SPDX-License-Identifier: Apache-2.0 5 6menu "Memory Domains" 7 8config MAX_DOMAIN_PARTITIONS 9 int "Maximum number of partitions per memory domain" 10 default 16 11 range 0 $(UINT8_MAX) 12 depends on USERSPACE 13 help 14 Configure the maximum number of partitions per memory domain. 15 16config ARCH_MEM_DOMAIN_DATA 17 bool 18 depends on USERSPACE 19 help 20 This hidden option is selected by the target architecture if 21 architecture-specific data is needed on a per memory domain basis. 22 If so, the architecture defines a 'struct arch_mem_domain' which is 23 embedded within every struct k_mem_domain. The architecture 24 must also define the arch_mem_domain_init() function to set this up 25 when a memory domain is created. 26 27 Typical uses might be a set of page tables for that memory domain. 28 29config ARCH_MEM_DOMAIN_SYNCHRONOUS_API 30 bool 31 depends on USERSPACE 32 help 33 This hidden option is selected by the target architecture if 34 modifying a memory domain's partitions at runtime, or changing 35 a memory domain's thread membership requires synchronous calls 36 into the architecture layer. 37 38 If enabled, the architecture layer must implement the following 39 APIs: 40 41 arch_mem_domain_thread_add 42 arch_mem_domain_thread_remove 43 arch_mem_domain_partition_remove 44 arch_mem_domain_partition_add 45 46 It's important to note that although supervisor threads can be 47 members of memory domains, they have no implications on supervisor 48 thread access to memory. Memory domain APIs may only be invoked from 49 supervisor mode. 50 51 For these reasons, on uniprocessor systems unless memory access 52 policy is managed in separate software constructions like page 53 tables, these APIs don't need to be implemented as the underlying 54 memory management hardware will be reprogrammed on context switch 55 anyway. 56 57config ARCH_MEM_DOMAIN_SUPPORTS_ISOLATED_STACKS 58 bool 59 help 60 This hidden option is selected by the target architecture if 61 the architecture supports isolating thread stacks for threads 62 within the same memory domain. 63 64config MEM_DOMAIN_ISOLATED_STACKS 65 bool 66 default y 67 depends on (MMU || MPU) && ARCH_MEM_DOMAIN_SUPPORTS_ISOLATED_STACKS 68 help 69 If enabled, thread stacks within the same memory domains are 70 isolated which means threads within the same memory domains 71 have no access to others threads' stacks. 72 73 If disabled, threads within the same memory domains can access 74 other threads' stacks. 75 76 Regardless of this settings, threads cannot access the stacks of 77 threads outside of their domains. 78 79endmenu 80