mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-07 00:59:00 +08:00
This patch refactors the `rt_page_install` function by delegating specific operations to new helper functions. Besides, the contiguous page regions are now separated to segments of fixed size. The goal is to improve the overall code readability, enhance modularity, and ensure better handling of page installation logic through clearer separation of concerns. Changes: - Introduced `_get_mpr_ready_n_install` to encapsulate memory preparation and page installation logic. - Added `_update_region_list` for updating the installed page registry. - Defined `_PAGE_STRIPE` for optimized region processing. - Modified `rt_page_install` to handle regions in smaller chunks using helper functions for better maintainability. - Improved locking mechanisms with `rt_spin_lock` for thread safety. - Reduced code duplication and clarified shadow region calculations. Signed-off-by: Shell <smokewood@qq.com>