| 1010 | } |
| 1011 | |
| 1012 | static int _unmap_range_locked(rt_aspace_t aspace, void *addr, size_t length) |
| 1013 | { |
| 1014 | int error = RT_EOK; |
| 1015 | rt_varea_t existed; |
| 1016 | struct _mm_range unmap_range; |
| 1017 | |
| 1018 | unmap_range.start = addr; |
| 1019 | unmap_range.end = addr + length - 1; |
| 1020 | |
| 1021 | existed = _aspace_bst_search_overlap(aspace, unmap_range); |
| 1022 | while (existed) |
| 1023 | { |
| 1024 | error = _remove_overlapped_varea(existed, addr, length); |
| 1025 | |
| 1026 | if (error == RT_EOK) |
| 1027 | existed = _aspace_bst_search_overlap(aspace, unmap_range); |
| 1028 | else |
| 1029 | break; |
| 1030 | } |
| 1031 | |
| 1032 | return error; |
| 1033 | } |
| 1034 | |
| 1035 | int rt_aspace_unmap_range(rt_aspace_t aspace, void *addr, size_t length) |
| 1036 | { |
no test coverage detected