Lines Matching refs:thread
19 #define MEM_REGION_TO_MPU_INDEX(thread, region) ((((rt_size_t)region - (rt_size_t)(thread->mem_regi… argument
21 extern rt_mem_region_t *rt_mprotect_find_free_region(rt_thread_t thread);
22 extern rt_mem_region_t *rt_mprotect_find_region(rt_thread_t thread, rt_mem_region_t *region);
134 rt_err_t rt_hw_mpu_add_region(rt_thread_t thread, rt_mem_region_t *region) in rt_hw_mpu_add_region() argument
143 if (thread == RT_NULL) in rt_hw_mpu_add_region()
148 free_region = rt_mprotect_find_free_region(thread); in rt_hw_mpu_add_region()
156 if (thread == rt_thread_self()) in rt_hw_mpu_add_region()
158 index = MEM_REGION_TO_MPU_INDEX(thread, free_region); in rt_hw_mpu_add_region()
165 rt_err_t rt_hw_mpu_delete_region(rt_thread_t thread, rt_mem_region_t *region) in rt_hw_mpu_delete_region() argument
169 rt_mem_region_t *found_region = rt_mprotect_find_region(thread, region); in rt_hw_mpu_delete_region()
177 if (thread == rt_thread_self()) in rt_hw_mpu_delete_region()
179 index = MEM_REGION_TO_MPU_INDEX(thread, found_region); in rt_hw_mpu_delete_region()
186 rt_err_t rt_hw_mpu_update_region(rt_thread_t thread, rt_mem_region_t *region) in rt_hw_mpu_update_region() argument
195 rt_mem_region_t *old_region = rt_mprotect_find_region(thread, region); in rt_hw_mpu_update_region()
203 if (thread == rt_thread_self()) in rt_hw_mpu_update_region()
205 index = MEM_REGION_TO_MPU_INDEX(thread, old_region); in rt_hw_mpu_update_region()
218 void rt_hw_mpu_table_switch(rt_thread_t thread) in rt_hw_mpu_table_switch() argument
223 if (thread->mem_regions != RT_NULL) in rt_hw_mpu_table_switch()
227 if (((rt_mem_region_t *)thread->mem_regions)[i].size != 0U) in rt_hw_mpu_table_switch()
229 …_RBAR(index, (rt_uint32_t)(((rt_mem_region_t *)thread->mem_regions)[i].start)), ((rt_mem_region_t … in rt_hw_mpu_table_switch()
236 if ((exclusive_regions[i].owner != RT_NULL) && (exclusive_regions[i].owner != thread)) in rt_hw_mpu_table_switch()
255 info.thread = rt_thread_self(); in MemManage_Handler()
269 if (info.thread->mem_regions != RT_NULL) in MemManage_Handler()
273 …((((rt_mem_region_t *)info.thread->mem_regions)[i].size != 0U) && ADDR_IN_REGION(info.addr, &(((rt… in MemManage_Handler()
275 …rt_memcpy(&(info.region), &(((rt_mem_region_t *)info.thread->mem_regions)[i]), sizeof(rt_mem_regio… in MemManage_Handler()