Skip to contentSkip to conversation

Cleanup of mach/io.h

PATCH New Eric Miao 4 participants 15 messages Jun 23, 2010 – Jun 28, 2010

Subsystems (19)
lore
Share & tools
lore

Eric Miao

author
#0 lore raw

cover Cleanup of mach/io.h

Some definitions can be made common, like IO_SPACE_LIMIT, some can be removed, e.g. __mem_isa(), and some can be made into a machine specific call, e.g. arch_adjust_zones()

Many mach/io.h can actually be safely removed, except for the following definitions:

	__io()

and
__arch_ioremap(), __arch_iounmap() and so on

__io() in the end can be made generic into something like:

#define __io(x) ((x) - physical_address_of_IO_space +
virtual_base)

and __arch_ioremap(), __arch_iounmap() made into machine specific function (again?)

author
#1 lore raw

PATCH 1/6 Make common definition for IO_SPACE_LIMIT

---
 arch/arm/include/asm/io.h                  |    2 ++
 arch/arm/mach-aaec2000/include/mach/io.h   |    2 --
 arch/arm/mach-at91/include/mach/io.h       |    2 --
 arch/arm/mach-bcmring/include/mach/io.h    |    2 --
 arch/arm/mach-clps711x/include/mach/io.h   |    2 --
 arch/arm/mach-cns3xxx/include/mach/io.h    |    2 --
 arch/arm/mach-davinci/include/mach/io.h    |    2 --
 arch/arm/mach-dove/include/mach/io.h       |    2 --
 arch/arm/mach-ebsa110/include/mach/io.h    |    2 --
 arch/arm/mach-ep93xx/include/mach/io.h     |    2 --
 arch/arm/mach-footbridge/include/mach/io.h |    2 --
 arch/arm/mach-gemini/include/mach/io.h     |    2 --
 arch/arm/mach-h720x/include/mach/io.h      |    2 --
 arch/arm/mach-integrator/include/mach/io.h |    2 --
 arch/arm/mach-iop13xx/include/mach/io.h    |    2 --
 arch/arm/mach-iop32x/include/mach/io.h     |    1 -
 arch/arm/mach-iop33x/include/mach/io.h     |    1 -
 arch/arm/mach-ixp2000/include/mach/io.h    |    1 -
 arch/arm/mach-ixp23xx/include/mach/io.h    |    2 --
 arch/arm/mach-ixp4xx/include/mach/io.h     |    2 --
 arch/arm/mach-kirkwood/include/mach/io.h   |    2 --
 arch/arm/mach-ks8695/include/mach/io.h     |    2 --
 arch/arm/mach-l7200/include/mach/io.h      |    2 --
 arch/arm/mach-lh7a40x/include/mach/io.h    |    2 --
 arch/arm/mach-loki/include/mach/io.h       |    2 --
 arch/arm/mach-mmp/include/mach/io.h        |    2 --
 arch/arm/mach-msm/include/mach/io.h        |    2 --
 arch/arm/mach-mv78xx0/include/mach/io.h    |    2 --
 arch/arm/mach-netx/include/mach/io.h       |    2 --
 arch/arm/mach-nomadik/include/mach/io.h    |    2 --
 arch/arm/mach-ns9xxx/include/mach/io.h     |    2 --
 arch/arm/mach-nuc93x/include/mach/io.h     |    2 --
 arch/arm/mach-orion5x/include/mach/io.h    |    2 --
 arch/arm/mach-pnx4008/include/mach/io.h    |    2 --
 arch/arm/mach-pxa/include/mach/io.h        |    2 --
 arch/arm/mach-realview/include/mach/io.h   |    2 --
 arch/arm/mach-rpc/include/mach/io.h        |    2 --
 arch/arm/mach-s3c2410/include/mach/io.h    |    2 --
 arch/arm/mach-s3c24a0/include/mach/io.h    |    2 --
 arch/arm/mach-s3c64xx/include/mach/io.h    |    2 --
 arch/arm/mach-s5p6440/include/mach/io.h    |    2 --
 arch/arm/mach-s5p6442/include/mach/io.h    |    2 --
 arch/arm/mach-s5pc100/include/mach/io.h    |    2 --
 arch/arm/mach-s5pv210/include/mach/io.h    |    2 --
 arch/arm/mach-sa1100/include/mach/io.h     |    2 --
 arch/arm/mach-shark/include/mach/io.h      |    2 --
 arch/arm/mach-shmobile/include/mach/io.h   |    2 --
 arch/arm/mach-u300/include/mach/io.h       |    2 --
 arch/arm/mach-ux500/include/mach/io.h      |    2 --
 arch/arm/mach-versatile/include/mach/io.h  |    2 --
 arch/arm/mach-vexpress/include/mach/io.h   |    2 --
 arch/arm/mach-w90x900/include/mach/io.h    |    2 --
 arch/arm/plat-mxc/include/mach/io.h        |    2 --
 arch/arm/plat-omap/include/plat/io.h       |    2 --
 arch/arm/plat-spear/include/plat/io.h      |    2 --
 arch/arm/plat-stmp3xxx/include/mach/io.h   |    2 --
 56 files changed, 2 insertions(+), 107 deletions(-)
arch/arm/include/asm/io.h +2 -0
index c980156..01eec09 100644
@@ -99,6 +99,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
  */
 #include <mach/io.h>
 
+#define IO_SPACE_LIMIT	0xffffffff
+
 /*
  *  IO port access primitives
  *  -------------------------
arch/arm/mach-aaec2000/include/mach/io.h +0 -2
index ab4fe5d..ce19850 100644
@@ -6,8 +6,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-at91/include/mach/io.h +0 -2
index 0b0cccc..34740b5 100644
@@ -21,8 +21,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT		0xFFFFFFFF
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-bcmring/include/mach/io.h +0 -2
index dae5e9b..1dba26d 100644
@@ -21,8 +21,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-clps711x/include/mach/io.h +0 -2
index 2e0b3ce..2e90452 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-cns3xxx/include/mach/io.h +0 -2
index 33b6fc1..396b959 100644
@@ -9,8 +9,6 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)			__typesafe_io(a)
 #define __mem_pci(a)		(a)
 
arch/arm/mach-davinci/include/mach/io.h +0 -2
index 62b0a90..29a866f 100644
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-dove/include/mach/io.h +0 -2
index 3b3e472..eaacc2a 100644
@@ -11,8 +11,6 @@
 
 #include "dove.h"
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 #define __io(a)  ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
 				   DOVE_PCIE0_IO_VIRT_BASE))
 #define __mem_pci(a)		(a)
arch/arm/mach-ebsa110/include/mach/io.h +0 -2
index f68daa6..44679db 100644
@@ -13,8 +13,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffff
-
 u8 __inb8(unsigned int port);
 void __outb8(u8  val, unsigned int port);
 
arch/arm/mach-ep93xx/include/mach/io.h +0 -2
index 594b77f..8931f94 100644
@@ -5,8 +5,6 @@
 #ifndef __ASM_MACH_IO_H
 #define __ASM_MACH_IO_H
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 #define __io(p)			__typesafe_io(p)
 #define __mem_pci(p)		(p)
 
arch/arm/mach-footbridge/include/mach/io.h +0 -2
index 101a4fe..c65ed51 100644
@@ -17,8 +17,6 @@
 #define PCIO_SIZE		0x00100000
 #define PCIO_BASE		0xff000000
 
-#define IO_SPACE_LIMIT 0xffff
-
 /*
  * Translation of various region addresses to virtual addresses
  */
arch/arm/mach-gemini/include/mach/io.h +0 -2
index c548056..37b2896 100644
@@ -10,8 +10,6 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define IO_SPACE_LIMIT	0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-h720x/include/mach/io.h +0 -2
index 2c8659c..1b2229f 100644
@@ -14,8 +14,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-integrator/include/mach/io.h +0 -2
index f21bb54..37beed3 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffff
-
 /*
  * WARNING: this has to mirror definitions in platform.h
  */
