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

Function _expand_varea

components/mm/mm_aspace.c:280–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280static rt_err_t _expand_varea(rt_varea_t varea, void *new_va, rt_size_t size)
281{
282 rt_err_t error;
283 rt_aspace_t aspace;
284 void *old_va;
285
286 if (varea->mem_obj && varea->mem_obj->on_varea_expand)
287 error = varea->mem_obj->on_varea_expand(varea, new_va, size);
288 else
289 error = -RT_EPERM;
290
291 if (error == RT_EOK)
292 {
293 aspace = varea->aspace;
294 old_va = varea->start;
295 varea->size = size;
296
297 if (old_va != new_va)
298 {
299 varea->start = new_va;
300 varea->offset += ((long)new_va - (long)old_va) >> MM_PAGE_SHIFT;
301 _aspace_bst_remove(aspace, varea);
302 _aspace_bst_insert(aspace, varea);
303 }
304 }
305 return error;
306}
307
308struct _mapping_property {
309 rt_size_t attr;

Callers 1

Calls 2

_aspace_bst_removeFunction · 0.70
_aspace_bst_insertFunction · 0.70

Tested by

no test coverage detected