Merge tag 'asm-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 22 Dec 2012 00:39:08 +0000 (16:39 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 22 Dec 2012 00:39:08 +0000 (16:39 -0800)
Pull asm-generic cleanup from Arnd Bergmann:
 "These are a few cleanups for asm-generic:

   - a set of patches from Lars-Peter Clausen to generalize asm/mmu.h
     and use it in the architectures that don't need any special
     handling.
   - A patch from Will Deacon to remove the {read,write}s{b,w,l} as
     discussed during the arm64 review
   - A patch from James Hogan that helps with the meta architecture
     series."

* tag 'asm-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  xtensa: Use generic asm/mmu.h for nommu
  h8300: Use generic asm/mmu.h
  c6x: Use generic asm/mmu.h
  asm-generic/mmu.h: Add support for FDPIC
  asm-generic/mmu.h: Remove unused vmlist field from mm_context_t
  asm-generic: io: remove {read,write} string functions
  asm-generic/io.h: remove asm/cacheflush.h include

1  2 
arch/c6x/include/asm/Kbuild
arch/h8300/include/asm/Kbuild
include/asm-generic/io.h

index eae7b5963e860962fef1c91f3db98f150400b67b,3c8b660e7a9aba7a2957123f56c720a05772b351..4258b088aa93af29c550405b62a2b36ad4ec9a29
@@@ -25,6 -25,7 +25,7 @@@ generic-y += kdebug.
  generic-y += kmap_types.h
  generic-y += local.h
  generic-y += mman.h
+ generic-y += mmu.h
  generic-y += mmu_context.h
  generic-y += msgbuf.h
  generic-y += param.h
@@@ -49,7 -50,6 +50,7 @@@ generic-y += termbits.
  generic-y += termios.h
  generic-y += tlbflush.h
  generic-y += topology.h
 +generic-y += trace_clock.h
  generic-y += types.h
  generic-y += ucontext.h
  generic-y += user.h
index bebdc36ebb0a85551c19a07f7caacb0155eecb0e,173de77e5933393284b477d629aea719f368c297..995eb47e01bb5c17866f10e8e24aecf4aedacd9c
@@@ -1,5 -1,6 +1,6 @@@
 -include include/asm-generic/Kbuild.asm
  
  generic-y += clkdev.h
  generic-y += exec.h
+ generic-y += mmu.h
  generic-y += module.h
 +generic-y += trace_clock.h
diff --combined include/asm-generic/io.h
index d1e93284d72a6ebdc4e246732a11e398e6ba5d7f,063ce76409105fdee96e4b0392a162ef1d3f0545..33bbbae4ddc699ba84b5ae657594c35bfa61cb22
@@@ -12,7 -12,6 +12,6 @@@
  #define __ASM_GENERIC_IO_H
  
  #include <asm/page.h> /* I/O is all done through memory accesses */
- #include <asm/cacheflush.h>
  #include <linux/types.h>
  
  #ifdef CONFIG_GENERIC_IOMAP
