Changeset 36360 in vbox
- Timestamp:
- Mar 23, 2011 10:22:48 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70701
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r35603 r36360 891 891 */ 892 892 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) 893 fLinearMapping = virt_addr_valid(pvLast) 893 fLinearMapping = virt_addr_valid(pvLast) && virt_addr_valid(pv); 894 894 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) 895 895 fLinearMapping = VALID_PAGE(virt_to_page(pvLast)) && VALID_PAGE(virt_to_page(pv)); 896 896 #else 897 897 # error "not supported" 898 #endif 899 /* 900 * kmap()'ed memory. Only relevant for 32-bit Linux kernels with HIGHMEM 901 * enabled. Unfortunately there is no easy way to retrieve the page object 902 * for such temporarily mapped memory, virt_to_page() does not work here. 903 * There is even no function to check if a virtual address is inside the 904 * kmap() area or not :-( kmap_atomic_to_page() looks promising but the test 905 * 'if (vaddr < FIXADDR_START)' if wrong -- the kmap() area is located 906 * below the fixmap area. vmalloc_to_page() would work but is only allowed 907 * for vmalloc'ed memory. 908 */ 909 #ifdef CONFIG_HIGHMEM 910 if (pv < PKMAP_BASE + LAST_PKMAP*PAGE_SIZE && pvLast >= PKMAP_BASE) 911 return VERR_INVALID_PARAMETER; 898 912 #endif 899 913 if (!fLinearMapping)
Note:
See TracChangeset
for help on using the changeset viewer.