Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Index: kernel/nv-pat.c
  2. ===================================================================
  3. --- kernel/nv-pat.c.orig
  4. +++ kernel/nv-pat.c
  5. @@ -35,8 +35,13 @@ static inline void nv_disable_caches(uns
  6. unsigned long cr0 = read_cr0();
  7. write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
  8. wbinvd();
  9. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
  10. *cr4 = read_cr4();
  11. if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
  12. +#else
  13. + *cr4 = __read_cr4();
  14. + if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
  15. +#endif
  16. __flush_tlb();
  17. }
  18.  
  19. @@ -46,7 +51,11 @@ static inline void nv_enable_caches(unsi
  20. wbinvd();
  21. __flush_tlb();
  22. write_cr0((cr0 & 0x9fffffff));
  23. +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
  24. if (cr4 & 0x80) write_cr4(cr4);
  25. +#else
  26. + if (cr4 & 0x80) __write_cr4(cr4);
  27. +#endif
  28. }
  29.  
  30. static int nv_determine_pat_mode(void)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement