kernel: introduce hidden CONFIG_KERNEL_VM_SUPPORT

Introduce a hidden kconfig CONFIG_KERNEL_VM_SUPPORT which
enables some kconfigs that are required for virtual memory
support. CONFIG_KERNEL_VM_BASE, CONFIG_KERNEL_VM_OFFSET,
and CONFIG_KERNEL_VM_SIZE are moved under this new kconfig
so these can be enabled independent of CONFIG_MMU.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-12-06 15:04:03 -08:00 committed by Anas Nashif
commit 7c6b016ce7

View file

@ -4,20 +4,12 @@
menu "Virtual Memory Support"
menuconfig MMU
bool "Enable MMU features"
depends on CPU_HAS_MMU
config KERNEL_VM_SUPPORT
bool
help
This option is enabled when the CPU's memory management unit is active
and the arch_mem_map() API is available.
Hidden option to enable virtual memory Kconfigs.
if MMU
config MMU_PAGE_SIZE
hex "Size of smallest granularity MMU page"
default 0x1000
help
Size of memory pages. Varies per MMU but 4K is common. For MMUs that
support multiple page sizes, put the smallest one here.
if KERNEL_VM_SUPPORT
DT_CHOSEN_Z_SRAM := zephyr,sram
@ -88,6 +80,24 @@ config KERNEL_VM_SIZE
implement a notion of "high" memory in Zephyr to work around physical
RAM size larger than the defined bounds of the virtual address space.
endif # KERNEL_VM_SUPPORT
menuconfig MMU
bool "Enable MMU features"
depends on CPU_HAS_MMU
select KERNEL_VM_SUPPORT
help
This option is enabled when the CPU's memory management unit is active
and the arch_mem_map() API is available.
if MMU
config MMU_PAGE_SIZE
hex "Size of smallest granularity MMU page"
default 0x1000
help
Size of memory pages. Varies per MMU but 4K is common. For MMUs that
support multiple page sizes, put the smallest one here.
menuconfig DEMAND_PAGING
bool "Enable demand paging [EXPERIMENTAL]"
depends on ARCH_HAS_DEMAND_PAGING