From: jbarnes@sgi.com (Jesse Barnes) Here's the patch to add the new _relaxed variants for PIO read accesses. It's been ack'd by gregkh and Grant Grundler, and I think it's ready to go. PCI ordering rules also guarantee that PIO read responses arrive after any outstanding DMA writes on that bus, since for some devices the result of a readb() call may signal to the driver that a DMA transaction is complete. In many cases, however, the driver may want to indicate that the next readb() call has no relation to any previous DMA writes performed by the device. The driver can use the readb_relaxed() for these cases, although only some platforms will honor the relaxed semantics. --- Documentation/DocBook/deviceiobook.tmpl | 16 +++++++++++++++- arch/ia64/sn/kernel/sn2/io.c | 28 ++++++++++++++++++++++++++++ include/asm-alpha/io.h | 5 +++++ include/asm-arm/arch-ebsa110/io.h | 3 +++ include/asm-arm/io.h | 3 +++ include/asm-arm26/io.h | 3 +++ include/asm-cris/io.h | 3 +++ include/asm-h8300/io.h | 4 ++++ include/asm-i386/io.h | 3 +++ include/asm-ia64/io.h | 16 ++++++++++++++++ include/asm-ia64/machvec.h | 28 ++++++++++++++++++++++++++++ include/asm-ia64/machvec_sn2.h | 8 ++++++++ include/asm-ia64/sn/sn2/io.h | 12 ++++++++---- include/asm-m68k/io.h | 4 ++++ include/asm-m68knommu/io.h | 4 ++++ include/asm-mips/io.h | 4 ++++ include/asm-parisc/io.h | 5 +++++ include/asm-ppc/io.h | 3 +++ include/asm-ppc64/io.h | 4 ++++ include/asm-s390/io.h | 4 ++++ include/asm-sh/io.h | 4 ++++ include/asm-sparc/io.h | 3 +++ include/asm-sparc64/io.h | 4 ++++ include/asm-v850/io.h | 4 ++++ include/asm-x86_64/io.h | 4 ++++ 25 files changed, 174 insertions(+), 5 deletions(-) diff -puN arch/ia64/sn/kernel/sn2/io.c~readX_relaxed arch/ia64/sn/kernel/sn2/io.c --- 25/arch/ia64/sn/kernel/sn2/io.c~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/arch/ia64/sn/kernel/sn2/io.c 2004-01-20 10:11:24.000000000 -0800 @@ -23,6 +23,10 @@ #undef __sn_readw #undef __sn_readl #undef __sn_readq +#undef __sn_readb_relaxed +#undef __sn_readw_relaxed +#undef __sn_readl_relaxed +#undef __sn_readq_relaxed unsigned int __sn_inb (unsigned long port) @@ -84,4 +88,28 @@ __sn_readq (void *addr) return ___sn_readq (addr); } +unsigned char +__sn_readb_relaxed (void *addr) +{ + return ___sn_readb_relaxed (addr); +} + +unsigned short +__sn_readw_relaxed (void *addr) +{ + return ___sn_readw_relaxed (addr); +} + +unsigned int +__sn_readl_relaxed (void *addr) +{ + return ___sn_readl_relaxed (addr); +} + +unsigned long +__sn_readq_relaxed (void *addr) +{ + return ___sn_readq_relaxed (addr); +} + #endif diff -puN Documentation/DocBook/deviceiobook.tmpl~readX_relaxed Documentation/DocBook/deviceiobook.tmpl --- 25/Documentation/DocBook/deviceiobook.tmpl~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/Documentation/DocBook/deviceiobook.tmpl 2004-01-20 10:11:24.000000000 -0800 @@ -126,7 +126,9 @@ The functions are named readb, readw, readl, - readq, writeb, + readq, readb_relaxed, + readw_relaxed, readl_relaxed, + readq_relaxed, writeb, writew, writel and writeq. @@ -159,6 +161,18 @@ author cares. This kind of property cannot be hidden from driver writers in the API. + + + PCI ordering rules also guarantee that PIO read responses arrive + after any outstanding DMA writes on that bus, since for some devices + the result of a readb call may signal to the + driver that a DMA transaction is complete. In many cases, however, + the driver may want to indicate that the next + readb call has no relation to any previous DMA + writes performed by the device. The driver can use + readb_relaxed for these cases, although only + some platforms will honor the relaxed semantics. + diff -puN include/asm-alpha/io.h~readX_relaxed include/asm-alpha/io.h --- 25/include/asm-alpha/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-alpha/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -412,6 +412,11 @@ extern void ___raw_writeq(u64 b, unsign # define readq(a) _readq((unsigned long)(a)) #endif +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) + #ifndef writeb # define writeb(v,a) _writeb((v),(unsigned long)(a)) #endif diff -puN include/asm-arm26/io.h~readX_relaxed include/asm-arm26/io.h --- 25/include/asm-arm26/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-arm26/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -308,6 +308,9 @@ DECLARE_IO(int,l,"") #define readb(c) (__readwrite_bug("readb"),0) #define readw(c) (__readwrite_bug("readw"),0) #define readl(c) (__readwrite_bug("readl"),0) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define writeb(v,c) __readwrite_bug("writeb") #define writew(v,c) __readwrite_bug("writew") #define writel(v,c) __readwrite_bug("writel") diff -puN include/asm-arm/arch-ebsa110/io.h~readX_relaxed include/asm-arm/arch-ebsa110/io.h --- 25/include/asm-arm/arch-ebsa110/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-arm/arch-ebsa110/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -38,6 +38,9 @@ u32 __readl(void *addr); #define readb(b) __readb(b) #define readw(b) __readw(b) #define readl(b) __readl(b) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) void __writeb(u8 val, void *addr); void __writew(u16 val, void *addr); diff -puN include/asm-arm/io.h~readX_relaxed include/asm-arm/io.h --- 25/include/asm-arm/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-arm/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -149,6 +149,9 @@ extern void _memset_io(unsigned long, in #define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; }) #define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; }) #define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define readsb(p,d,l) __raw_readsb((unsigned int)__mem_pci(p),d,l) #define readsw(p,d,l) __raw_readsw((unsigned int)__mem_pci(p),d,l) diff -puN include/asm-cris/io.h~readX_relaxed include/asm-cris/io.h --- 25/include/asm-cris/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-cris/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -42,6 +42,9 @@ extern void iounmap(void *addr); #define readb(addr) (*(volatile unsigned char *) (addr)) #define readw(addr) (*(volatile unsigned short *) (addr)) #define readl(addr) (*(volatile unsigned int *) (addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl diff -puN include/asm-h8300/io.h~readX_relaxed include/asm-h8300/io.h --- 25/include/asm-h8300/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-h8300/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -47,6 +47,10 @@ static inline unsigned int _swapl(volati #define readl(addr) \ ({ unsigned int __v = (*(volatile unsigned int *) (addr & 0x00ffffff)); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr & 0x00ffffff)) = (b)) #define writew(b,addr) (void)((*(volatile unsigned short *) (addr & 0x00ffffff)) = (b)) #define writel(b,addr) (void)((*(volatile unsigned int *) (addr & 0x00ffffff)) = (b)) diff -puN include/asm-i386/io.h~readX_relaxed include/asm-i386/io.h --- 25/include/asm-i386/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-i386/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -153,6 +153,9 @@ extern void bt_iounmap(void *addr, unsig #define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl diff -puN include/asm-ia64/io.h~readX_relaxed include/asm-ia64/io.h --- 25/include/asm-ia64/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ia64/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -125,6 +125,10 @@ __ia64_mk_io_addr (unsigned long port) #define __ia64_readw ___ia64_readw #define __ia64_readl ___ia64_readl #define __ia64_readq ___ia64_readq +#define __ia64_readb_relaxed ___ia64_readb +#define __ia64_readw_relaxed ___ia64_readw +#define __ia64_readl_relaxed ___ia64_readl +#define __ia64_readq_relaxed ___ia64_readq #define __ia64_writeb ___ia64_writeb #define __ia64_writew ___ia64_writew #define __ia64_writel ___ia64_writel @@ -337,15 +341,27 @@ __writeq (unsigned long val, void *addr) #define __readw platform_readw #define __readl platform_readl #define __readq platform_readq +#define __readb_relaxed platform_readb_relaxed +#define __readw_relaxed platform_readw_relaxed +#define __readl_relaxed platform_readl_relaxed +#define __readq_relaxed platform_readq_relaxed #define readb(a) __readb((void *)(a)) #define readw(a) __readw((void *)(a)) #define readl(a) __readl((void *)(a)) #define readq(a) __readq((void *)(a)) +#define readb_relaxed(a) __readb_relaxed((void *)(a)) +#define readw_relaxed(a) __readw_relaxed((void *)(a)) +#define readl_relaxed(a) __readl_relaxed((void *)(a)) +#define readq_relaxed(a) __readq_relaxed((void *)(a)) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl #define __raw_readq readq +#define __raw_readb_relaxed readb_relaxed +#define __raw_readw_relaxed readw_relaxed +#define __raw_readl_relaxed readl_relaxed +#define __raw_readq_relaxed readq_relaxed #define writeb(v,a) __writeb((v), (void *) (a)) #define writew(v,a) __writew((v), (void *) (a)) #define writel(v,a) __writel((v), (void *) (a)) diff -puN include/asm-ia64/machvec.h~readX_relaxed include/asm-ia64/machvec.h --- 25/include/asm-ia64/machvec.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ia64/machvec.h 2004-01-20 10:11:24.000000000 -0800 @@ -64,6 +64,10 @@ typedef unsigned char ia64_mv_readb_t (v typedef unsigned short ia64_mv_readw_t (void *); typedef unsigned int ia64_mv_readl_t (void *); typedef unsigned long ia64_mv_readq_t (void *); +typedef unsigned char ia64_mv_readb_relaxed_t (void *); +typedef unsigned short ia64_mv_readw_relaxed_t (void *); +typedef unsigned int ia64_mv_readl_relaxed_t (void *); +typedef unsigned long ia64_mv_readq_relaxed_t (void *); extern void machvec_noop (void); extern void machvec_memory_fence (void); @@ -114,6 +118,10 @@ extern void machvec_memory_fence (void); # define platform_readw ia64_mv.readw # define platform_readl ia64_mv.readl # define platform_readq ia64_mv.readq +# define platform_readb_relaxed ia64_mv.readb_relaxed +# define platform_readw_relaxed ia64_mv.readw_relaxed +# define platform_readl_relaxed ia64_mv.readl_relaxed +# define platform_readq_relaxed ia64_mv.readq_relaxed # endif /* __attribute__((__aligned__(16))) is required to make size of the @@ -155,6 +163,10 @@ struct ia64_machine_vector { ia64_mv_readw_t *readw; ia64_mv_readl_t *readl; ia64_mv_readq_t *readq; + ia64_mv_readb_relaxed_t *readb_relaxed; + ia64_mv_readw_relaxed_t *readw_relaxed; + ia64_mv_readl_relaxed_t *readl_relaxed; + ia64_mv_readq_relaxed_t *readq_relaxed; } __attribute__((__aligned__(16))); /* align attrib? see above comment */ #define MACHVEC_INIT(name) \ @@ -192,6 +204,10 @@ struct ia64_machine_vector { platform_readw, \ platform_readl, \ platform_readq, \ + platform_readb_relaxed, \ + platform_readw_relaxed, \ + platform_readl_relaxed, \ + platform_readq_relaxed, \ } extern struct ia64_machine_vector ia64_mv; @@ -315,5 +331,17 @@ extern ia64_mv_dma_supported swiotlb_dm #ifndef platform_readq # define platform_readq __ia64_readq #endif +#ifndef platform_readb_relaxed +# define platform_readb_relaxed __ia64_readb_relaxed +#endif +#ifndef platform_readw_relaxed +# define platform_readw_relaxed __ia64_readw_relaxed +#endif +#ifndef platform_readl_relaxed +# define platform_readl_relaxed __ia64_readl_relaxed +#endif +#ifndef platform_readq_relaxed +# define platform_readq_relaxed __ia64_readq_relaxed +#endif #endif /* _ASM_IA64_MACHVEC_H */ diff -puN include/asm-ia64/machvec_sn2.h~readX_relaxed include/asm-ia64/machvec_sn2.h --- 25/include/asm-ia64/machvec_sn2.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ia64/machvec_sn2.h 2004-01-20 10:11:24.000000000 -0800 @@ -51,6 +51,10 @@ extern ia64_mv_readb_t __sn_readb; extern ia64_mv_readw_t __sn_readw; extern ia64_mv_readl_t __sn_readl; extern ia64_mv_readq_t __sn_readq; +extern ia64_mv_readb_t __sn_readb_relaxed; +extern ia64_mv_readw_t __sn_readw_relaxed; +extern ia64_mv_readl_t __sn_readl_relaxed; +extern ia64_mv_readq_t __sn_readq_relaxed; extern ia64_mv_dma_alloc_coherent sn_dma_alloc_coherent; extern ia64_mv_dma_free_coherent sn_dma_free_coherent; extern ia64_mv_dma_map_single sn_dma_map_single; @@ -85,6 +89,10 @@ extern ia64_mv_dma_supported sn_dma_sup #define platform_readw __sn_readw #define platform_readl __sn_readl #define platform_readq __sn_readq +#define platform_readb_relaxed __sn_readb_relaxed +#define platform_readw_relaxed __sn_readw_relaxed +#define platform_readl_relaxed __sn_readl_relaxed +#define platform_readq_relaxed __sn_readq_relaxed #define platform_irq_desc sn_irq_desc #define platform_irq_to_vector sn_irq_to_vector #define platform_local_vector_to_irq sn_local_vector_to_irq diff -puN include/asm-ia64/sn/sn2/io.h~readX_relaxed include/asm-ia64/sn/sn2/io.h --- 25/include/asm-ia64/sn/sn2/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ia64/sn/sn2/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -27,6 +27,10 @@ extern void sn_dma_flush(unsigned long); #define __sn_readw ___sn_readw #define __sn_readl ___sn_readl #define __sn_readq ___sn_readq +#define __sn_readb_relaxed ___sn_readb_relaxed +#define __sn_readw_relaxed ___sn_readw_relaxed +#define __sn_readl_relaxed ___sn_readl_relaxed +#define __sn_readq_relaxed ___sn_readq_relaxed /* * The following routines are SN Platform specific, called when @@ -208,25 +212,25 @@ sn_inl_fast (unsigned long port) } static inline unsigned char -sn_readb_fast (void *addr) +___sn_readb_relaxed (void *addr) { return *(volatile unsigned char *)addr; } static inline unsigned short -sn_readw_fast (void *addr) +___sn_readw_relaxed (void *addr) { return *(volatile unsigned short *)addr; } static inline unsigned int -sn_readl_fast (void *addr) +___sn_readl_relaxed (void *addr) { return *(volatile unsigned int *) addr; } static inline unsigned long -sn_readq_fast (void *addr) +___sn_readq_relaxed (void *addr) { return *(volatile unsigned long *) addr; } diff -puN include/asm-m68k/io.h~readX_relaxed include/asm-m68k/io.h --- 25/include/asm-m68k/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-m68k/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -261,6 +261,10 @@ static inline void isa_delay(void) #define writeb(val,addr) out_8((addr),(val)) #define writew(val,addr) out_le16((addr),(val)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #ifndef CONFIG_ISA #define inb(port) in_8(port) #define outb(val,port) out_8((port),(val)) diff -puN include/asm-m68knommu/io.h~readX_relaxed include/asm-m68knommu/io.h --- 25/include/asm-m68knommu/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-m68knommu/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -39,6 +39,10 @@ static inline unsigned int _swapl(volati #define readl(addr) \ ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b)) #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b)) #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b)) diff -puN include/asm-mips/io.h~readX_relaxed include/asm-mips/io.h --- 25/include/asm-mips/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-mips/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -264,6 +264,10 @@ extern void iounmap(void *addr); #define readw(addr) __ioswab16(__raw_readw(addr)) #define readl(addr) __ioswab32(__raw_readl(addr)) #define readq(addr) __ioswab64(__raw_readq(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) #define __raw_writeb(b,addr) ((*(volatile unsigned char *)(addr)) = (b)) #define __raw_writew(w,addr) ((*(volatile unsigned short *)(addr)) = (w)) diff -puN include/asm-parisc/io.h~readX_relaxed include/asm-parisc/io.h --- 25/include/asm-parisc/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-parisc/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -171,6 +171,11 @@ extern __inline__ void ___raw_writeq(uns #define writeq(b,addr) __raw_writeq(cpu_to_le64(b),addr) #endif /* !USE_HPPA_IOREMAP */ +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) + extern void __memcpy_fromio(unsigned long dest, unsigned long src, int count); extern void __memcpy_toio(unsigned long dest, unsigned long src, int count); extern void __memset_io(unsigned long dest, char fill, int count); diff -puN include/asm-ppc64/io.h~readX_relaxed include/asm-ppc64/io.h --- 25/include/asm-ppc64/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ppc64/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -79,6 +79,10 @@ extern unsigned long pci_io_base; #define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) #endif +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + extern void _insb(volatile u8 *port, void *buf, int ns); extern void _outsb(volatile u8 *port, const void *buf, int ns); extern void _insw(volatile u16 *port, void *buf, int ns); diff -puN include/asm-ppc/io.h~readX_relaxed include/asm-ppc/io.h --- 25/include/asm-ppc/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-ppc/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -58,6 +58,9 @@ extern unsigned long pci_dram_offset; #define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) #endif /* CONFIG_APUS */ +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb(addr) (*(volatile unsigned char *)(addr)) #define __raw_readw(addr) (*(volatile unsigned short *)(addr)) diff -puN include/asm-s390/io.h~readX_relaxed include/asm-s390/io.h --- 25/include/asm-s390/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-s390/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -87,6 +87,10 @@ extern void iounmap(void *addr); #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) diff -puN include/asm-sh/io.h~readX_relaxed include/asm-sh/io.h --- 25/include/asm-sh/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-sh/io.h 2004-01-20 10:12:04.000000000 -0800 @@ -130,6 +130,10 @@ # define writel(v,a) ({ __raw_writel((v),(unsigned long)(a)); mb(); }) #endif +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) + /* * If the platform has PC-like I/O, this function converts the offset into * an address. diff -puN include/asm-sparc64/io.h~readX_relaxed include/asm-sparc64/io.h --- 25/include/asm-sparc64/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-sparc64/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -176,6 +176,10 @@ static __inline__ void _writeq(u64 q, un #define readw(__addr) (_readw((unsigned long)(__addr))) #define readl(__addr) (_readl((unsigned long)(__addr))) #define readq(__addr) (_readq((unsigned long)(__addr))) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) +#define readq_relaxed(a) readq(a) #define writeb(__b, __addr) (_writeb((u8)(__b), (unsigned long)(__addr))) #define writew(__w, __addr) (_writew((u16)(__w), (unsigned long)(__addr))) #define writel(__l, __addr) (_writel((u32)(__l), (unsigned long)(__addr))) diff -puN include/asm-sparc/io.h~readX_relaxed include/asm-sparc/io.h --- 25/include/asm-sparc/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-sparc/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -99,6 +99,9 @@ static inline void __writel(u32 b, unsig #define readb(addr) __readb((unsigned long)(addr)) #define readw(addr) __readw((unsigned long)(addr)) #define readl(addr) __readl((unsigned long)(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define writeb(b, addr) __writeb((b),(unsigned long)(addr)) #define writew(b, addr) __writew((b),(unsigned long)(addr)) diff -puN include/asm-v850/io.h~readX_relaxed include/asm-v850/io.h --- 25/include/asm-v850/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-v850/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -23,6 +23,10 @@ #define readl(addr) \ ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; }) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) + #define writeb(b, addr) \ (void)((*(volatile unsigned char *) (addr)) = (b)) #define writew(b, addr) \ diff -puN include/asm-x86_64/io.h~readX_relaxed include/asm-x86_64/io.h --- 25/include/asm-x86_64/io.h~readX_relaxed 2004-01-20 10:11:24.000000000 -0800 +++ 25-akpm/include/asm-x86_64/io.h 2004-01-20 10:11:24.000000000 -0800 @@ -188,6 +188,10 @@ extern void iounmap(void *addr); #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) #define readq(addr) (*(volatile unsigned long *) __io_virt(addr)) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) +#define readq_relaxed(a) readq(a) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl _