]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/userfaultfd_k.h
userfaultfd: non-cooperative: add event for memory unmaps
[karo-tx-linux.git] / include / linux / userfaultfd_k.h
index 11b92b047a1ee186e1e34af304498746296172d6..a40be5d0661b210ac6b0360ddfa0896aa03a97da 100644 (file)
@@ -52,6 +52,26 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma)
        return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP);
 }
 
+extern int dup_userfaultfd(struct vm_area_struct *, struct list_head *);
+extern void dup_userfaultfd_complete(struct list_head *);
+
+extern void mremap_userfaultfd_prep(struct vm_area_struct *,
+                                   struct vm_userfaultfd_ctx *);
+extern void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *,
+                                       unsigned long from, unsigned long to,
+                                       unsigned long len);
+
+extern void userfaultfd_remove(struct vm_area_struct *vma,
+                              struct vm_area_struct **prev,
+                              unsigned long start,
+                              unsigned long end);
+
+extern int userfaultfd_unmap_prep(struct vm_area_struct *vma,
+                                 unsigned long start, unsigned long end,
+                                 struct list_head *uf);
+extern void userfaultfd_unmap_complete(struct mm_struct *mm,
+                                      struct list_head *uf);
+
 #else /* CONFIG_USERFAULTFD */
 
 /* mm helpers */
@@ -76,6 +96,46 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma)
        return false;
 }
 
+static inline int dup_userfaultfd(struct vm_area_struct *vma,
+                                 struct list_head *l)
+{
+       return 0;
+}
+
+static inline void dup_userfaultfd_complete(struct list_head *l)
+{
+}
+
+static inline void mremap_userfaultfd_prep(struct vm_area_struct *vma,
+                                          struct vm_userfaultfd_ctx *ctx)
+{
+}
+
+static inline void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *ctx,
+                                              unsigned long from,
+                                              unsigned long to,
+                                              unsigned long len)
+{
+}
+
+static inline void userfaultfd_remove(struct vm_area_struct *vma,
+                                     struct vm_area_struct **prev,
+                                     unsigned long start,
+                                     unsigned long end)
+{
+}
+
+static inline int userfaultfd_unmap_prep(struct vm_area_struct *vma,
+                                        unsigned long start, unsigned long end,
+                                        struct list_head *uf)
+{
+       return 0;
+}
+
+static inline void userfaultfd_unmap_complete(struct mm_struct *mm,
+                                             struct list_head *uf)
+{
+}
 #endif /* CONFIG_USERFAULTFD */
 
 #endif /* _LINUX_USERFAULTFD_K_H */