From d4af8f3e3395ad758836c3ad0a6da5d54cfa8001 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 17 Feb 2010 16:00:05 +0000 Subject: [PATCH] Added several TODOs for problems of the IOBuffer virtual vecs code. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35509 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/device_manager/IORequest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/system/kernel/device_manager/IORequest.cpp b/src/system/kernel/device_manager/IORequest.cpp index a21eef1905..dc0b7f3278 100644 --- a/src/system/kernel/device_manager/IORequest.cpp +++ b/src/system/kernel/device_manager/IORequest.cpp @@ -131,6 +131,8 @@ IOBuffer::GetNextVirtualVec(void*& _cookie, iovec& vector) // 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 @@ IOBuffer::GetNextVirtualVec(void*& _cookie, iovec& vector) 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 @@ IOBuffer::GetNextVirtualVec(void*& _cookie, iovec& vector) 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 @@ IOBuffer::FreeVirtualVecCookie(void* _cookie) 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); }