Lines Matching refs:area

44 /*!	Verifies that an area with the given aligned base and size fits into
99 VMUserArea* area = fAreas.LeftMost();
100 while (area != NULL && area->id == RESERVED_AREA_ID)
101 area = fAreas.Next(area);
102 return area;
109 VMUserArea* area = static_cast<VMUserArea*>(_area);
110 area = fAreas.Next(area);
111 while (area != NULL && area->id == RESERVED_AREA_ID)
112 area = fAreas.Next(area);
113 return area;
128 VMUserArea* area = static_cast<VMUserArea*>(_area);
129 area->~VMUserArea();
130 free_etc(area, allocationFlags);
138 VMUserArea* area = fAreas.FindClosest(address, true);
139 if (area == NULL || area->id == RESERVED_AREA_ID)
142 return area->ContainsAddress(address) ? area : NULL;
150 VMUserArea* area = fAreas.FindClosest(address, less);
151 while (area != NULL && area->id == RESERVED_AREA_ID)
152 area = fAreas.Next(area);
153 return area;
157 /*! This inserts the area you pass into the address space.
167 VMUserArea* area = static_cast<VMUserArea*>(_area);
198 addressRestrictions->alignment, area, allocationFlags);
201 *_address = (void*)area->Base();
202 fFreeSpace -= area->Size();
213 VMUserArea* area = static_cast<VMUserArea*>(_area);
215 fAreas.Remove(area);
217 if (area->id != RESERVED_AREA_ID) {
219 fFreeSpace += area->Size();
225 VMUserAddressSpace::CanResizeArea(VMArea* area, size_t newSize)
227 VMUserArea* next = fAreas.Next(static_cast<VMUserArea*>(area));
228 addr_t newEnd = area->Base() + (newSize - 1);
236 // If the area was created inside a reserved area, it can
237 // also be resized in that area
238 // TODO: if there is free space after the reserved area, it could
241 && (uint64)next->cache_offset <= (uint64)area->Base()
250 VMUserArea* area = static_cast<VMUserArea*>(_area);
252 addr_t newEnd = area->Base() + (newSize - 1);
253 VMUserArea* next = fAreas.Next(area);
256 || (uint64)next->cache_offset > (uint64)area->Base()
258 panic("resize situation for area %p has changed although we "
259 "should have the address space lock", area);
263 // resize reserved area
264 addr_t offset = area->Base() + newSize - next->Base();
277 area->SetSize(newSize);
283 VMUserAddressSpace::ShrinkAreaHead(VMArea* area, size_t size,
286 size_t oldSize = area->Size();
290 area->SetBase(area->Base() + oldSize - size);
291 area->SetSize(size);
298 VMUserAddressSpace::ShrinkAreaTail(VMArea* area, size_t size,
301 size_t oldSize = area->Size();
305 area->SetSize(size);
319 // can't insert the area, let's back out
323 VMUserArea* area = VMUserArea::CreateReserved(this, flags, allocationFlags);
324 if (area == NULL)
327 status_t status = InsertArea(area, size, addressRestrictions,
330 area->~VMUserArea();
331 free_etc(area, allocationFlags);
335 area->cache_offset = area->Base();
350 // remove the area, so back out
354 // the area must be completely part of the reserved range
355 VMUserArea* area = fAreas.FindClosest(address, false);
356 if (area == NULL)
360 for (VMUserAreaTree::Iterator it = fAreas.GetIterator(area);
361 (area = it.Next()) != NULL
362 && area->Base() + area->Size() - 1 <= endAddress;) {
364 if (area->id == RESERVED_AREA_ID) {
366 RemoveArea(area, allocationFlags);
368 area->~VMUserArea();
369 free_etc(area, allocationFlags);
381 VMUserArea* area = it.Next();) {
382 if (area->id == RESERVED_AREA_ID) {
383 RemoveArea(area, allocationFlags);
385 area->~VMUserArea();
386 free_etc(area, allocationFlags);
399 VMUserArea* area = it.Next();) {
400 kprintf(" area 0x%" B_PRIx32 ": ", area->id);
401 kprintf("base_addr = 0x%lx ", area->Base());
402 kprintf("size = 0x%lx ", area->Size());
404 area->id != RESERVED_AREA_ID ? area->name : "reserved");
405 kprintf("protection = 0x%" B_PRIx32 "\n", area->protection);
443 /*! Finds a reserved area that covers the region spanned by \a start and
444 \a size, inserts the \a area into that region and makes sure that
449 VMUserArea* area, uint32 allocationFlags)
458 // This area covers the requested range
460 // but it's not reserved space, it's a real area
465 // range to the new area - and remove, resize or split the old
466 // reserved area.
469 // the area starts at the beginning of the reserved range
472 // the new area fully covers the reserved range
478 // resize the reserved range behind the area
483 // the area is at the end of the reserved range
484 // resize the reserved range before the area
487 // the area splits the reserved range into two separate ones
488 // we need a new reserved area to cover this space
507 area->SetBase(start);
508 area->SetSize(size);
509 fAreas.Insert(area);
519 uint32 addressSpec, size_t alignment, VMUserArea* area,
523 "0x%lx, size %ld, end 0x%lx, addressSpec %" B_PRIu32 ", area %p\n",
524 this, start, size, end, addressSpec, area));
531 if (addressSpec == B_EXACT_ADDRESS && area->id != RESERVED_AREA_ID) {
532 // search for a reserved area
533 status_t status = _InsertAreaIntoReservedRegion(start, size, area,
538 // There was no reserved area, and the slot doesn't seem to be used
572 // find the right spot depending on the address specification - the area
587 // find a hole big enough for a new area
601 area->SetBase(alignedBase);
624 area->SetBase(alignedBase);
647 area->SetBase(alignedBase);
668 } else if (area->id != RESERVED_AREA_ID) {
681 // TODO: take free space after the reserved area into
685 // The reserved area is entirely covered, and thus,
690 area->SetBase(alignedBase);
707 // The new area will be placed at the beginning of the
708 // reserved area and the reserved area will be offset
713 area->SetBase(alignedBase);
719 // The new area will be placed at the end of the
720 // reserved area, and the reserved area will be resized
744 area->SetBase(alignedBase);
760 area->SetBase(start);
772 fNextInsertHint = area->Base() + size;
774 area->SetSize(size);
775 fAreas.Insert(area);