aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/uio_driver.h
diff options
context:
space:
mode:
authorKai Jiang <Kai.Jiang@freescale.com>2011-10-17 14:50:20 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-18 14:18:57 -0400
commit27a90700a4275c5178b883b65927affdafa5185c (patch)
treed140a0c39bc0bf68531a165e0678be58987d2d78 /include/linux/uio_driver.h
parentc4253cb0748cd50060d04d838c38b07f1ad0e6e5 (diff)
uio: Support physical addresses >32 bits on 32-bit systems
To support >32-bit physical addresses for UIO_MEM_PHYS type we need to extend the width of 'addr' in struct uio_mem. Numerous platforms like embedded PPC, ARM, and X86 have support for systems with larger physical address than logical. Since 'addr' may contain a physical, logical, or virtual address the easiest solution is to just change the type to 'phys_addr_t' which should always be greater than or equal to the sizeof(void *) such that it can properly hold any of the address types. For physical address we can support up to a 44-bit physical address on a typical 32-bit system as we utilize remap_pfn_range() for the mapping of the memory region and pfn's are represnted by shifting the address by the page size (typically 4k). Signed-off-by: Kai Jiang <Kai.Jiang@freescale.com> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Hans J. Koch <hjk@hansjkoch.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/uio_driver.h')
-rw-r--r--include/linux/uio_driver.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 665517c05eaf..fd99ff9298c6 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -23,7 +23,10 @@ struct uio_map;
23/** 23/**
24 * struct uio_mem - description of a UIO memory region 24 * struct uio_mem - description of a UIO memory region
25 * @name: name of the memory region for identification 25 * @name: name of the memory region for identification
26 * @addr: address of the device's memory 26 * @addr: address of the device's memory (phys_addr is used since
27 * addr can be logical, virtual, or physical & phys_addr_t
28 * should always be large enough to handle any of the
29 * address types)
27 * @size: size of IO 30 * @size: size of IO
28 * @memtype: type of memory addr points to 31 * @memtype: type of memory addr points to
29 * @internal_addr: ioremap-ped version of addr, for driver internal use 32 * @internal_addr: ioremap-ped version of addr, for driver internal use
@@ -31,7 +34,7 @@ struct uio_map;
31 */ 34 */
32struct uio_mem { 35struct uio_mem {
33 const char *name; 36 const char *name;
34 unsigned long addr; 37 phys_addr_t addr;
35 unsigned long size; 38 unsigned long size;
36 int memtype; 39 int memtype;
37 void __iomem *internal_addr; 40 void __iomem *internal_addr;