Changeset 66927 in vbox
- Timestamp:
- May 17, 2017 9:42:23 AM (8 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r65183 r66927 903 903 { 904 904 pgd_t Global; 905 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) 906 p4d_t Four; 907 #endif 905 908 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) 906 909 pud_t Upper; … … 918 921 if (RT_UNLIKELY(pgd_none(u.Global))) 919 922 return NULL; 920 921 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) 923 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) 924 u.Four = *p4d_offset(&u.Global, ulAddr); 925 if (RT_UNLIKELY(p4d_none(u.Four))) 926 return NULL; 927 if (p4d_large(u.Four)) 928 { 929 pPage = p4d_page(u.Four); 930 AssertReturn(pPage, NULL); 931 pfn = page_to_pfn(pPage); /* doing the safe way... */ 932 AssertCompile(P4D_SHIFT - PAGE_SHIFT < 31); 933 pfn += (ulAddr >> PAGE_SHIFT) & ((UINT32_C(1) << (P4D_SHIFT - PAGE_SHIFT)) - 1); 934 return pfn_to_page(pfn); 935 } 936 u.Upper = *pud_offset(&u.Four, ulAddr); 937 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) 922 938 u.Upper = *pud_offset(&u.Global, ulAddr); 939 #endif 923 940 if (RT_UNLIKELY(pud_none(u.Upper))) 924 941 return NULL; 925 # 942 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) 926 943 if (pud_large(u.Upper)) 927 944 { … … 932 949 return pfn_to_page(pfn); 933 950 } 934 # 935 951 #endif 952 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) 936 953 u.Middle = *pmd_offset(&u.Upper, ulAddr); 937 954 #else /* < 2.6.11 */ -
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r65990 r66927 160 160 #endif 161 161 162 /* for set_pages_x() */ 163 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) 164 # include <asm/set_memory.h> 165 #endif 166 162 167 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) 163 168 # include <asm/smap.h>
Note:
See TracChangeset
for help on using the changeset viewer.