tests: demand_paging: pin fatal error handler

This puts the fatal error handler into pinned sections so
it can be used to handle fatal errors without causing
page faults.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-07-12 13:31:51 -07:00 committed by Christopher Friedt
commit 46ae0a5664

View file

@ -8,6 +8,7 @@
#include <sys/mem_manage.h> #include <sys/mem_manage.h>
#include <timing/timing.h> #include <timing/timing.h>
#include <mmu.h> #include <mmu.h>
#include <linker/sections.h>
#ifdef CONFIG_BACKING_STORE_RAM_PAGES #ifdef CONFIG_BACKING_STORE_RAM_PAGES
#define EXTRA_PAGES (CONFIG_BACKING_STORE_RAM_PAGES - 1) #define EXTRA_PAGES (CONFIG_BACKING_STORE_RAM_PAGES - 1)
@ -58,8 +59,10 @@ k_mem_paging_backing_store_histogram_bounds[
size_t arena_size; size_t arena_size;
char *arena; char *arena;
__pinned_bss
static bool expect_fault; static bool expect_fault;
__pinned_func
void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf) void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf)
{ {
printk("Caught system error -- reason %d\n", reason); printk("Caught system error -- reason %d\n", reason);