kernel: mm: only include demand_paging.h if needed
This moves including of demand_paging.h out of kernel/mm.h, so that users of demand paging APIs must include the header explicitly. Since the main user is kernel itself, we can be more discipline about header inclusion. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
062fc2242a
commit
40ba4015e3
|
@ -11,6 +11,10 @@
|
|||
#include <ksched.h>
|
||||
#include <x86_mmu.h>
|
||||
|
||||
#ifdef CONFIG_DEMAND_PAGING
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_X86_KPTI
|
||||
/* Update the to the incoming thread's page table, and update the location of
|
||||
* the privilege elevation stack.
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#endif
|
||||
|
||||
#include <zephyr/kernel/internal/mm.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
|
||||
/**
|
||||
* @brief Kernel Memory Management
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define ZEPHYR_INCLUDE_KERNEL_THREAD_H_
|
||||
|
||||
#ifdef CONFIG_DEMAND_PAGING_THREAD_STATS
|
||||
#include <zephyr/kernel/mm.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
#endif
|
||||
|
||||
#include <zephyr/kernel/stats.h>
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);
|
||||
|
||||
#ifdef CONFIG_DEMAND_PAGING
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* General terminology:
|
||||
* - A page frame is a page-sized physical memory region in RAM. It is a
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <kernel_internal.h>
|
||||
#include <zephyr/internal/syscall_handler.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/kernel/mm.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
|
||||
extern struct k_mem_paging_stats_t paging_stats;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <kernel_arch_interface.h>
|
||||
#include <zephyr/linker/linker-defs.h>
|
||||
#include <zephyr/sys/util.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
|
||||
void *location_to_flash(uintptr_t location)
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <mmu.h>
|
||||
#include <string.h>
|
||||
#include <kernel_arch_interface.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include <kernel_arch_interface.h>
|
||||
#include <zephyr/init.h>
|
||||
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
|
||||
/* The accessed and dirty states of each page frame are used to create
|
||||
* a hierarchy with a numerical value. When evicting a page, try to evict
|
||||
* page with the highest value (we prefer clean, not accessed pages).
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
#include "test_syscalls.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_DEMAND_PAGING)
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_X86) && defined(CONFIG_X86_MMU)
|
||||
#define STACKSIZE (8192)
|
||||
#else
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <zephyr/ztest.h>
|
||||
#include <zephyr/kernel/mm.h>
|
||||
#include <zephyr/kernel/mm/demand_paging.h>
|
||||
#include <zephyr/timing/timing.h>
|
||||
#include <mmu.h>
|
||||
#include <zephyr/linker/sections.h>
|
||||
|
|
Loading…
Reference in a new issue