SHARE
TWEET

nvidia-340.108-build-fix.diff

a guest Dec 24th, 2019 147 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
  2. index 6943e7c..c5d232c 100644
  3. --- a/uvm/nvidia_uvm_lite.c
  4. +++ b/uvm/nvidia_uvm_lite.c
  5. @@ -820,7 +820,13 @@ done:
  6.  }
  7.  
  8.  #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
  9. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
  10. +vm_fault_t _fault(struct vm_fault *vmf)
  11. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
  12. +int _fault(struct vm_fault *vmf)
  13. +#else
  14.  int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
  15. +#endif
  16.  {
  17.  #if defined(NV_VM_FAULT_HAS_ADDRESS)
  18.      unsigned long vaddr = vmf->address;
  19. @@ -828,8 +834,15 @@ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
  20.      unsigned long vaddr = (unsigned long)vmf->virtual_address;
  21.  #endif
  22.      struct page *page = NULL;
  23. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
  24. +    vm_fault_t retval;
  25. +#else
  26.      int retval;
  27.  
  28. +#endif
  29. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
  30. +   struct vm_area_struct *vma = vmf->vma;
  31. +#endif
  32.      retval = _fault_common(vma, vaddr, &page, vmf->flags);
  33.  
  34.      vmf->page = page;
  35. @@ -868,7 +881,13 @@ static struct vm_operations_struct uvmlite_vma_ops =
  36.  // it's dealing with anonymous mapping (see handle_pte_fault).
  37.  //
  38.  #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
  39. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
  40. +vm_fault_t _sigbus_fault(struct vm_fault *vmf)
  41. +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
  42. +int _sigbus_fault(struct vm_fault *vmf)
  43. +#else
  44.  int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
  45. +#endif
  46.  {
  47.      vmf->page = NULL;
  48.      return VM_FAULT_SIGBUS;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top