arch/arm/mach-iop13xx/include/mach/io.h +0 -2
index a6e0f9e..a9368e6 100644
@@ -19,8 +19,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a) __iop13xx_io(a)
 #define __mem_pci(a) (a)
 #define __mem_isa(a) (a)
arch/arm/mach-iop32x/include/mach/io.h +0 -1
index 339e585..9ddc4df 100644
@@ -17,7 +17,6 @@ extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
 	unsigned int mtype);
 extern void __iop3xx_iounmap(void __iomem *addr);
 
-#define IO_SPACE_LIMIT		0xffffffff
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)		(a)
 
arch/arm/mach-iop33x/include/mach/io.h +0 -1
index e99a7ed..9c1341d 100644
@@ -17,7 +17,6 @@ extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
 	unsigned int mtype);
 extern void __iop3xx_iounmap(void __iomem *addr);
 
-#define IO_SPACE_LIMIT		0xffffffff
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
 #define __mem_pci(a)		(a)
 
arch/arm/mach-ixp2000/include/mach/io.h +0 -1
index 859e584..e441d97 100644
@@ -17,7 +17,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT		0xffffffff
 #define __mem_pci(a)		(a)
 
 /*
arch/arm/mach-ixp23xx/include/mach/io.h +0 -2
index fd9ef8e..1e3752d 100644
@@ -15,8 +15,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(p)		((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
 #define __mem_pci(a)	(a)
 
arch/arm/mach-ixp4xx/include/mach/io.h +0 -2
index 6ea7e2f..72af996 100644
@@ -17,8 +17,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT 0x0000ffff
-
 extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data);
 extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
 
arch/arm/mach-kirkwood/include/mach/io.h +0 -2
index 44e8be0..68560bf 100644
@@ -11,8 +11,6 @@
 
 #include "kirkwood.h"
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 static inline void __iomem *__io(unsigned long addr)
 {
 	return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_BUS_BASE)
arch/arm/mach-ks8695/include/mach/io.h +0 -2
index a7a63ac..1b2e825 100644
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-l7200/include/mach/io.h +0 -2
index a770a89..814c0b3 100644
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * There are not real ISA nor PCI buses, so we fake it.
  */
