From 993cf9f8eb9134c7a0353004baa0e0fa66aee6e1 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 30 Nov 2020 10:26:09 -0800 Subject: [PATCH] demand_paging: add infra for demand paging modules Backing stores and eviction algorithms will be included here. Exactly one must be chosen, with a default option to leave the implementation to the application. Signed-off-by: Andrew Boie --- subsys/CMakeLists.txt | 1 + subsys/Kconfig | 2 ++ subsys/demand_paging/CMakeLists.txt | 5 +++++ subsys/demand_paging/Kconfig | 11 +++++++++++ .../demand_paging/backing_store/CMakeLists.txt | 2 ++ subsys/demand_paging/backing_store/Kconfig | 15 +++++++++++++++ subsys/demand_paging/eviction/CMakeLists.txt | 2 ++ subsys/demand_paging/eviction/Kconfig | 17 +++++++++++++++++ 8 files changed, 55 insertions(+) create mode 100644 subsys/demand_paging/CMakeLists.txt create mode 100644 subsys/demand_paging/Kconfig create mode 100644 subsys/demand_paging/backing_store/CMakeLists.txt create mode 100644 subsys/demand_paging/backing_store/Kconfig create mode 100644 subsys/demand_paging/eviction/CMakeLists.txt create mode 100644 subsys/demand_paging/eviction/Kconfig diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index 80d7a838b3..9608ddec21 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -26,3 +26,4 @@ add_subdirectory(tracing) add_subdirectory_ifdef(CONFIG_JWT jwt) add_subdirectory(canbus) add_subdirectory_ifdef(CONFIG_TIMING_FUNCTIONS timing) +add_subdirectory_ifdef(CONFIG_DEMAND_PAGING demand_paging) diff --git a/subsys/Kconfig b/subsys/Kconfig index 6c5a95d671..e6b60b9c67 100644 --- a/subsys/Kconfig +++ b/subsys/Kconfig @@ -58,4 +58,6 @@ source "subsys/timing/Kconfig" source "subsys/tracing/Kconfig" +source "subsys/demand_paging/Kconfig" + endmenu diff --git a/subsys/demand_paging/CMakeLists.txt b/subsys/demand_paging/CMakeLists.txt new file mode 100644 index 0000000000..486e9f9ad2 --- /dev/null +++ b/subsys/demand_paging/CMakeLists.txt @@ -0,0 +1,5 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(eviction) +add_subdirectory(backing_store) diff --git a/subsys/demand_paging/Kconfig b/subsys/demand_paging/Kconfig new file mode 100644 index 0000000000..3e1626f989 --- /dev/null +++ b/subsys/demand_paging/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +menu "Demand Paging modules" + depends on DEMAND_PAGING + +source "subsys/demand_paging/eviction/Kconfig" + +source "subsys/demand_paging/backing_store/Kconfig" + +endmenu diff --git a/subsys/demand_paging/backing_store/CMakeLists.txt b/subsys/demand_paging/backing_store/CMakeLists.txt new file mode 100644 index 0000000000..dd1bf8032a --- /dev/null +++ b/subsys/demand_paging/backing_store/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/subsys/demand_paging/backing_store/Kconfig b/subsys/demand_paging/backing_store/Kconfig new file mode 100644 index 0000000000..70a80dbbcc --- /dev/null +++ b/subsys/demand_paging/backing_store/Kconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +choice BACKING_STORE_CHOICE + prompt "Backing store algorithms" + default BACKING_STORE_CUSTOM + +config BACKING_STORE_CUSTOM + bool "Custom backing store implementation" + help + This option is chosen when the backing store will be implemented in + the application. This will be typical as these tend to be very + hardware-dependent. + +endchoice diff --git a/subsys/demand_paging/eviction/CMakeLists.txt b/subsys/demand_paging/eviction/CMakeLists.txt new file mode 100644 index 0000000000..dd1bf8032a --- /dev/null +++ b/subsys/demand_paging/eviction/CMakeLists.txt @@ -0,0 +1,2 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 diff --git a/subsys/demand_paging/eviction/Kconfig b/subsys/demand_paging/eviction/Kconfig new file mode 100644 index 0000000000..0a39d9ad8a --- /dev/null +++ b/subsys/demand_paging/eviction/Kconfig @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# +# Demand paging sample eviction algorithms + +choice EVICTION_CHOICE + prompt "Page frame eviction algorithms" + default EVICTION_CUSTOM + depends on DEMAND_PAGING + +config EVICTION_CUSTOM + bool "Custom eviction algorithm" + help + This option is chosen when the eviction algorithm will be implemented + by the application, instead of using one included in Zephyr. + +endchoice