1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2023-9-25     tangzz98     the first version
9  */
10 
11 #include <rtthread.h>
12 #include <mprotect.h>
13 
mprotect_example_exception_hook(rt_mem_exception_info_t * info)14 void mprotect_example_exception_hook(rt_mem_exception_info_t *info)
15 {
16     rt_kprintf("Memory manage exception\n");
17     rt_kprintf("Faulting thread: %s\n", info->thread->parent.name);
18     rt_kprintf("Faulting address: %p\n", info->addr);
19     rt_kprintf("Faulting region: %p - %p", info->region.start, (void *)((rt_size_t)info->region.start + info->region.size));
20 }
21