arch/arm/mach-lh7a40x/include/mach/io.h +0 -2
index 6ece459..f64cde6 100644
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /* No ISA or PCI bus on this machine. */
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
arch/arm/mach-loki/include/mach/io.h +0 -2
index a373cd5..ea63e33 100644
@@ -11,8 +11,6 @@
 
 #include "loki.h"
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 static inline void __iomem *__io(unsigned long addr)
 {
 	return (void __iomem *)((addr - LOKI_PCIE0_IO_PHYS_BASE)
arch/arm/mach-mmp/include/mach/io.h +0 -2
index e7adf3d..dc24d77 100644
@@ -9,8 +9,6 @@
 #ifndef __ASM_MACH_IO_H
 #define __ASM_MACH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-msm/include/mach/io.h +0 -2
index c35b29f..40698df 100644
@@ -16,8 +16,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __arch_ioremap __msm_ioremap
 #define __arch_iounmap __iounmap
 
arch/arm/mach-mv78xx0/include/mach/io.h +0 -2
index 450e0e1..a92df8c 100644
@@ -11,8 +11,6 @@
 
 #include "mv78xx0.h"
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 static inline void __iomem *__io(unsigned long addr)
 {
 	return (void __iomem *)((addr - MV78XX0_PCIE_IO_PHYS_BASE(0))
arch/arm/mach-netx/include/mach/io.h +0 -2
index c3921cb..a1b7e23 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)            (a)
 
arch/arm/mach-nomadik/include/mach/io.h +0 -2
index 2e1eca1..d988297 100644
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-ns9xxx/include/mach/io.h +0 -2
index f08451d..fb401c9 100644
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT  0xffffffff /* XXX */
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)    (a)
 #define __mem_isa(a)    (IO_BASE + (a))
arch/arm/mach-nuc93x/include/mach/io.h +0 -2
index 72e5051..2d0d853 100644
@@ -16,8 +16,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT	0xffffffff
-
 /*
  * 1:1 mapping for ioremapped regions.
  */
arch/arm/mach-orion5x/include/mach/io.h +0 -2
index c47b033..839b888 100644
@@ -13,8 +13,6 @@
 
 #include "orion5x.h"
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 static inline void __iomem *
 __arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype)
 {
arch/arm/mach-pnx4008/include/mach/io.h +0 -2
index cbf0904..76d5bca 100644
@@ -13,8 +13,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-pxa/include/mach/io.h +0 -2
index 262691f..fedd427 100644
@@ -6,8 +6,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-realview/include/mach/io.h +0 -2
index f05bcdf..2bdf15d 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-rpc/include/mach/io.h +0 -2
index 20da7f4..3ccc17d 100644
@@ -15,8 +15,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We use two different types of addressing - PC style addresses, and ARM
  * addresses.  PC style accesses the PC hardware with the normal PC IO
arch/arm/mach-s3c2410/include/mach/io.h +0 -2
index 9813dbf..d9ba838 100644
@@ -11,8 +11,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We use two different types of addressing - PC style addresses, and ARM
  * addresses.  PC style accesses the PC hardware with the normal PC IO
arch/arm/mach-s3c24a0/include/mach/io.h +0 -2
index 4326c30..4ad89b9 100644
@@ -13,6 +13,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif
arch/arm/mach-s3c64xx/include/mach/io.h +0 -2
index de5716d..1e9625c 100644
@@ -13,6 +13,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif
arch/arm/mach-s5p6440/include/mach/io.h +0 -2
index fa2d69c..72611ec 100644
@@ -13,6 +13,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif
arch/arm/mach-s5p6442/include/mach/io.h +0 -2
index 5d2195a..7c1cb7c 100644
@@ -12,6 +12,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif
arch/arm/mach-s5pc100/include/mach/io.h +0 -2
index 819acf5..25a0e92 100644
@@ -13,6 +13,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif
arch/arm/mach-s5pv210/include/mach/io.h +0 -2
index 5ab9d56..32ff10e 100644
@@ -21,6 +21,4 @@
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
-#define IO_SPACE_LIMIT (0xFFFFFFFF)
-
 #endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/mach-sa1100/include/mach/io.h +0 -2
index d8b43f3..bb1be3f 100644
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many 
  * drivers out there that might just work if we fake them...
arch/arm/mach-shark/include/mach/io.h +0 -2
index 9ccbcec..9e09e10 100644
@@ -11,8 +11,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
 
 #define __mem_pci(addr) (addr)
arch/arm/mach-shmobile/include/mach/io.h +0 -2
index 7339fe4..7b4d896 100644
@@ -1,8 +1,6 @@
 #ifndef __ASM_MACH_IO_H
 #define __ASM_MACH_IO_H
 
-#define IO_SPACE_LIMIT		0xffffffff
-
 #define __io(a)			((void __iomem *)(a))
 #define __mem_pci(a)		(a)
 
arch/arm/mach-u300/include/mach/io.h +0 -2
index 5d6b4c1..49a1ceb 100644
@@ -12,8 +12,6 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-ux500/include/mach/io.h +0 -2
index 1cf3f44..03504ff 100644
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/mach-versatile/include/mach/io.h +0 -2
index f067c14..e87fb4a 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-vexpress/include/mach/io.h +0 -2
index 748bb52..13522d8 100644
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)
 
arch/arm/mach-w90x900/include/mach/io.h +0 -2
index d96ab99..062d401 100644
@@ -18,8 +18,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT	0xffffffff
-
 /*
  * 1:1 mapping for ioremapped regions.
  */
arch/arm/plat-mxc/include/mach/io.h +0 -2
index b4f2de7..18ab5ff 100644
@@ -12,8 +12,6 @@
 #define __ASM_ARCH_MXC_IO_H__
 
 /* Allow IO space to be anywhere in the memory */
-#define IO_SPACE_LIMIT 0xffffffff
-
 #ifdef CONFIG_ARCH_MX3
 #define __arch_ioremap __mx3_ioremap
 #define __arch_iounmap __iounmap
arch/arm/plat-omap/include/plat/io.h +0 -2
index 128b549..bb3f68f 100644
@@ -39,8 +39,6 @@
 
 #include <mach/hardware.h>
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 /*
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
arch/arm/plat-spear/include/plat/io.h +0 -2
index 4d4ba82..4358221 100644
@@ -14,8 +14,6 @@
 #ifndef __PLAT_IO_H
 #define __PLAT_IO_H
 
-#define IO_SPACE_LIMIT		0xFFFFFFFF
-
 #define __io(a)			__typesafe_io(a)
 #define __mem_pci(a)		(a)
 
arch/arm/plat-stmp3xxx/include/mach/io.h +0 -2
index d08b1b7..ccf0246 100644
@@ -16,8 +16,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a) 	__typesafe_io(a)
 #define __mem_pci(a)	(a)
 #define __mem_isa(a)	(a)
Signature · 1 line
1.7.1
#2 lore raw

PATCH 1/6 Make common definition for IO_SPACE_LIMIT

Quoted 31 lines · Eric Miao
arch/arm/mach-ebsa110/include/mach/io.h +0 -2
index f68daa6..44679db 100644
@@ -13,8 +13,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffff
-
 u8 __inb8(unsigned int port);
 void __outb8(u8  val, unsigned int port);
 
arch/arm/mach-footbridge/include/mach/io.h +0 -2
index 101a4fe..c65ed51 100644
@@ -17,8 +17,6 @@
 #define PCIO_SIZE		0x00100000
 #define PCIO_BASE		0xff000000
 
-#define IO_SPACE_LIMIT 0xffff
-
 /*
  * Translation of various region addresses to virtual addresses
  */
arch/arm/mach-integrator/include/mach/io.h +0 -0
index f21bb54..37beed3 100644

arch/arm/mach-integrator/include/mach/io.h line 25

Quoted 8 lines
arch/arm/mach-integrator/include/mach/io.h +0 -2
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define IO_SPACE_LIMIT 0xffff
-
 /*
  * WARNING: this has to mirror definitions in platform.h
  */

These three are 0xffff because they are PCI, and the PCI IO window is 64K. Allowing reservations above this value could cause problems.

author
#3 lore raw

PATCH 2/6 footbridge: remove the useless definition of __mem_pci()

In reply to Eric Miao
---
 arch/arm/mach-footbridge/include/mach/io.h |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
arch/arm/mach-footbridge/include/mach/io.h +0 -12
index c65ed51..d3b14d2 100644
@@ -21,18 +21,6 @@
  * Translation of various region addresses to virtual addresses
  */
 #define __io(a)			((void __iomem *)(PCIO_BASE + (a)))
-#if 1
 #define __mem_pci(a)		(a)
-#else
-
-static inline void __iomem *___mem_pci(void __iomem *p)
-{
-	unsigned long a = (unsigned long)p;
-	BUG_ON(a <= 0xc0000000 || a >= 0xe0000000);
-	return p;
-}
-
-#define __mem_pci(a)		___mem_pci(a)
-#endif
 
 #endif
Signature · 1 line
1.7.1
author
#4 lore raw

PATCH 3/6 Make __mem_pci() common to all ARM sub-architectures

In reply to Eric Miao

On all ARM sub-architectures, __mem_pci() is defined to be a 1:1 mapping, make it a common definition for all.

---
 arch/arm/include/asm/io.h                  |    4 ++++
 arch/arm/mach-aaec2000/include/mach/io.h   |    2 --
 arch/arm/mach-at91/include/mach/io.h       |    2 --
 arch/arm/mach-bcmring/include/mach/io.h    |    2 --
 arch/arm/mach-clps711x/include/mach/io.h   |    2 --
 arch/arm/mach-cns3xxx/include/mach/io.h    |    2 --
 arch/arm/mach-davinci/include/mach/io.h    |    1 -
 arch/arm/mach-dove/include/mach/io.h       |    2 --
 arch/arm/mach-ep93xx/include/mach/io.h     |    2 --
 arch/arm/mach-footbridge/include/mach/io.h |    2 --
 arch/arm/mach-gemini/include/mach/io.h     |    2 --
 arch/arm/mach-h720x/include/mach/io.h      |    2 --
 arch/arm/mach-integrator/include/mach/io.h |    2 --
 arch/arm/mach-iop13xx/include/mach/io.h    |    1 -
 arch/arm/mach-iop32x/include/mach/io.h     |    2 --
 arch/arm/mach-iop33x/include/mach/io.h     |    2 --
 arch/arm/mach-ixp2000/include/mach/io.h    |    2 --
 arch/arm/mach-ixp23xx/include/mach/io.h    |    2 --
 arch/arm/mach-ixp4xx/include/mach/io.h     |    2 --
 arch/arm/mach-kirkwood/include/mach/io.h   |    2 --
 arch/arm/mach-ks8695/include/mach/io.h     |    2 --
 arch/arm/mach-l7200/include/mach/io.h      |    2 --
 arch/arm/mach-lh7a40x/include/mach/io.h    |    2 --
 arch/arm/mach-loki/include/mach/io.h       |    2 --
 arch/arm/mach-mmp/include/mach/io.h        |    2 --
 arch/arm/mach-msm/include/mach/io.h        |    2 --
 arch/arm/mach-mv78xx0/include/mach/io.h    |    2 --
 arch/arm/mach-netx/include/mach/io.h       |    2 --
 arch/arm/mach-nomadik/include/mach/io.h    |    2 --
 arch/arm/mach-ns9xxx/include/mach/io.h     |    1 -
 arch/arm/mach-nuc93x/include/mach/io.h     |    1 -
 arch/arm/mach-orion5x/include/mach/io.h    |    2 --
 arch/arm/mach-pnx4008/include/mach/io.h    |    2 --
 arch/arm/mach-pxa/include/mach/io.h        |    2 --
 arch/arm/mach-realview/include/mach/io.h   |    2 --
 arch/arm/mach-rpc/include/mach/io.h        |    2 --
 arch/arm/mach-s3c2410/include/mach/io.h    |    2 --
 arch/arm/mach-s3c24a0/include/mach/io.h    |    2 --
 arch/arm/mach-s3c64xx/include/mach/io.h    |    2 --
 arch/arm/mach-s5p6440/include/mach/io.h    |    2 --
 arch/arm/mach-s5p6442/include/mach/io.h    |    2 --
 arch/arm/mach-s5pc100/include/mach/io.h    |    2 --
 arch/arm/mach-s5pv210/include/mach/io.h    |    2 --
 arch/arm/mach-sa1100/include/mach/io.h     |    2 --
 arch/arm/mach-shark/include/mach/io.h      |    2 --
 arch/arm/mach-shmobile/include/mach/io.h   |    2 --
 arch/arm/mach-u300/include/mach/io.h       |    2 --
 arch/arm/mach-ux500/include/mach/io.h      |    2 --
 arch/arm/mach-versatile/include/mach/io.h  |    2 --
 arch/arm/mach-vexpress/include/mach/io.h   |    2 --
 arch/arm/mach-w90x900/include/mach/io.h    |    1 -
 arch/arm/plat-mxc/include/mach/io.h        |    2 --
 arch/arm/plat-omap/include/plat/io.h       |    2 --
 arch/arm/plat-spear/include/plat/io.h      |    2 --
 arch/arm/plat-stmp3xxx/include/mach/io.h   |    1 -
 55 files changed, 4 insertions(+), 102 deletions(-)
arch/arm/include/asm/io.h +4 -0
index 01eec09..c5b8803 100644
@@ -101,6 +101,10 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 
 #define IO_SPACE_LIMIT	0xffffffff
 
+#ifndef __mem_pci
+#define __mem_pci(a)	(a)
+#endif
+
 /*
  *  IO port access primitives
  *  -------------------------
arch/arm/mach-aaec2000/include/mach/io.h +0 -2
index ce19850..8b9193d 100644
@@ -11,6 +11,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-at91/include/mach/io.h +0 -2
index 34740b5..ab014c0 100644
@@ -22,8 +22,6 @@
 #define __ASM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 
 #ifndef __ASSEMBLY__
 
arch/arm/mach-bcmring/include/mach/io.h +0 -2
index 1dba26d..3357d80 100644
@@ -26,6 +26,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-clps711x/include/mach/io.h +0 -2
index 2e90452..83980b6 100644
@@ -21,8 +21,6 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 /*
  * We don't support ins[lb]/outs[lb].  Make them fault.
  */
arch/arm/mach-cns3xxx/include/mach/io.h +0 -2
index 396b959..be5a0d2 100644
@@ -10,6 +10,4 @@
 #define __MACH_IO_H
 
 #define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
 #endif
arch/arm/mach-davinci/include/mach/io.h +0 -1
index 29a866f..71d6a0d 100644
@@ -16,7 +16,6 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
 #define __mem_isa(a)		(a)
 
 #ifndef __ASSEMBLER__
arch/arm/mach-dove/include/mach/io.h +0 -2
index eaacc2a..db0cf90 100644
@@ -13,6 +13,4 @@
 
 #define __io(a)  ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
 				   DOVE_PCIE0_IO_VIRT_BASE))
