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

Function _aspace_unmap

components/mm/mm_aspace.c:860–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860int _aspace_unmap(rt_aspace_t aspace, void *addr)
861{
862 int error;
863 rt_varea_t varea;
864
865 WR_LOCK(aspace);
866 varea = _aspace_bst_search(aspace, addr);
867
868 if (varea == RT_NULL)
869 {
870 LOG_D("%s: No such entry found at %p\n", __func__, addr);
871 error = -RT_ENOENT;
872 }
873 else
874 {
875 _varea_uninstall_locked(varea);
876 if (!(varea->flag & MMF_STATIC_ALLOC))
877 {
878 rt_free(varea);
879 }
880 error = RT_EOK;
881 }
882
883 WR_UNLOCK(aspace);
884 return error;
885}
886
887int rt_aspace_unmap(rt_aspace_t aspace, void *addr)
888{

Callers 1

rt_aspace_unmapFunction · 0.85

Calls 3

_varea_uninstall_lockedFunction · 0.85
rt_freeFunction · 0.85
_aspace_bst_searchFunction · 0.70

Tested by

no test coverage detected