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

Function lwp_map_user

components/lwp/lwp_user_mm.c:235–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void *lwp_map_user(struct rt_lwp *lwp, void *map_va, size_t map_size, int text)
236{
237 void *ret = RT_NULL;
238 size_t offset = 0;
239
240 if (!map_size)
241 {
242 return 0;
243 }
244 offset = (size_t)map_va & ARCH_PAGE_MASK;
245 map_size += (offset + ARCH_PAGE_SIZE - 1);
246 map_size &= ~ARCH_PAGE_MASK;
247 map_va = (void *)((size_t)map_va & ~ARCH_PAGE_MASK);
248
249 ret = _lwp_map_user(lwp, map_va, map_size, text);
250
251 if (ret)
252 {
253 ret = (void *)((char *)ret + offset);
254 }
255 return ret;
256}
257
258static inline size_t _flags_to_attr(size_t flags)
259{

Callers 4

sys_thread_createFunction · 0.85
arch_expand_user_stackFunction · 0.85
arch_expand_user_stackFunction · 0.85
arch_expand_user_stackFunction · 0.85

Calls 1

_lwp_map_userFunction · 0.85

Tested by

no test coverage detected