-#define __mem_pci(a)		(a)
-
 #endif
arch/arm/mach-ep93xx/include/mach/io.h +0 -2
index 8931f94..b63e543 100644
@@ -6,8 +6,6 @@
 #define __ASM_MACH_IO_H
 
 #define __io(p)			__typesafe_io(p)
-#define __mem_pci(p)		(p)
-
 /*
  * A typesafe __io() variation for variable initialisers
  */
arch/arm/mach-footbridge/include/mach/io.h +0 -2
index d3b14d2..6a030d5 100644
@@ -21,6 +21,4 @@
  * Translation of various region addresses to virtual addresses
  */
 #define __io(a)			((void __iomem *)(PCIO_BASE + (a)))
-#define __mem_pci(a)		(a)
-
 #endif
arch/arm/mach-gemini/include/mach/io.h +0 -2
index 37b2896..9925714 100644
@@ -11,6 +11,4 @@
 #define __MACH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif /* __MACH_IO_H */
arch/arm/mach-h720x/include/mach/io.h +0 -2
index 1b2229f..8745f59 100644
@@ -15,6 +15,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-integrator/include/mach/io.h +0 -2
index 37beed3..de4ae05 100644
@@ -29,6 +29,4 @@
 #define PCI_IO_VADDR            0xee000000
 
 #define __io(a)			((void __iomem *)(PCI_IO_VADDR + (a)))
-#define __mem_pci(a)		(a)
-
 #endif
arch/arm/mach-iop13xx/include/mach/io.h +0 -1
index a9368e6..c1387df 100644
@@ -20,7 +20,6 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a) __iop13xx_io(a)
-#define __mem_pci(a) (a)
 #define __mem_isa(a) (a)
 
 extern void __iomem * __iop13xx_io(unsigned long io_addr);
arch/arm/mach-iop32x/include/mach/io.h +0 -2
index 9ddc4df..907516a 100644
@@ -18,8 +18,6 @@ extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
 extern void __iop3xx_iounmap(void __iomem *addr);
 
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
-#define __mem_pci(a)		(a)
-
 #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
 #define __arch_iounmap(a)	 __iop3xx_iounmap(a)
 
arch/arm/mach-iop33x/include/mach/io.h +0 -2
index 9c1341d..0c0dad4 100644
@@ -18,8 +18,6 @@ extern void __iomem *__iop3xx_ioremap(unsigned long cookie, size_t size,
 extern void __iop3xx_iounmap(void __iomem *addr);
 
 #define __io(p)		((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
-#define __mem_pci(a)		(a)
-
 #define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
 #define __arch_iounmap(a)	 __iop3xx_iounmap(a)
 
arch/arm/mach-ixp2000/include/mach/io.h +0 -2
index e441d97..7898788 100644
@@ -17,8 +17,6 @@
 
 #include <mach/hardware.h>
 
-#define __mem_pci(a)		(a)
-
 /*
  * The A? revisions of the IXP2000s assert byte lanes for PCI I/O
  * transactions the other way round (MEM transactions don't have this
arch/arm/mach-ixp23xx/include/mach/io.h +0 -2
index 1e3752d..5d0f0b4 100644
@@ -16,8 +16,6 @@
 #define __ASM_ARCH_IO_H
 
 #define __io(p)		((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
-#define __mem_pci(a)	(a)
-
 static inline void __iomem *
 ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
 {
arch/arm/mach-ixp4xx/include/mach/io.h +0 -2
index 72af996..7489f8f 100644
@@ -41,8 +41,6 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
  */
 #ifndef	CONFIG_IXP4XX_INDIRECT_PCI
 
-#define __mem_pci(a)		(a)
-
 #else
 
 /*
arch/arm/mach-kirkwood/include/mach/io.h +0 -2
index 68560bf..be41fb2 100644
@@ -43,7 +43,5 @@ __arch_iounmap(void __iomem *addr)
 #define __arch_ioremap(p, s, m)	__arch_ioremap(p, s, m)
 #define __arch_iounmap(a)	__arch_iounmap(a)
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
arch/arm/mach-ks8695/include/mach/io.h +0 -2
index 1b2e825..d2029d3 100644
@@ -12,6 +12,4 @@
 #define __ASM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-l7200/include/mach/io.h +0 -2
index 814c0b3..13b6e5c 100644
@@ -14,6 +14,4 @@
  * There are not real ISA nor PCI buses, so we fake it.
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-lh7a40x/include/mach/io.h +0 -2
index f64cde6..4de858b 100644
@@ -13,6 +13,4 @@
 
 /* No ISA or PCI bus on this machine. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif /* __ASM_ARCH_IO_H */
arch/arm/mach-loki/include/mach/io.h +0 -2
index ea63e33..b35cdf6 100644
@@ -18,7 +18,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
arch/arm/mach-mmp/include/mach/io.h +0 -2
index dc24d77..e9581d5 100644
@@ -14,6 +14,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif /* __ASM_MACH_IO_H */
arch/arm/mach-msm/include/mach/io.h +0 -2
index 40698df..5e0e93d 100644
@@ -22,8 +22,6 @@
 void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype);
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)    (a)
-
 void msm_map_qsd8x50_io(void);
 void msm_map_msm7x30_io(void);
 
arch/arm/mach-mv78xx0/include/mach/io.h +0 -2
index a92df8c..da6fa21 100644
@@ -18,7 +18,5 @@ static inline void __iomem *__io(unsigned long addr)
 }
 
 #define __io(a)			__io(a)
-#define __mem_pci(a)		(a)
-
 
 #endif
arch/arm/mach-netx/include/mach/io.h +0 -2
index a1b7e23..ac134a8 100644
@@ -21,6 +21,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)            (a)
-
 #endif
arch/arm/mach-nomadik/include/mach/io.h +0 -2
index d988297..a2b9e1a 100644
@@ -15,6 +15,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)         __typesafe_io(a)
-#define __mem_pci(a)    (a)
-
 #endif
arch/arm/mach-ns9xxx/include/mach/io.h +0 -1
index fb401c9..edb9cdd 100644
@@ -12,7 +12,6 @@
 #define __ASM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)    (a)
 #define __mem_isa(a)    (IO_BASE + (a))
 
 #endif /* ifndef __ASM_ARCH_IO_H */
arch/arm/mach-nuc93x/include/mach/io.h +0 -1
index 2d0d853..99fe76d 100644
@@ -20,7 +20,6 @@
  * 1:1 mapping for ioremapped regions.
  */
 
-#define __mem_pci(a)	(a)
 #define __io(a)		__typesafe_io(a)
 
 #endif
