MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / lwp_aspace_switch

Function lwp_aspace_switch

components/lwp/lwp_user_mm.c:154–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void lwp_aspace_switch(struct rt_thread *thread)
155{
156 struct rt_lwp *lwp = RT_NULL;
157 rt_aspace_t to_aspace;
158 void *from_tbl, *to_table;
159
160 if (thread->lwp)
161 {
162 lwp = (struct rt_lwp *)thread->lwp;
163 to_aspace = lwp->aspace;
164 to_table = to_aspace->page_table;
165 }
166 else
167 {
168 to_aspace = &rt_kernel_space;
169 /* the page table is arch dependent but not aspace->page_table */
170 to_table = arch_kernel_mmu_table_get();
171 }
172
173 /* must fetch the effected page table to avoid hot update */
174 from_tbl = rt_hw_mmu_tbl_get();
175 if (to_table != from_tbl)
176 {
177 rt_hw_aspace_switch(to_aspace);
178 }
179}
180
181void lwp_unmap_user_space(struct rt_lwp *lwp)
182{

Callers 3

lwp_fork_aspaceFunction · 0.85
sys_execveFunction · 0.85

Calls 3

rt_hw_mmu_tbl_getFunction · 0.50
rt_hw_aspace_switchFunction · 0.50

Tested by

no test coverage detected