| 152 | } |
| 153 | |
| 154 | void 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 | |
| 181 | void lwp_unmap_user_space(struct rt_lwp *lwp) |
| 182 | { |
no test coverage detected