arch/arm/mach-orion5x/include/mach/io.h +0 -2
index 839b888..34c2a5c 100644
@@ -39,8 +39,6 @@ __arch_iounmap(void __iomem *addr)
 #define __arch_ioremap(p, s, m)	__arch_ioremap(p, s, m)
 #define __arch_iounmap(a)	__arch_iounmap(a)
 #define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
 
 /*****************************************************************************
  * Helpers to access Orion registers
arch/arm/mach-pnx4008/include/mach/io.h +0 -2
index 76d5bca..bd655e5 100644
@@ -14,6 +14,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-pxa/include/mach/io.h +0 -2
index fedd427..5bfd427 100644
@@ -11,6 +11,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-realview/include/mach/io.h +0 -2
index 2bdf15d..cc45381 100644
@@ -21,6 +21,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-rpc/include/mach/io.h +0 -2
index 3ccc17d..5881e43 100644
@@ -206,6 +206,4 @@ DECLARE_IO(int,l,"")
 /*
  * 1:1 mapping for ioremapped regions.
  */
-#define __mem_pci(x)	(x)
-
 #endif
arch/arm/mach-s3c2410/include/mach/io.h +0 -2
index d9ba838..7ff5def 100644
@@ -211,6 +211,4 @@ DECLARE_IO(int,l,"")
 /*
  * 1:1 mapping for ioremapped regions.
  */
-#define __mem_pci(x)	(x)
-
 #endif
arch/arm/mach-s3c24a0/include/mach/io.h +0 -2
index 4ad89b9..e04664f 100644
@@ -11,6 +11,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-s3c64xx/include/mach/io.h +0 -2
index 1e9625c..eb4dae8 100644
@@ -11,6 +11,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-s5p6440/include/mach/io.h +0 -2
index 72611ec..10e18d3 100644
@@ -11,6 +11,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-s5p6442/include/mach/io.h +0 -2
index 7c1cb7c..02cacba 100644
@@ -10,6 +10,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-s5pc100/include/mach/io.h +0 -2
index 25a0e92..d0970e4 100644
@@ -11,6 +11,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-s5pv210/include/mach/io.h +0 -2
index 32ff10e..f80590e 100644
@@ -19,6 +19,4 @@
 
 /* No current ISA/PCI bus support. */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/mach-sa1100/include/mach/io.h +0 -2
index bb1be3f..0817eb0 100644
@@ -15,6 +15,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-shark/include/mach/io.h +0 -2
index 9e09e10..0950cc1 100644
@@ -13,6 +13,4 @@
 
 #define __io(a)                 ((void __iomem *)(0xe0000000 + (a)))
 
-#define __mem_pci(addr) (addr)
-
 #endif
arch/arm/mach-shmobile/include/mach/io.h +0 -2
index 7b4d896..3e29649 100644
@@ -2,6 +2,4 @@
 #define __ASM_MACH_IO_H
 
 #define __io(a)			((void __iomem *)(a))
-#define __mem_pci(a)		(a)
-
 #endif /* __ASM_MACH_IO_H */
arch/arm/mach-u300/include/mach/io.h +0 -2
index 49a1ceb..6770eea 100644
@@ -13,6 +13,4 @@
 #define __MACH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-ux500/include/mach/io.h +0 -2
index 03504ff..16acb3b 100644
@@ -15,6 +15,4 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-versatile/include/mach/io.h +0 -2
index e87fb4a..25c902a 100644
@@ -21,6 +21,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-vexpress/include/mach/io.h +0 -2
index 13522d8..2b73325 100644
@@ -21,6 +21,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/mach-w90x900/include/mach/io.h +0 -1
index 062d401..272f76b 100644
@@ -22,7 +22,6 @@
  * 1:1 mapping for ioremapped regions.
  */
 
-#define __mem_pci(a)	(a)
 #define __io(a)		__typesafe_io(a)
 
 #endif
arch/arm/plat-mxc/include/mach/io.h +0 -2
index 18ab5ff..ed05017 100644
@@ -35,6 +35,4 @@ __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 /* io address mapping macro */
 #define __io(a)		__typesafe_io(a)
 
-#define __mem_pci(a)	(a)
-
 #endif
arch/arm/plat-omap/include/plat/io.h +0 -2
index bb3f68f..a9beb3c 100644
@@ -44,8 +44,6 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)		__typesafe_io(a)
-#define __mem_pci(a)	(a)
-
 /*
  * ----------------------------------------------------------------------------
  * I/O mapping
arch/arm/plat-spear/include/plat/io.h +0 -2
index 4358221..faf8e7e 100644
@@ -15,6 +15,4 @@
 #define __PLAT_IO_H
 
 #define __io(a)			__typesafe_io(a)
-#define __mem_pci(a)		(a)
-
 #endif /* __PLAT_IO_H */
arch/arm/plat-stmp3xxx/include/mach/io.h +0 -1
index ccf0246..73817a1 100644
@@ -17,7 +17,6 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a) 	__typesafe_io(a)
-#define __mem_pci(a)	(a)
 #define __mem_isa(a)	(a)
 
 #endif
Signature · 1 line
1.7.1
#5 lore raw

PATCH 3/6 Make __mem_pci() common to all ARM sub-architectures

Quoted 2 lines · Eric Miao

On all ARM sub-architectures, __mem_pci() is defined to be a 1:1 mapping, make it a common definition for all.

This is not true for ebsa110, which you'll notice is missing from this diffstat.

author
#6 lore raw

PATCH 4/6 Remove useless __mem_isa() definitions

In reply to Eric Miao
---
 arch/arm/mach-davinci/include/mach/io.h  |    1 -
 arch/arm/mach-iop13xx/include/mach/io.h  |    1 -
 arch/arm/mach-ns9xxx/include/mach/io.h   |    1 -
 arch/arm/plat-stmp3xxx/include/mach/io.h |    1 -
 4 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/include/mach/io.h +0 -1
index 71d6a0d..078d939 100644
@@ -16,7 +16,6 @@
  * drivers out there that might just work if we fake them...
  */
 #define __io(a)			__typesafe_io(a)
-#define __mem_isa(a)		(a)
 
 #ifndef __ASSEMBLER__
 #define __arch_ioremap(p, s, t)	davinci_ioremap(p, s, t)
