Lines 902-907
Link Here
|
902 |
union |
902 |
union |
903 |
{ |
903 |
{ |
904 |
pgd_t Global; |
904 |
pgd_t Global; |
|
|
905 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) |
906 |
p4d_t Four; |
907 |
#endif |
905 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) |
908 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) |
906 |
pud_t Upper; |
909 |
pud_t Upper; |
907 |
#endif |
910 |
#endif |
Lines 917-925
Link Here
|
917 |
u.Global = *pgd_offset(current->active_mm, ulAddr); |
920 |
u.Global = *pgd_offset(current->active_mm, ulAddr); |
918 |
if (RT_UNLIKELY(pgd_none(u.Global))) |
921 |
if (RT_UNLIKELY(pgd_none(u.Global))) |
919 |
return NULL; |
922 |
return NULL; |
920 |
|
|
|
921 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) |
923 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) |
|
|
924 |
# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) |
925 |
u.Four = *p4d_offset(&u.Global, ulAddr); |
926 |
if (RT_UNLIKELY(p4d_none(u.Four))) |
927 |
return NULL; |
928 |
if (p4d_large(u.Four)) |
929 |
{ |
930 |
pPage = p4d_page(u.Four); |
931 |
AssertReturn(pPage, NULL); |
932 |
pfn = page_to_pfn(pPage); /* doing the safe way... */ |
933 |
AssertCompile(P4D_SHIFT - PAGE_SHIFT < 31); |
934 |
pfn += (ulAddr >> PAGE_SHIFT) & ((UINT32_C(1) << (P4D_SHIFT - PAGE_SHIFT)) - 1); |
935 |
return pfn_to_page(pfn); |
936 |
} |
937 |
u.Upper = *pud_offset(&u.Four, ulAddr); |
938 |
# else /* < 4.12 */ |
922 |
u.Upper = *pud_offset(&u.Global, ulAddr); |
939 |
u.Upper = *pud_offset(&u.Global, ulAddr); |
|
|
940 |
# endif /* < 4.12 */ |
923 |
if (RT_UNLIKELY(pud_none(u.Upper))) |
941 |
if (RT_UNLIKELY(pud_none(u.Upper))) |
924 |
return NULL; |
942 |
return NULL; |
925 |
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) |
943 |
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) |
Lines 932-938
Link Here
|
932 |
return pfn_to_page(pfn); |
950 |
return pfn_to_page(pfn); |
933 |
} |
951 |
} |
934 |
# endif |
952 |
# endif |
935 |
|
|
|
936 |
u.Middle = *pmd_offset(&u.Upper, ulAddr); |
953 |
u.Middle = *pmd_offset(&u.Upper, ulAddr); |
937 |
#else /* < 2.6.11 */ |
954 |
#else /* < 2.6.11 */ |
938 |
u.Middle = *pmd_offset(&u.Global, ulAddr); |
955 |
u.Middle = *pmd_offset(&u.Global, ulAddr); |