Author: bonefish Date: 2010-02-17 17:00:05 +0100 (Wed, 17 Feb 2010) New Revision: 35509 Changeset: http://dev.haiku-os.org/changeset/35509/haiku Modified: haiku/trunk/src/system/kernel/device_manager/IORequest.cpp Log: Added several TODOs for problems of the IOBuffer virtual vecs code. Modified: haiku/trunk/src/system/kernel/device_manager/IORequest.cpp =================================================================== --- haiku/trunk/src/system/kernel/device_manager/IORequest.cpp 2010-02-17 15:58:12 UTC (rev 35508) +++ haiku/trunk/src/system/kernel/device_manager/IORequest.cpp 2010-02-17 16:00:05 UTC (rev 35509) @@ -131,6 +131,8 @@ // recycle a potential previously mapped page if (cookie->physical_page_handle != NULL) { +// TODO: This check is invalid! The physical page mapper is not required to +// return a non-NULL handle (the generic implementation does not)! vm_put_physical_page(cookie->virtual_address, cookie->physical_page_handle); } @@ -148,6 +150,8 @@ void* mappedAddress; addr_t mappedSize; +// TODO: This is a potential violation of the VIP requirement, since +// vm_map_physical_memory_vecs() allocates memory without special flags! cookie->mapped_area = vm_map_physical_memory_vecs( VMAddressSpace::KernelID(), "io buffer mapped physical vecs", &mappedAddress, B_ANY_KERNEL_ADDRESS, &mappedSize, @@ -166,6 +170,8 @@ addr_t address = (addr_t)currentVec.iov_base + cookie->vec_offset; addr_t pageOffset = address % B_PAGE_SIZE; +// TODO: This is a potential violation of the VIP requirement, since +// vm_get_physical_page() may allocate memory without special flags! status_t result = vm_get_physical_page(address - pageOffset, &cookie->virtual_address, &cookie->physical_page_handle); if (result != B_OK) @@ -193,6 +199,7 @@ virtual_vec_cookie* cookie = (virtual_vec_cookie*)_cookie; if (cookie->mapped_area >= 0) delete_area(cookie->mapped_area); +// TODO: A vm_get_physical_page() may still be unmatched! free_etc(cookie, fVIP ? HEAP_PRIORITY_VIP : 0); }