7#ifndef ZEPHYR_INCLUDE_KERNEL_MM_DEMAND_PAGING_H
8#define ZEPHYR_INCLUDE_KERNEL_MM_DEMAND_PAGING_H
32struct k_mem_page_frame;
38#if defined(CONFIG_DEMAND_PAGING_STATS) || defined(__DOXYGEN__)
49#if !defined(CONFIG_DEMAND_PAGING_ALLOW_IRQ) || defined(__DOXYGEN__)
69#if defined(CONFIG_DEMAND_PAGING_TIMING_HISTOGRAM) || defined(__DOXYGEN__)
71 unsigned long counts[CONFIG_DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS];
76 unsigned long bounds[CONFIG_DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS];
208#include <zephyr/syscalls/demand_paging.h>
int k_mem_paging_backing_store_location_get(struct k_mem_page_frame *pf, uintptr_t *location, bool page_fault)
Reserve or fetch a storage location for a data page loaded into a page frame.
int k_mem_paging_backing_store_location_query(void *addr, uintptr_t *location)
Obtain persistent location token for on-demand content.
void k_mem_paging_backing_store_page_out(uintptr_t location)
Copy a data page from K_MEM_SCRATCH_PAGE to the specified location.
void k_mem_paging_backing_store_location_free(uintptr_t location)
Free a backing store location.
void k_mem_paging_backing_store_init(void)
Backing store initialization function.
void k_mem_paging_backing_store_page_finalize(struct k_mem_page_frame *pf, uintptr_t location)
Update internal accounting after a page-in.
void k_mem_paging_backing_store_page_in(uintptr_t location)
Copy a data page from the provided location to K_MEM_SCRATCH_PAGE.
void k_mem_paging_eviction_remove(struct k_mem_page_frame *pf)
Remove a page frame from potential eviction candidates.
void k_mem_paging_eviction_accessed(uintptr_t phys)
Process a page frame as being newly accessed.
void k_mem_paging_eviction_init(void)
Initialization function.
void k_mem_paging_eviction_add(struct k_mem_page_frame *pf)
Submit a page frame for eviction candidate tracking.
struct k_mem_page_frame * k_mem_paging_eviction_select(bool *dirty)
Select a page frame for eviction.
int k_mem_page_out(void *addr, size_t size)
Evict a page-aligned virtual memory region to the backing store.
void k_mem_paging_histogram_backing_store_page_in_get(struct k_mem_paging_histogram_t *hist)
Get the backing store page-in timing histogram.
void k_mem_unpin(void *addr, size_t size)
Un-pin an aligned virtual data region.
void k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats)
Get the paging statistics since system startup.
void k_mem_pin(void *addr, size_t size)
Pin an aligned virtual data region, paging in as necessary.
void k_mem_page_in(void *addr, size_t size)
Load a virtual data region into memory.
void k_mem_paging_histogram_backing_store_page_out_get(struct k_mem_paging_histogram_t *hist)
Get the backing store page-out timing histogram.
void k_mem_paging_histogram_eviction_get(struct k_mem_paging_histogram_t *hist)
Get the eviction timing histogram.
void k_mem_paging_thread_stats_get(struct k_thread *thread, struct k_mem_paging_stats_t *stats)
Get the paging statistics since system startup for a thread.
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
Paging Statistics Histograms.
Definition demand_paging.h:68
unsigned long counts[CONFIG_DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS]
Definition demand_paging.h:71
unsigned long bounds[CONFIG_DEMAND_PAGING_TIMING_HISTOGRAM_NUM_BINS]
Definition demand_paging.h:76
Paging Statistics.
Definition demand_paging.h:37
unsigned long in_isr
Number of page faults while in ISR.
Definition demand_paging.h:51
struct k_mem_paging_stats_t::@315 eviction
unsigned long irq_unlocked
Number of page faults with IRQ unlocked.
Definition demand_paging.h:47
unsigned long cnt
Number of page faults.
Definition demand_paging.h:41
unsigned long dirty
Number of dirty pages selected for eviction.
Definition demand_paging.h:60
unsigned long clean
Number of clean pages selected for eviction.
Definition demand_paging.h:57
unsigned long irq_locked
Number of page faults with IRQ locked.
Definition demand_paging.h:44
struct k_mem_paging_stats_t::@314 pagefaults
Thread Structure.
Definition thread.h:259