Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#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>

Macros

#define HALF_PAGES   (EXTRA_PAGES / 2)
 
#define HALF_BYTES   (HALF_PAGES * CONFIG_MMU_PAGE_SIZE)
 

Functions

__pinned_func void k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf)
 Fatal error policy handler.
 
 ZTEST (demand_paging, test_map_anon_pages)
 
static void print_paging_stats (struct k_mem_paging_stats_t *stats, const char *scope)
 
static void touch_anon_pages (bool zig, bool zag)
 
 ZTEST (demand_paging, test_touch_anon_pages)
 
 ZTEST (demand_paging, test_touch_anon_pages_zigzag1)
 
 ZTEST (demand_paging, test_touch_anon_pages_zigzag2)
 
 ZTEST (demand_paging, test_unmap_anon_pages)
 
static void test_k_mem_page_out (void)
 
 ZTEST (demand_paging_api, test_k_mem_page_in)
 
 ZTEST (demand_paging_api, test_k_mem_pin)
 
 ZTEST (demand_paging_api, test_k_mem_unpin)
 
 ZTEST (demand_paging_stat, test_backing_store_capacity)
 
 ZTEST_USER (demand_paging_stat, test_user_get_stats)
 
static bool print_histogram (struct k_mem_paging_histogram_t *hist)
 
 ZTEST_USER (demand_paging_stat, test_user_get_hist)
 
void * demand_paging_api_setup (void)
 
 ZTEST_SUITE (demand_paging, NULL, NULL, NULL, NULL, NULL)
 
 ZTEST_SUITE (demand_paging_api, NULL, demand_paging_api_setup, NULL, NULL, NULL)
 
 ZTEST_SUITE (demand_paging_stat, NULL, NULL, NULL, NULL, NULL)
 

Variables

size_t arena_size
 
char * arena
 
static __pinned_bss bool expect_fault
 
static const char * nums = "0123456789"
 

Macro Definition Documentation

◆ HALF_BYTES

#define HALF_BYTES   (HALF_PAGES * CONFIG_MMU_PAGE_SIZE)

◆ HALF_PAGES

#define HALF_PAGES   (EXTRA_PAGES / 2)

Function Documentation

◆ demand_paging_api_setup()

void * demand_paging_api_setup ( void  )

◆ print_histogram()

static bool print_histogram ( struct k_mem_paging_histogram_t hist)
static

◆ print_paging_stats()

static void print_paging_stats ( struct k_mem_paging_stats_t stats,
const char *  scope 
)
static

◆ test_k_mem_page_out()

static void test_k_mem_page_out ( void  )
static

◆ touch_anon_pages()

static void touch_anon_pages ( bool  zig,
bool  zag 
)
static

◆ ZTEST() [1/9]

ZTEST ( demand_paging  ,
test_map_anon_pages   
)

◆ ZTEST() [2/9]

ZTEST ( demand_paging  ,
test_touch_anon_pages   
)

◆ ZTEST() [3/9]

ZTEST ( demand_paging  ,
test_touch_anon_pages_zigzag1   
)

◆ ZTEST() [4/9]

ZTEST ( demand_paging  ,
test_touch_anon_pages_zigzag2   
)

◆ ZTEST() [5/9]

ZTEST ( demand_paging  ,
test_unmap_anon_pages   
)

◆ ZTEST() [6/9]

ZTEST ( demand_paging_api  ,
test_k_mem_page_in   
)

◆ ZTEST() [7/9]

ZTEST ( demand_paging_api  ,
test_k_mem_pin   
)

◆ ZTEST() [8/9]

ZTEST ( demand_paging_api  ,
test_k_mem_unpin   
)

◆ ZTEST() [9/9]

ZTEST ( demand_paging_stat  ,
test_backing_store_capacity   
)

◆ ZTEST_SUITE() [1/3]

ZTEST_SUITE ( demand_paging  ,
NULL  ,
NULL  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [2/3]

ZTEST_SUITE ( demand_paging_api  ,
NULL  ,
demand_paging_api_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [3/3]

ZTEST_SUITE ( demand_paging_stat  ,
NULL  ,
NULL  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_USER() [1/2]

ZTEST_USER ( demand_paging_stat  ,
test_user_get_hist   
)

◆ ZTEST_USER() [2/2]

ZTEST_USER ( demand_paging_stat  ,
test_user_get_stats   
)

Variable Documentation

◆ arena

char* arena

◆ arena_size

size_t arena_size

◆ expect_fault

__pinned_bss bool expect_fault
static

◆ nums

const char* nums = "0123456789"
static