--- /dev/null
+.. SPDX-License-Identifier: GPL-2.0+
+
+===============
+Physical Ranges
+===============
+
+:Author: Matthew Wilcox
+
+Overview
+========
+
+The Physical Range (abbreviated as phyr) is a data structure which
+represents a contiguous range of memory which is typically used for I/O.
+The memory is physically addressable by the CPU, although there may not
+be a virtual address assigned to that memory. The phyr can be used to
+obtain a DMA mapping for any part of the range. Usually we use an array
+of phyr to represent a logical (or virtual) range which is physically
+discontiguous.
+
+Functions and structures
+========================
+
+.. kernel-doc:: include/linux/phyr.h
--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_PHYR_H
+#define _LINUX_PHYR_H
+
+#include <linux/scatterlist.h>
+
+/**
+ * struct phyr - A descriptor for a physical range.
+ * @phyr_addr: The lowest address of the range.
+ * @phyr_size: The number of bytes in the range.
+ *
+ * The phyr represents a range of CPU-addressable memory. If HIGHMEM is
+ * in use, the phyr may not have a virtual address associated with it.
+ * There may not be a struct page for the physical addresses. The phyr
+ * is intended for use primarily to describe a range that will be used
+ * for I/O; use struct resource to represent an arbitrary range of
+ * physical addresses.
+ *
+ * This structure is 8 bytes on 32-bit machines without HIGHMEM, 12
+ * bytes on 32-bit machines with HIGHMEM and 16 bytes on 64-bit machines.
+ */
+struct phyr {
+ phys_addr_t phyr_addr;
+ size_t phyr_size;
+};
+
+int get_user_phyr(struct sg_append_table *sgt_append, unsigned long cur_base,
+ size_t max_seg_size, unsigned long npages,
+ unsigned int gup_flags);
+
+#endif /* _LINUX_PHYR_H */