Changeset 68215 in vbox for trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
- Timestamp:
- Aug 1, 2017 11:03:31 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117315
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r66930 r68215 1026 1026 } 1027 1027 1028 /* openSUSE Leap 42.3 detection :-/ */ 1029 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0) \ 1030 && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) \ 1031 && defined(FAULT_FLAG_REMOTE) 1032 # define GET_USER_PAGES_API KERNEL_VERSION(4, 10, 0) 1033 #else 1034 # define GET_USER_PAGES_API LINUX_VERSION_CODE 1035 #endif 1028 1036 1029 1037 DECLHIDDEN(int) rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process) … … 1063 1071 * Get user pages. 1064 1072 */ 1065 #if LINUX_VERSION_CODE>= KERNEL_VERSION(4, 6, 0)1073 #if GET_USER_PAGES_API >= KERNEL_VERSION(4, 6, 0) 1066 1074 if (R0Process == RTR0ProcHandleSelf()) 1067 1075 rc = get_user_pages(R3Ptr, /* Where from. */ 1068 1076 cPages, /* How many pages. */ 1069 # if LINUX_VERSION_CODE>= KERNEL_VERSION(4, 9, 0)1077 # if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0) 1070 1078 fWrite ? FOLL_WRITE | /* Write to memory. */ 1071 1079 FOLL_FORCE /* force write access. */ … … 1087 1095 R3Ptr, /* Where from. */ 1088 1096 cPages, /* How many pages. */ 1089 # if LINUX_VERSION_CODE>= KERNEL_VERSION(4, 9, 0)1097 # if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0) 1090 1098 fWrite ? FOLL_WRITE | /* Write to memory. */ 1091 1099 FOLL_FORCE /* force write access. */ … … 1097 1105 &pMemLnx->apPages[0], /* Page array. */ 1098 1106 papVMAs /* vmas */ 1099 # if LINUX_VERSION_CODE>= KERNEL_VERSION(4, 10, 0)1107 # if GET_USER_PAGES_API >= KERNEL_VERSION(4, 10, 0) 1100 1108 , NULL /* locked */ 1101 1109 # endif 1102 1110 ); 1103 #else /* LINUX_VERSION_CODE< KERNEL_VERSION(4, 6, 0) */1111 #else /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */ 1104 1112 rc = get_user_pages(pTask, /* Task for fault accounting. */ 1105 1113 pTask->mm, /* Whose pages. */ 1106 1114 R3Ptr, /* Where from. */ 1107 1115 cPages, /* How many pages. */ 1108 # if LINUX_VERSION_CODE>= KERNEL_VERSION(4, 9, 0)1116 # if GET_USER_PAGES_API >= KERNEL_VERSION(4, 9, 0) 1109 1117 fWrite ? FOLL_WRITE | /* Write to memory. */ 1110 1118 FOLL_FORCE /* force write access. */ … … 1116 1124 &pMemLnx->apPages[0], /* Page array. */ 1117 1125 papVMAs); /* vmas */ 1118 #endif /* LINUX_VERSION_CODE< KERNEL_VERSION(4, 6, 0) */1126 #endif /* GET_USER_PAGES_API < KERNEL_VERSION(4, 6, 0) */ 1119 1127 if (rc == cPages) 1120 1128 {
Note:
See TracChangeset
for help on using the changeset viewer.