arch/arm/mach-iop13xx/include/mach/io.h +0 -1
index c1387df..9a360c0 100644
@@ -20,7 +20,6 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a) __iop13xx_io(a)
-#define __mem_isa(a) (a)
 
 extern void __iomem * __iop13xx_io(unsigned long io_addr);
 extern void __iomem *__iop13xx_ioremap(unsigned long cookie, size_t size,
arch/arm/mach-ns9xxx/include/mach/io.h +0 -1
index edb9cdd..11de350 100644
@@ -12,6 +12,5 @@
 #define __ASM_ARCH_IO_H
 
 #define __io(a)		__typesafe_io(a)
-#define __mem_isa(a)    (IO_BASE + (a))
 
 #endif /* ifndef __ASM_ARCH_IO_H */
arch/arm/plat-stmp3xxx/include/mach/io.h +0 -1
index 73817a1..4649a7b 100644
@@ -17,6 +17,5 @@
 #define __ASM_ARM_ARCH_IO_H
 
 #define __io(a) 	__typesafe_io(a)
-#define __mem_isa(a)	(a)
 
 #endif
Signature · 1 line
1.7.1
author
#7 lore raw

PATCH 5/6 shmobile: change __io() definition to use __typesafe_io()

In reply to Eric Miao
---
 arch/arm/mach-shmobile/include/mach/io.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-shmobile/include/mach/io.h +1 -1
index 3e29649..19d5120 100644
@@ -1,5 +1,5 @@
 #ifndef __ASM_MACH_IO_H
 #define __ASM_MACH_IO_H
 
-#define __io(a)			((void __iomem *)(a))
+#define __io(a)			__typesafe_io(a)
 #endif /* __ASM_MACH_IO_H */
Signature · 1 line
1.7.1
author
#8 lore raw

PATCH 5/6 shmobile: change __io() definition to use __typesafe_io()

Quoted 1 line · Eric Miao

Sorry, forgot to CC Magnus.

Quoted 19 lines

---
?arch/arm/mach-shmobile/include/mach/io.h | ? ?2 +- ?1 files changed, 1 insertions(+), 1 deletions(-)

arch/arm/mach-shmobile/include/mach/io.h +0 -0
index 3e29649..19d5120 100644
@@ -1,5 +1,5 @@

?#ifndef __ASM_MACH_IO_H
?#define __ASM_MACH_IO_H

arch/arm/mach-shmobile/include/mach/io.h +1 -1
-#define __io(a) ? ? ? ? ? ? ? ? ? ? ? ?((void __iomem *)(a))
+#define __io(a) ? ? ? ? ? ? ? ? ? ? ? ?__typesafe_io(a)

?#endif /* __ASM_MACH_IO_H */
--
1.7.1

author
#9 lore raw

PATCH 6/6 Introduce common definition for __io()

In reply to Eric Miao
---
 arch/arm/include/asm/io.h                 |    4 ++++
 arch/arm/mach-aaec2000/include/mach/io.h  |    1 -
 arch/arm/mach-at91/include/mach/io.h      |    1 -
 arch/arm/mach-bcmring/include/mach/io.h   |    1 -
 arch/arm/mach-clps711x/include/mach/io.h  |    1 -
 arch/arm/mach-cns3xxx/include/mach/io.h   |    1 -
 arch/arm/mach-davinci/include/mach/io.h   |    1 -
 arch/arm/mach-ep93xx/include/mach/io.h    |    1 -
 arch/arm/mach-gemini/include/mach/io.h    |    1 -
 arch/arm/mach-h720x/include/mach/io.h     |    1 -
 arch/arm/mach-ixp4xx/include/mach/io.h    |    1 -
 arch/arm/mach-ks8695/include/mach/io.h    |    1 -
 arch/arm/mach-l7200/include/mach/io.h     |    1 -
 arch/arm/mach-lh7a40x/include/mach/io.h   |    1 -
 arch/arm/mach-mmp/include/mach/io.h       |    1 -
 arch/arm/mach-msm/include/mach/io.h       |    1 -
 arch/arm/mach-netx/include/mach/io.h      |    1 -
 arch/arm/mach-nomadik/include/mach/io.h   |    1 -
 arch/arm/mach-ns9xxx/include/mach/io.h    |    1 -
 arch/arm/mach-nuc93x/include/mach/io.h    |    1 -
 arch/arm/mach-orion5x/include/mach/io.h   |    1 -
 arch/arm/mach-pnx4008/include/mach/io.h   |    1 -
 arch/arm/mach-pxa/include/mach/io.h       |    1 -
 arch/arm/mach-realview/include/mach/io.h  |    1 -
 arch/arm/mach-s3c24a0/include/mach/io.h   |    1 -
 arch/arm/mach-s3c64xx/include/mach/io.h   |    1 -
 arch/arm/mach-s5p6440/include/mach/io.h   |    1 -
 arch/arm/mach-s5p6442/include/mach/io.h   |    1 -
 arch/arm/mach-s5pc100/include/mach/io.h   |    1 -
 arch/arm/mach-s5pv210/include/mach/io.h   |    1 -
 arch/arm/mach-sa1100/include/mach/io.h    |    1 -
 arch/arm/mach-u300/include/mach/io.h      |    1 -
 arch/arm/mach-ux500/include/mach/io.h     |    1 -
 arch/arm/mach-versatile/include/mach/io.h |    1 -
 arch/arm/mach-vexpress/include/mach/io.h  |    1 -
 arch/arm/mach-w90x900/include/mach/io.h   |    1 -
 arch/arm/plat-mxc/include/mach/io.h       |    1 -
 arch/arm/plat-omap/include/plat/io.h      |    1 -
 arch/arm/plat-spear/include/plat/io.h     |    1 -
 arch/arm/plat-stmp3xxx/include/mach/io.h  |    1 -
 40 files changed, 4 insertions(+), 39 deletions(-)
arch/arm/include/asm/io.h +4 -0
index c5b8803..afcc58a 100644
@@ -105,6 +105,10 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 #define __mem_pci(a)	(a)
 #endif
 
+#ifndef __io
+#define __io(a)		__typesafe_io(a)
+#endif
+
 /*
  *  IO port access primitives
  *  -------------------------
arch/arm/mach-aaec2000/include/mach/io.h +0 -1
index 8b9193d..b391dae 100644
@@ -10,5 +10,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-at91/include/mach/io.h +0 -1
index ab014c0..fe4a498 100644
@@ -21,7 +21,6 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 
 #ifndef __ASSEMBLY__
 
arch/arm/mach-bcmring/include/mach/io.h +0 -1
index 3357d80..ed1cacc 100644
@@ -25,5 +25,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-clps711x/include/mach/io.h +0 -1
index 83980b6..7711803 100644
@@ -20,7 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 /*
  * We don't support ins[lb]/outs[lb].  Make them fault.
  */
arch/arm/mach-cns3xxx/include/mach/io.h +0 -1
index be5a0d2..092eb41 100644
@@ -9,5 +9,4 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define __io(a)			__typesafe_io(a)
 #endif
arch/arm/mach-davinci/include/mach/io.h +0 -1
index 078d939..a4343f0 100644
@@ -15,7 +15,6 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)			__typesafe_io(a)
 
 #ifndef __ASSEMBLER__
 #define __arch_ioremap(p, s, t)	davinci_ioremap(p, s, t)
arch/arm/mach-ep93xx/include/mach/io.h +0 -1
index b63e543..e579eff 100644
@@ -5,7 +5,6 @@
 #ifndef __ASM_MACH_IO_H
 #define __ASM_MACH_IO_H
 
-#define __io(p)			__typesafe_io(p)
 /*
  * A typesafe __io() variation for variable initialisers
  */
arch/arm/mach-gemini/include/mach/io.h +0 -1
index 9925714..8f94508 100644
@@ -10,5 +10,4 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif /* __MACH_IO_H */
arch/arm/mach-h720x/include/mach/io.h +0 -1
index 8745f59..c632af0 100644
@@ -14,5 +14,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-ixp4xx/include/mach/io.h +0 -1
index 7489f8f..8dc8d50 100644
@@ -233,7 +233,6 @@ static inline void __indirect_readsl(const volatile void __iomem *bus_addr,
 
 #ifndef CONFIG_PCI
 
-#define	__io(v)		__typesafe_io(v)
 
 #else
 
arch/arm/mach-ks8695/include/mach/io.h +0 -1
index d2029d3..5e7e96b 100644
@@ -11,5 +11,4 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-l7200/include/mach/io.h +0 -1
index 13b6e5c..d3b837a 100644
@@ -13,5 +13,4 @@
 /*
  * There are not real ISA nor PCI buses, so we fake it.
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-lh7a40x/include/mach/io.h +0 -1
index 4de858b..09e42f6 100644
@@ -12,5 +12,4 @@
 #define __ASM_ARCH_IO_H
 
 /* No ISA or PCI bus on this machine. */
-#define __io(a)		__typesafe_io(a)
 #endif /* __ASM_ARCH_IO_H */
arch/arm/mach-mmp/include/mach/io.h +0 -1
index e9581d5..3a0b9c8 100644
@@ -13,5 +13,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif /* __ASM_MACH_IO_H */
arch/arm/mach-msm/include/mach/io.h +0 -1
index 5e0e93d..94bc292 100644
@@ -21,7 +21,6 @@
 
 void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype);
 
-#define __io(a)		__typesafe_io(a)
 void msm_map_qsd8x50_io(void);
 void msm_map_msm7x30_io(void);
 
arch/arm/mach-netx/include/mach/io.h +0 -1
index ac134a8..57e251c 100644
@@ -20,5 +20,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-nomadik/include/mach/io.h +0 -1
index a2b9e1a..9dffc02 100644
@@ -14,5 +14,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)         __typesafe_io(a)
 #endif