@@@ -83,25 -82,19 +82,25 @@@ static inline void __raw_writel(u32 b, 
  #define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr)
  
  #ifdef CONFIG_64BIT
 +#ifndef __raw_readq
  static inline u64 __raw_readq(const volatile void __iomem *addr)
  {
        return *(const volatile u64 __force *) addr;
  }
 +#endif
 +
  #define readq(addr) __le64_to_cpu(__raw_readq(addr))
  
 +#ifndef __raw_writeq
  static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
  {
        *(volatile u64 __force *) addr = b;
  }
 -#define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr)
  #endif
  
 +#define writeq(b, addr) __raw_writeq(__cpu_to_le64(b), addr)
 +#endif /* CONFIG_64BIT */
 +
  #ifndef PCI_IOBASE
  #define PCI_IOBASE ((void __iomem *) 0)
  #endif
@@@ -154,7 -147,7 +153,7 @@@ static inline void insb(unsigned long a
        if (count) {
                u8 *buf = buffer;
                do {
 -                      u8 x = inb(addr);
 +                      u8 x = __raw_readb(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@@ -167,7 -160,7 +166,7 @@@ static inline void insw(unsigned long a
        if (count) {
                u16 *buf = buffer;
                do {
 -                      u16 x = inw(addr);
 +                      u16 x = __raw_readw(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@@ -180,7 -173,7 +179,7 @@@ static inline void insl(unsigned long a
        if (count) {
                u32 *buf = buffer;
                do {
 -                      u32 x = inl(addr);
 +                      u32 x = __raw_readl(addr + PCI_IOBASE);
                        *buf++ = x;
                } while (--count);
        }
@@@ -193,7 -186,7 +192,7 @@@ static inline void outsb(unsigned long 
        if (count) {
                const u8 *buf = buffer;
                do {
 -                      outb(*buf++, addr);
 +                      __raw_writeb(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
  }
@@@ -205,7 -198,7 +204,7 @@@ static inline void outsw(unsigned long 
        if (count) {
                const u16 *buf = buffer;
                do {
 -                      outw(*buf++, addr);
 +                      __raw_writew(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
  }
@@@ -217,42 -210,12 +216,12 @@@ static inline void outsl(unsigned long 
        if (count) {
                const u32 *buf = buffer;
                do {
 -                      outl(*buf++, addr);
 +                      __raw_writel(*buf++, addr + PCI_IOBASE);
                } while (--count);
        }
  }
  #endif
  
- static inline void readsl(const void __iomem *addr, void *buf, int len)
- {
-       insl(addr - PCI_IOBASE, buf, len);
- }
- static inline void readsw(const void __iomem *addr, void *buf, int len)
- {
-       insw(addr - PCI_IOBASE, buf, len);
- }
- static inline void readsb(const void __iomem *addr, void *buf, int len)
- {
-       insb(addr - PCI_IOBASE, buf, len);
- }
- static inline void writesl(const void __iomem *addr, const void *buf, int len)
- {
-       outsl(addr - PCI_IOBASE, buf, len);
- }
- static inline void writesw(const void __iomem *addr, const void *buf, int len)
- {
-       outsw(addr - PCI_IOBASE, buf, len);
- }
- static inline void writesb(const void __iomem *addr, const void *buf, int len)
- {
-       outsb(addr - PCI_IOBASE, buf, len);
- }
  #ifndef CONFIG_GENERIC_IOMAP
  #define ioread8(addr)         readb(addr)
  #define ioread16(addr)                readw(addr)
  
  #ifndef CONFIG_GENERIC_IOMAP
  struct pci_dev;
 +extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
 +
 +#ifndef pci_iounmap
  static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
  {
  }
 +#endif
  #endif /* CONFIG_GENERIC_IOMAP */
  
  /*
   * Change virtual addresses to physical addresses and vv.
   * These are pretty trivial
   */
 +#ifndef virt_to_phys
  static inline unsigned long virt_to_phys(volatile void *address)
  {
        return __pa((unsigned long)address);
@@@ -315,7 -273,6 +284,7 @@@ static inline void *phys_to_virt(unsign
  {
        return __va(address);
  }
 +#endif
  
  /*
   * Change "struct page" to physical address.
@@@ -375,16 -332,9 +344,16 @@@ static inline void *bus_to_virt(unsigne
  }
  #endif
  
 +#ifndef memset_io
  #define memset_io(a, b, c)    memset(__io_virt(a), (b), (c))
 +#endif
 +
 +#ifndef memcpy_fromio
  #define memcpy_fromio(a, b, c)        memcpy((a), __io_virt(b), (c))
 +#endif
 +#ifndef memcpy_toio
  #define memcpy_toio(a, b, c)  memcpy(__io_virt(a), (b), (c))
 +#endif
  
  #endif /* __KERNEL__ */