diff options
| author | tangzz98 <[email protected]> | 2023-10-30 08:24:55 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-30 08:24:55 -0400 |
| commit | acc66c547999ce444b79efccd67625a1af347d5d (patch) | |
| tree | 316bb953009ba0b0e9a77422d767fd7d82d50466 /include | |
| parent | 1554888c0b004bac7098e2a92a32603dd26b452c (diff) | |
实现MPU抽象层 (#8080)
- 为RT-Thread设计MPU抽象层,支持ARMV7-M,ARMV8-M架构,让用户使用MPU检测栈溢出等内存问题,实现线程内存隔离
- 在components/mp目录下提供通用的API,libcpu目录下提供各处理器架构的具体实现
- 在STM32U575 NUCLEO, STM32H75 NUCLEO开发板测试通过
Diffstat (limited to 'include')
| -rw-r--r-- | include/rtdef.h | 8 | ||||
| -rw-r--r-- | include/rthw.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index c62167f73f..10edc25df1 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -997,6 +997,14 @@ struct rt_thread int *clear_child_tid; #endif /* ARCH_MM_MMU */ #endif /* RT_USING_SMART */ + +#ifdef RT_USING_MEM_PROTECTION + void *mem_regions; +#ifdef RT_USING_HW_STACK_GUARD + void *stack_buf; +#endif +#endif + rt_atomic_t ref_count; struct rt_spinlock spinlock; rt_ubase_t user_data; /**< private user data beyond this thread */ diff --git a/include/rthw.h b/include/rthw.h index 6e7773805a..ba3bb14cbd 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -99,6 +99,10 @@ rt_uint8_t *rt_hw_stack_init(void *entry, rt_uint8_t *stack_addr, void *exit); +#ifdef RT_USING_HW_STACK_GUARD +void rt_hw_stack_guard_init(rt_thread_t thread); +#endif + /* * Interrupt handler definition */ |
