Changeset 85431 in vbox for trunk/src/VBox/HostDrivers/Support/linux
- Timestamp:
- Jul 23, 2020 11:58:10 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r83325 r85431 757 757 RTCCUINTREG VBOXCALL supdrvOSChangeCR4(RTCCUINTREG fOrMask, RTCCUINTREG fAndMask) 758 758 { 759 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) 760 RTCCUINTREG uOld = this_cpu_read(cpu_tlbstate.cr4); 761 RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask; 759 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) 760 RTCCUINTREG const uOld = __read_cr4(); 761 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) 762 RTCCUINTREG const uOld = this_cpu_read(cpu_tlbstate.cr4); 763 #else 764 RTCCUINTREG const uOld = ASMGetCR4(); 765 #endif 766 RTCCUINTREG const uNew = (uOld & fAndMask) | fOrMask; 762 767 if (uNew != uOld) 763 768 { 769 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) 770 ASMSetCR4(uNew); 771 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0) 764 772 this_cpu_write(cpu_tlbstate.cr4, uNew); 765 773 __write_cr4(uNew); 766 }767 774 #else 768 RTCCUINTREG uOld = ASMGetCR4();769 RTCCUINTREG uNew = (uOld & fAndMask) | fOrMask;770 if (uNew != uOld)771 775 ASMSetCR4(uNew); 772 776 #endif 777 } 773 778 return uOld; 774 779 }
Note:
See TracChangeset
for help on using the changeset viewer.