arch/arm/mach-ns9xxx/include/mach/io.h +0 -1
index 11de350..f2495ae 100644
@@ -11,6 +11,5 @@
 #ifndef __ASM_ARCH_IO_H
 #define __ASM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 
 #endif /* ifndef __ASM_ARCH_IO_H */
arch/arm/mach-nuc93x/include/mach/io.h +0 -1
index 99fe76d..96faf0e 100644
@@ -20,6 +20,5 @@
  * 1:1 mapping for ioremapped regions.
  */
 
-#define __io(a)		__typesafe_io(a)
 
 #endif
arch/arm/mach-orion5x/include/mach/io.h +0 -1
index 34c2a5c..b3b24eb 100644
@@ -38,7 +38,6 @@ __arch_iounmap(void __iomem *addr)
 
 #define __arch_ioremap(p, s, m)	__arch_ioremap(p, s, m)
 #define __arch_iounmap(a)	__arch_iounmap(a)
-#define __io(a)			__typesafe_io(a)
 
 /*****************************************************************************
  * Helpers to access Orion registers
arch/arm/mach-pnx4008/include/mach/io.h +0 -1
index bd655e5..cc9648b 100644
@@ -13,5 +13,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-pxa/include/mach/io.h +0 -1
index 5bfd427..286be85 100644
@@ -10,5 +10,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-realview/include/mach/io.h +0 -1
index cc45381..cfe167d 100644
@@ -20,5 +20,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s3c24a0/include/mach/io.h +0 -1
index e04664f..67ec841 100644
@@ -10,5 +10,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s3c64xx/include/mach/io.h +0 -1
index eb4dae8..5588df0 100644
@@ -10,5 +10,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s5p6440/include/mach/io.h +0 -1
index 10e18d3..00a9bf2 100644
@@ -10,5 +10,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s5p6442/include/mach/io.h +0 -1
index 02cacba..ee3f30b 100644
@@ -9,5 +9,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s5pc100/include/mach/io.h +0 -1
index d0970e4..cdabf13 100644
@@ -10,5 +10,4 @@
 #define __ASM_ARM_ARCH_IO_H
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-s5pv210/include/mach/io.h +0 -1
index f80590e..3aa48f4 100644
@@ -18,5 +18,4 @@
 #define __ASM_ARM_ARCH_IO_H __FILE__
 
 /* No current ISA/PCI bus support. */
-#define __io(a)		__typesafe_io(a)
 #endif /* __ASM_ARM_ARCH_IO_H */
arch/arm/mach-sa1100/include/mach/io.h +0 -1
index 0817eb0..32d1a64 100644
@@ -14,5 +14,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many 
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-u300/include/mach/io.h +0 -1
index 6770eea..e290b2c 100644
@@ -12,5 +12,4 @@
 #ifndef __MACH_IO_H
 #define __MACH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-ux500/include/mach/io.h +0 -1
index 16acb3b..844d86a 100644
@@ -14,5 +14,4 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-versatile/include/mach/io.h +0 -1
index 25c902a..e329b57 100644
@@ -20,5 +20,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-vexpress/include/mach/io.h +0 -1
index 2b73325..33a77d4 100644
@@ -20,5 +20,4 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a)		__typesafe_io(a)
 #endif
arch/arm/mach-w90x900/include/mach/io.h +0 -1
index 272f76b..fdbde6d 100644
@@ -22,6 +22,5 @@
  * 1:1 mapping for ioremapped regions.
  */
 
-#define __io(a)		__typesafe_io(a)
 
 #endif
arch/arm/plat-mxc/include/mach/io.h +0 -1
index ed05017..784b421 100644
@@ -33,6 +33,5 @@ __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
 #endif
 
 /* io address mapping macro */
-#define __io(a)		__typesafe_io(a)
 
 #endif
arch/arm/plat-omap/include/plat/io.h +0 -1
index a9beb3c..03e7d91 100644
@@ -43,7 +43,6 @@
  * We don't actually have real ISA nor PCI buses, but there is so many
  * drivers out there that might just work if we fake them...
  */
-#define __io(a)		__typesafe_io(a)
 /*
  * ----------------------------------------------------------------------------
  * I/O mapping
arch/arm/plat-spear/include/plat/io.h +0 -1
index faf8e7e..540d5ad 100644
@@ -14,5 +14,4 @@
 #ifndef __PLAT_IO_H
 #define __PLAT_IO_H
 
-#define __io(a)			__typesafe_io(a)
 #endif /* __PLAT_IO_H */
arch/arm/plat-stmp3xxx/include/mach/io.h +0 -1
index 4649a7b..64144c4 100644
@@ -16,6 +16,5 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H
 
-#define __io(a) 	__typesafe_io(a)
 
 #endif
Signature · 1 line
1.7.1
#10 lore raw

PATCH 6/6 Introduce common definition for __io()

Quoted 10 lines · Eric Miao
---
 arch/arm/include/asm/io.h                 |    4 ++++
 arch/arm/mach-aaec2000/include/mach/io.h  |    1 -
 arch/arm/mach-at91/include/mach/io.h      |    1 -
 arch/arm/mach-bcmring/include/mach/io.h   |    1 -
 arch/arm/mach-clps711x/include/mach/io.h  |    1 -
 arch/arm/mach-cns3xxx/include/mach/io.h   |    1 -
 arch/arm/mach-davinci/include/mach/io.h   |    1 -
 arch/arm/mach-ep93xx/include/mach/io.h    |    1 -

Again, ebsa110 is missing.

That's because __io() is a two-state definition. It means something if a platform does _not_ define it. It also means something _if_ a platform defines it.

You can't move it to asm/io.h because that precludes the first state from ever occuring. It's not a simple case that those platforms can provide some subsitute definition for __io() - they have to supply their own inb() et.al. accessors because they need to do something uniquely special there.

#11 lore raw

kprobe bug.

Hi Russell,

Thanks in advance for your kind to review my question.
I met a kprobe bug while I used it to debug my driver.
Here is the scenario:
I add a probe at function xxx(). And the assembly code of xxx() is as following,
=====================

	c035ee48 <xxx >:
