Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference

x86-specific tests for MMU features and page tables More...

#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/tc_util.h>
#include <zephyr/arch/x86/mmustructs.h>
#include <x86_mmu.h>
#include <zephyr/linker/linker-defs.h>
#include <mmu.h>
#include "main.h"
#include <zephyr/sys/libc-hooks.h>
#include <zephyr/syscalls/dump_my_ptables_mrsh.c>

Macros

#define PT_LEVEL   1
 
#define FLAGS_MASK
 
#define LPTR(name, suffix)
 
#define LSIZE(name, suffix)
 
#define IN_REGION(name, virt)
 

Functions

static pentry_t get_entry (pentry_t *flags, void *addr)
 
void test_ram_perms (void)
 Test that MMU flags on RAM virtual address range are set properly.
 
void test_null_map (void)
 Test that the NULL virtual page is always non-present.
 
void dump_pagetables (void)
 
void test_dump_ptables_user (void)
 Dump kernel's page tables to console.
 
void test_dump_ptables (void)
 
 ZTEST_SUITE (x86_pagetables, NULL, NULL, NULL, NULL, NULL)
 

Detailed Description

x86-specific tests for MMU features and page tables

Macro Definition Documentation

◆ FLAGS_MASK

#define FLAGS_MASK
Value:
(MMU_P | MMU_RW | MMU_US | MMU_PWT | MMU_PCD | \
MMU_G | MMU_PS | MMU_XD)

◆ IN_REGION

#define IN_REGION ( name,
virt )
Value:
(virt >= LPTR(name, _start) && \
virt < (LPTR(name, _start) + LSIZE(name, _size)))
#define LSIZE(name, suffix)
Definition main.c:36
#define LPTR(name, suffix)
Definition main.c:35

◆ LPTR

#define LPTR ( name,
suffix )
Value:
((uint8_t *)&_CONCAT(name, suffix))
__UINT8_TYPE__ uint8_t
Definition stdint.h:88

◆ LSIZE

#define LSIZE ( name,
suffix )
Value:
((size_t)&_CONCAT(name, suffix))
Size of off_t must be equal or less than size of size_t
Definition retained_mem.h:28

◆ PT_LEVEL

#define PT_LEVEL   1

Function Documentation

◆ dump_pagetables()

void dump_pagetables ( void )

◆ get_entry()

static pentry_t get_entry ( pentry_t * flags,
void * addr )
static

◆ test_dump_ptables()

void test_dump_ptables ( void )

◆ ZTEST_SUITE()

ZTEST_SUITE ( x86_pagetables ,
NULL ,
NULL ,
NULL ,
NULL ,
NULL  )