Guest User

patch for vmware 12.5 modules under linux 4.9

a guest
Jan 23rd, 2017
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.12 KB | None | 0 0
  1. --- vmmon-only/linux/hostif.c
  2. +++ vmmon-only-new/linux/hostif.c
  3. @@ -1162,11 +1162,15 @@
  4.     int retval;
  5.  
  6.     down_read(&current->mm->mmap_sem);
  7. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
  8. +   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
  9. +#else
  10.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
  11.     retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
  12.  #else
  13.     retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
  14.                numPages, 0, 0, ppages, NULL);
  15. +#endif
  16.  #endif
  17.     up_read(&current->mm->mmap_sem);
  18.  
  19. --- vmnet-only/userif.c
  20. +++ vmnet-only-new/userif.c
  21. @@ -113,11 +113,15 @@
  22.     int retval;
  23.  
  24.     down_read(&current->mm->mmap_sem);
  25. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
  26. +   retval = get_user_pages(addr, 1, 0, &page, NULL);
  27. +#else
  28.  #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
  29.     retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
  30.  #else
  31.     retval = get_user_pages(current, current->mm, addr,
  32.                             1, 1, 0, &page, NULL);
  33. +#endif
  34.  #endif
  35.     up_read(&current->mm->mmap_sem);
Advertisement
Add Comment
Please, Sign In to add comment