c035ee48:       e59f3008        ldr     r3, [pc, #8]    ; c035ee58              <xxx+0x10>
c035ee4c:       e3a02001        mov     r2, #1  ; 0x1
c035ee50:       e5032fff        str     r2, [r3, #-4095]
c035ee54:       e12fff1e        bx      lr
c035ee58:       fe03dfff        .word   0xfe03dfff 

=====================
The ldr emulate always load e12fff1e to r3 register.
After debugging, I found the pc register should be 8 after current instruction. So we should set pc to pc+8 before instruction emulation and set it back to the next instruction after singe step. Here is my patch:
=======================

arch/arm/kernel/kprobes.c +2 -1
index 60c62c3..6e2567e 100644
@@ -132,8 +132,9 @@ static void __kprobes set_current_kprobe(struct kprobe *p)
 static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs,
 				 struct kprobe_ctlblk *kcb)
 {
-	regs->ARM_pc += 4;
+	regs->ARM_pc += 8;
 	p->ainsn.insn_handler(p, regs);
+	regs->ARM_pc -= 4;
 }
 
 /*

========================

Regards,
Bin

#12 lore raw

kprobe bug.

Quoted 33 lines · Bin Yang

Hi Russell,

Thanks in advance for your kind to review my question.
I met a kprobe bug while I used it to debug my driver.
Here is the scenario:
I add a probe at function xxx(). And the assembly code of xxx() is as following,
=====================

	c035ee48 <xxx >:
c035ee48:       e59f3008        ldr     r3, [pc, #8]    ; c035ee58              <xxx+0x10>
c035ee4c:       e3a02001        mov     r2, #1  ; 0x1
c035ee50:       e5032fff        str     r2, [r3, #-4095]
c035ee54:       e12fff1e        bx      lr
c035ee58:       fe03dfff        .word   0xfe03dfff 

=====================
The ldr emulate always load e12fff1e to r3 register.
After debugging, I found the pc register should be 8 after current instruction. So we should set pc to pc+8 before instruction emulation and set it back to the next instruction after singe step. Here is my patch:
=======================

arch/arm/kernel/kprobes.c +2 -1
index 60c62c3..6e2567e 100644
@@ -132,8 +132,9 @@ static void __kprobes set_current_kprobe(struct kprobe *p)
 static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs,
 				 struct kprobe_ctlblk *kcb)
 {
-	regs->ARM_pc += 4;
+	regs->ARM_pc += 8;
 	p->ainsn.insn_handler(p, regs);
+	regs->ARM_pc -= 4;
 }
 
 /*
Quoted 1 line

========================

This is wrong. You are breaking all the emulated instructions changing the pc value.

What needs to be done is to add a special case in emulate_ldr() to fixup rnv when rn is 15. The same fixup would be needed in emulate_str(). See emulate_alu_rflags() for example.

Nicolas

#13 lore raw

kprobe bug.

Thanks.
It looks "emulate_str" had considered PC register situation already. Only " emulate_ldr" has this problem.

Here is my new patch, thanks in advance to review it.

===============================

Quoted 1 line

From 554a86a94836d5f6c89c1253f2c2d85773cbe5eb Mon Sep 17 00:00:00 2001

From: Bin Yang <[email protected]>
Date: Mon, 28 Jun 2010 10:40:56 +0800
Subject: [PATCH] ARM: fix kprobe ldr instr emulate bug

---
 arch/arm/kernel/kprobes-decode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/kernel/kprobes-decode.c +3 -2
index 81b1737..80511d5 100644
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
 {
        insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0];
        kprobe_opcode_t insn = p->opcode;
+       long ppc = (long)p->addr + 8;
        union reg_pair fnr;
        int rd = (insn >> 12) & 0xf;
        int rn = (insn >> 16) & 0xf;
        int rm = insn & 0xf;
        long rdv;
-       long rnv  = regs->uregs[rn];
-       long rmv  = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */
+       long rnv = (rn == 15) ? ppc : regs->uregs[rn];
+       long rmv = (rm == 15) ? ppc : regs->uregs[rm];
        long cpsr = regs->ARM_cpsr;
 
 

Bin Yang

-----Original Message-----
From: Nicolas Pitre [mailto:nico at fluxnic.net]
Sent: 2010?6?26? 4:50
To: Bin Yang
Cc: Russell King - ARM Linux; Eric Miao; Haojian Zhuang; linux-arm-kernel
Subject: Re: kprobe bug.

Quoted 33 lines · Bin Yang

Hi Russell,

Thanks in advance for your kind to review my question.
I met a kprobe bug while I used it to debug my driver.
Here is the scenario:
I add a probe at function xxx(). And the assembly code of xxx() is as following,
=====================

	c035ee48 <xxx >:
c035ee48:       e59f3008        ldr     r3, [pc, #8]    ; c035ee58              <xxx+0x10>
c035ee4c:       e3a02001        mov     r2, #1  ; 0x1
c035ee50:       e5032fff        str     r2, [r3, #-4095]
c035ee54:       e12fff1e        bx      lr
c035ee58:       fe03dfff        .word   0xfe03dfff 

=====================
The ldr emulate always load e12fff1e to r3 register.
After debugging, I found the pc register should be 8 after current instruction. So we should set pc to pc+8 before instruction emulation and set it back to the next instruction after singe step. Here is my patch:
=======================

arch/arm/kernel/kprobes.c +2 -1
index 60c62c3..6e2567e 100644
@@ -132,8 +132,9 @@ static void __kprobes set_current_kprobe(struct kprobe *p)
 static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs,
 				 struct kprobe_ctlblk *kcb)
 {
-	regs->ARM_pc += 4;
+	regs->ARM_pc += 8;
 	p->ainsn.insn_handler(p, regs);
+	regs->ARM_pc -= 4;
 }
 
 /*
Quoted 1 line

========================

This is wrong. You are breaking all the emulated instructions changing the pc value.

What needs to be done is to add a special case in emulate_ldr() to fixup rnv when rn is 15. The same fixup would be needed in emulate_str(). See emulate_alu_rflags() for example.

Nicolas

Acked-by
#14 lore raw

kprobe bug.

Quoted 5 lines · Bin Yang

Thanks.
It looks "emulate_str" had considered PC register situation already. Only " emulate_ldr" has this problem.

Here is my new patch, thanks in advance to review it.

Quoted 7 lines

===============================
From 554a86a94836d5f6c89c1253f2c2d85773cbe5eb Mon Sep 17 00:00:00 2001
From: Bin Yang <[email protected]>
Date: Mon, 28 Jun 2010 10:40:56 +0800
Subject: [PATCH] ARM: fix kprobe ldr instr emulate bug

Please send to RMK's p?tch system.

Quoted 85 lines
---
 arch/arm/kernel/kprobes-decode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/kernel/kprobes-decode.c +3 -2
index 81b1737..80511d5 100644
@@ -583,13 +583,14 @@ static void __kprobes emulate_ldr(struct kprobe *p, struct pt_regs *regs)
 {
        insn_llret_3arg_fn_t *i_fn = (insn_llret_3arg_fn_t *)&p->ainsn.insn[0];
        kprobe_opcode_t insn = p->opcode;
+       long ppc = (long)p->addr + 8;
        union reg_pair fnr;
        int rd = (insn >> 12) & 0xf;
        int rn = (insn >> 16) & 0xf;
        int rm = insn & 0xf;
        long rdv;
-       long rnv  = regs->uregs[rn];
-       long rmv  = regs->uregs[rm]; /* rm/rmv may be invalid, don't care. */
+       long rnv = (rn == 15) ? ppc : regs->uregs[rn];
+       long rmv = (rm == 15) ? ppc : regs->uregs[rm];
        long cpsr = regs->ARM_cpsr;
 
 

Bin Yang

-----Original Message-----
From: Nicolas Pitre [mailto:nico at fluxnic.net]
Sent: 2010?6?26? 4:50
To: Bin Yang
Cc: Russell King - ARM Linux; Eric Miao; Haojian Zhuang; linux-arm-kernel
Subject: Re: kprobe bug.

Quoted 33 lines · Bin Yang

Hi Russell,

Thanks in advance for your kind to review my question.
I met a kprobe bug while I used it to debug my driver.
Here is the scenario:
I add a probe at function xxx(). And the assembly code of xxx() is as following,
=====================

	c035ee48 <xxx >:
c035ee48:       e59f3008        ldr     r3, [pc, #8]    ; c035ee58              <xxx+0x10>
c035ee4c:       e3a02001        mov     r2, #1  ; 0x1
c035ee50:       e5032fff        str     r2, [r3, #-4095]
c035ee54:       e12fff1e        bx      lr
c035ee58:       fe03dfff        .word   0xfe03dfff 

=====================
The ldr emulate always load e12fff1e to r3 register.
After debugging, I found the pc register should be 8 after current instruction. So we should set pc to pc+8 before instruction emulation and set it back to the next instruction after singe step. Here is my patch:
=======================

arch/arm/kernel/kprobes.c +2 -1
index 60c62c3..6e2567e 100644
@@ -132,8 +132,9 @@ static void __kprobes set_current_kprobe(struct kprobe *p)
 static void __kprobes singlestep(struct kprobe *p, struct pt_regs *regs,
 				 struct kprobe_ctlblk *kcb)
 {
-	regs->ARM_pc += 4;
+	regs->ARM_pc += 8;
 	p->ainsn.insn_handler(p, regs);
+	regs->ARM_pc -= 4;
 }
 
 /*
Quoted 1 line

========================

This is wrong. You are breaking all the emulated instructions changing the pc value.

What needs to be done is to add a special case in emulate_ldr() to fixup rnv when rn is 15. The same fixup would be needed in emulate_str(). See emulate_alu_rflags() for example.

Nicolas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel