Lines Matching refs:size
56 pub fn add_block(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in add_block()
57 let r = self.add_range(base, size, MemoryAreaAttr::empty()); in add_block()
67 size: usize, in add_range()
70 if size == 0 { in add_range()
78 let block = PhysMemoryArea::new(base, size, MemoryAreaAttr::empty()); in add_range()
111 let end = block.base + block.size; in do_add_block()
121 inner.initial_memory_regions[i].base + inner.initial_memory_regions[i].size; in do_add_block()
175 size: usize, in do_insert_area()
182 inner.initial_memory_regions[index] = PhysMemoryArea::new(base, size, flags); in do_insert_area()
201 let next_size = inner.initial_memory_regions[(i + 1) as usize].size; in do_merge_blocks()
205 if this.base + this.size != next_base || this.flags != next_flags { in do_merge_blocks()
206 if unlikely(this.base + this.size > next_base) { in do_merge_blocks()
212 this.size += next_size; in do_merge_blocks()
230 pub fn remove_block(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in remove_block()
231 if size == 0 { in remove_block()
240 .isolate_range(&mut inner, base, size) in remove_block()
259 inner.initial_memory_regions[0].size = 0; in do_remove_region()
276 size: usize, in isolate_range()
278 let end = base + size; in isolate_range()
285 if size == 0 { in isolate_range()
291 let range_end = range_base + inner.initial_memory_regions[idx].size; in isolate_range()
304 inner.initial_memory_regions[idx].size -= base - range_base; in isolate_range()
315 inner.initial_memory_regions[idx].size -= end - range_base; in isolate_range()
352 pub fn mark_nomap(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in mark_nomap()
353 return self.set_or_clear_flags(base, size, true, MemoryAreaAttr::NOMAP); in mark_nomap()
357 pub fn mark_mirror(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in mark_mirror()
358 return self.set_or_clear_flags(base, size, true, MemoryAreaAttr::MIRROR); in mark_mirror()
364 mut size: usize, in set_or_clear_flags()
369 size = page_align_up(size + base.data() - rsvd_base.data()); in set_or_clear_flags()
373 let (start_index, end_index) = self.isolate_range(&mut inner, base, size)?; in set_or_clear_flags()
388 pub fn reserve_block(&self, base: PhysAddr, size: usize) -> Result<(), SystemError> { in reserve_block()
389 return self.set_or_clear_flags(base, size, true, MemoryAreaAttr::RESERVED); in reserve_block()
393 pub fn is_overlapped(&self, base: PhysAddr, size: usize) -> bool { in is_overlapped()
395 return self.do_is_overlapped(base, size, false, &inner); in is_overlapped()
399 pub fn is_overlapped_with_reserved(&self, base: PhysAddr, size: usize) -> bool { in is_overlapped_with_reserved()
401 return self.do_is_overlapped(base, size, true, &inner); in is_overlapped_with_reserved()
407 size: usize, in do_is_overlapped()
423 let range_end = range_base + inner.initial_memory_regions[i].size; in do_is_overlapped()
425 || (base + size > range_base && base + size <= range_end) in do_is_overlapped()
426 || (base <= range_base && base + size >= range_end) in do_is_overlapped()