Lines Matching refs:inner
26 inner: SpinLock<InnerMemBlockManager>, field
45 inner: SpinLock::new(InnerMemBlockManager { in new()
73 let mut inner = self.inner.lock(); in add_range() localVariable
74 if inner.initial_memory_regions_num >= INITIAL_MEMORY_REGIONS_NUM { in add_range()
80 if inner.initial_memory_regions_num == 0 { in add_range()
81 inner.initial_memory_regions[0] = block; in add_range()
82 inner.initial_memory_regions_num += 1; in add_range()
88 .do_add_block(&mut inner, block, false, flags) in add_range()
91 if inner.initial_memory_regions_num + blocks_to_add > INITIAL_MEMORY_REGIONS_NUM { in add_range()
97 self.do_add_block(&mut inner, block, true, flags) in add_range()
105 inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, in do_add_block()
118 while i < inner.initial_memory_regions_num { in do_add_block()
119 let range_base = inner.initial_memory_regions[i].base; in do_add_block()
121 inner.initial_memory_regions[i].base + inner.initial_memory_regions[i].size; in do_add_block()
140 self.do_insert_area(inner, i, base, range_base - base, flags); in do_add_block()
156 self.do_insert_area(inner, i, base, end - base, flags); in do_add_block()
165 self.do_merge_blocks(inner, start_index, end_index); in do_add_block()
172 inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, in do_insert_area()
178 let copy_elements = inner.initial_memory_regions_num - index; in do_insert_area()
179 inner in do_insert_area()
182 inner.initial_memory_regions[index] = PhysMemoryArea::new(base, size, flags); in do_insert_area()
183 inner.initial_memory_regions_num += 1; in do_insert_area()
188 inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, in do_merge_blocks()
196 end_index = core::cmp::min(end_index, inner.initial_memory_regions_num as isize - 1); in do_merge_blocks()
200 let next_base = inner.initial_memory_regions[(i + 1) as usize].base; in do_merge_blocks()
201 let next_size = inner.initial_memory_regions[(i + 1) as usize].size; in do_merge_blocks()
202 let next_flags = inner.initial_memory_regions[(i + 1) as usize].flags; in do_merge_blocks()
203 let this = &mut inner.initial_memory_regions[i as usize]; in do_merge_blocks()
215 let copy_elements = inner.initial_memory_regions_num - (i + 2) as usize; in do_merge_blocks()
216 inner.initial_memory_regions.copy_within( in do_merge_blocks()
221 inner.initial_memory_regions_num -= 1; in do_merge_blocks()
234 let mut inner = self.inner.lock(); in remove_block() localVariable
235 if inner.initial_memory_regions_num == 0 { in remove_block()
240 .isolate_range(&mut inner, base, size) in remove_block()
244 self.do_remove_region(&mut inner, i); in remove_block()
249 fn do_remove_region(&self, inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, index: usize) { in do_remove_region()
250 let copy_elements = inner.initial_memory_regions_num - index - 1; in do_remove_region()
251 inner in do_remove_region()
255 inner.initial_memory_regions_num -= 1; in do_remove_region()
257 if inner.initial_memory_regions_num == 0 { in do_remove_region()
258 inner.initial_memory_regions[0].base = PhysAddr::new(0); in do_remove_region()
259 inner.initial_memory_regions[0].size = 0; in do_remove_region()
274 inner: &mut SpinLockGuard<'_, InnerMemBlockManager>, in isolate_range()
289 while idx < inner.initial_memory_regions_num { in isolate_range()
290 let range_base = inner.initial_memory_regions[idx].base; in isolate_range()
291 let range_end = range_base + inner.initial_memory_regions[idx].size; in isolate_range()
303 inner.initial_memory_regions[idx].base = base; in isolate_range()
304 inner.initial_memory_regions[idx].size -= base - range_base; in isolate_range()
306 inner, in isolate_range()
310 inner.initial_memory_regions[idx].flags, in isolate_range()
314 inner.initial_memory_regions[idx].base = end; in isolate_range()
315 inner.initial_memory_regions[idx].size -= end - range_base; in isolate_range()
318 inner, in isolate_range()
322 inner.initial_memory_regions[idx].flags, in isolate_range()
372 let mut inner = self.inner.lock(); in set_or_clear_flags() localVariable
373 let (start_index, end_index) = self.isolate_range(&mut inner, base, size)?; in set_or_clear_flags()
376 inner.initial_memory_regions[i].flags |= flags; in set_or_clear_flags()
378 inner.initial_memory_regions[i].flags &= !flags; in set_or_clear_flags()
382 let num = inner.initial_memory_regions_num as isize; in set_or_clear_flags()
383 self.do_merge_blocks(&mut inner, 0, num); in set_or_clear_flags()
394 let inner = self.inner.lock(); in is_overlapped() localVariable
395 return self.do_is_overlapped(base, size, false, &inner); in is_overlapped()
400 let inner = self.inner.lock(); in is_overlapped_with_reserved() localVariable
401 return self.do_is_overlapped(base, size, true, &inner); in is_overlapped_with_reserved()
409 inner: &SpinLockGuard<'_, InnerMemBlockManager>, in do_is_overlapped()
412 for i in 0..inner.initial_memory_regions_num { in do_is_overlapped()
414 && !inner.initial_memory_regions[i] in do_is_overlapped()
422 let range_base = inner.initial_memory_regions[i].base; in do_is_overlapped()
423 let range_end = range_base + inner.initial_memory_regions[i].size; in do_is_overlapped()
438 let inner = self.inner.lock(); in to_iter() localVariable
440 inner, in to_iter()
448 let inner = self.inner.lock(); in to_iter_available() localVariable
450 inner, in to_iter_available()
458 let inner = self.inner.lock(); in total_initial_memory_regions() localVariable
459 return inner.initial_memory_regions_num; in total_initial_memory_regions()
464 let inner = self.inner.lock(); in get_initial_memory_region() localVariable
465 return inner.initial_memory_regions.get(index).copied(); in get_initial_memory_region()
470 inner: SpinLockGuard<'a, InnerMemBlockManager>, field
479 self.inner.initial_memory_regions_num in total_num()
484 &self.inner.initial_memory_regions[index] in get_area()
497 while self.index < self.inner.initial_memory_regions_num { in next()
499 && !self.inner.initial_memory_regions[self.index] in next()
504 if self.index >= self.inner.initial_memory_regions_num { in next()
511 if self.index >= self.inner.initial_memory_regions_num { in next()
514 let ret = self.inner.initial_memory_regions[self.index]; in next()