diff --git a/src/system/kernel/vm/VMUserAddressSpace.cpp b/src/system/kernel/vm/VMUserAddressSpace.cpp
index 9e91b6cdd5..845628c844 100644
a
|
b
|
|
24 | 24 | #include <vm/VMArea.h> |
25 | 25 | |
26 | 26 | |
27 | | //#define TRACE_VM |
| 27 | #define TRACE_VM |
28 | 28 | #ifdef TRACE_VM |
29 | 29 | # define TRACE(x) dprintf x |
30 | 30 | #else |
… |
… |
status_t
|
450 | 450 | VMUserAddressSpace::_InsertAreaIntoReservedRegion(addr_t start, size_t size, |
451 | 451 | VMUserArea* area, uint32 allocationFlags) |
452 | 452 | { |
| 453 | TRACE(("VMUserAddressSpace::_InsertAreaIntoReservedRegion: address space %p, start " |
| 454 | "0x%lx, size %ld, area %p\n", |
| 455 | this, start, size, area)); |
| 456 | |
453 | 457 | VMUserArea* next; |
454 | 458 | |
455 | 459 | for (VMUserAreaList::Iterator it = fAreas.GetIterator(); |
… |
… |
second_chance:
|
770 | 774 | return B_BAD_VALUE; |
771 | 775 | } |
772 | 776 | |
773 | | if (!foundSpot) |
| 777 | if (!foundSpot) { |
| 778 | TRACE(("121\n")); |
774 | 779 | return addressSpec == B_EXACT_ADDRESS ? B_BAD_VALUE : B_NO_MEMORY; |
| 780 | } |
775 | 781 | |
776 | 782 | area->SetSize(size); |
777 | 783 | if (last) |
diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp
index f182ab53b4..6ef6163564 100644
a
|
b
|
|
59 | 59 | #include "IORequest.h" |
60 | 60 | |
61 | 61 | |
62 | | //#define TRACE_VM |
| 62 | #define TRACE_VM |
63 | 63 | //#define TRACE_FAULTS |
64 | 64 | #ifdef TRACE_VM |
65 | 65 | # define TRACE(x) dprintf x |
… |
… |
static status_t
|
618 | 618 | cut_area(VMAddressSpace* addressSpace, VMArea* area, addr_t address, |
619 | 619 | addr_t lastAddress, VMArea** _secondArea, bool kernel) |
620 | 620 | { |
| 621 | TRACE(("cut_area: aspace %p, address %" B_PRIuADDR ", lastAddress %" B_PRIuADDR |
| 622 | ", kernel %d\n", addressSpace, address, lastAddress, kernel)); |
| 623 | |
621 | 624 | // Does the cut range intersect with the area at all? |
622 | 625 | addr_t areaLast = area->Base() + (area->Size() - 1); |
623 | 626 | if (area->Base() > lastAddress || areaLast < address) |
… |
… |
static status_t
|
747 | 750 | unmap_address_range(VMAddressSpace* addressSpace, addr_t address, addr_t size, |
748 | 751 | bool kernel) |
749 | 752 | { |
| 753 | TRACE(("unmap_address_range: aspace %p, address %" B_PRIuADDR ", size %" B_PRIuADDR |
| 754 | ", kernel %d\n", addressSpace, address, size, kernel)); |
| 755 | |
750 | 756 | size = PAGE_ALIGN(size); |
751 | 757 | addr_t lastAddress = address + (size - 1); |
752 | 758 | |
… |
… |
map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
857 | 863 | |
858 | 864 | if ((flags & CREATE_AREA_DONT_COMMIT_MEMORY) == 0) { |
859 | 865 | status = cache->SetMinimalCommitment(size, priority); |
| 866 | TRACE(("err2 CREATE_AREA_DONT_COMMIT_MEMORY: %d\n", status)); |
860 | 867 | if (status != B_OK) |
861 | 868 | goto err2; |
862 | 869 | } |
… |
… |
map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
866 | 873 | // okay, someone is trying to delete this address space now, so we can't |
867 | 874 | // insert the area, so back out |
868 | 875 | status = B_BAD_TEAM_ID; |
| 876 | TRACE(("err2 IsBeingDeleted: %d\n", status)); |
869 | 877 | goto err2; |
870 | 878 | } |
871 | 879 | |
… |
… |
map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
887 | 895 | // for space to be freed up, but it would be good to at least notify |
888 | 896 | // that we tried and failed to allocate some amount. |
889 | 897 | } |
| 898 | TRACE(("err2 InsertArea: %d\n", status)); |
890 | 899 | if (status != B_OK) |
891 | 900 | goto err2; |
892 | 901 | |
… |
… |
map_backing_store(VMAddressSpace* addressSpace, VMCache* cache, off_t offset,
|
912 | 921 | return B_OK; |
913 | 922 | |
914 | 923 | err2: |
| 924 | TRACE(("map_backing_store: err2\n")); |
915 | 925 | if (mapping == REGION_PRIVATE_MAP) { |
916 | 926 | // We created this cache, so we must delete it again. Note, that we |
917 | 927 | // need to temporarily unlock the source cache or we'll otherwise |
… |
… |
err2:
|
921 | 931 | sourceCache->Lock(); |
922 | 932 | } |
923 | 933 | err1: |
| 934 | TRACE(("map_backing_store: err1\n")); |
924 | 935 | addressSpace->DeleteArea(area, allocationFlags); |
925 | 936 | return status; |
926 | 937 | } |