lkml.org 
[lkml]   [1999]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] the other __raw_writel's
Linus,

The following patch against 2.3.14 adds __raw_writel and friends to the
other arches. The return and arg types in the Sparc code are weird, but
I stuck with it for my variants.

Jeff




--
Any sufficiently advanced technology is indistinguishable from a rigged
demo.
-- Andy Finkel--- /g/vanilla/v2.3.14/linux/include/asm-arm/arch-ebsa285/io.h Mon Jul 19 12:52:57 1999
+++ linux/include/asm-arm/arch-ebsa285/io.h Thu Aug 19 15:21:15 1999
@@ -90,6 +90,13 @@
#define writew(b,addr) (*(volatile unsigned short *)__pci_mem_addr(addr) = (b))
#define writel(b,addr) (*(volatile unsigned long *)__pci_mem_addr(addr) = (b))

+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
#define memset_io(a,b,c) memset(__pci_mem_addr(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),__pci_mem_addr(b),(c))
#define memcpy_toio(a,b,c) memcpy(__pci_mem_addr(a),(b),(c))
diff -urN /g/vanilla/v2.3.14/linux/include/asm-arm/io.h linux/include/asm-arm/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-arm/io.h Mon Jul 19 12:52:57 1999
+++ linux/include/asm-arm/io.h Thu Aug 19 15:21:15 1999
@@ -192,9 +192,15 @@
#define readb(p) (panic("readb called, but not implemented"),0)
#define readw(p) (panic("readw called, but not implemented"),0)
#define readl(p) (panic("readl called, but not implemented"),0)
+#define __raw_readb(p) (panic("__raw_readb called, but not implemented"),0)
+#define __raw_readw(p) (panic("__raw_readw called, but not implemented"),0)
+#define __raw_readl(p) (panic("__raw_readl called, but not implemented"),0)
#define writeb(v,p) panic("writeb called, but not implemented")
#define writew(v,p) panic("writew called, but not implemented")
#define writel(v,p) panic("writel called, but not implemented")
+#define __raw_writeb(v,p) panic("__raw_writeb called, but not implemented")
+#define __raw_writew(v,p) panic("__raw_writew called, but not implemented")
+#define __raw_writel(v,p) panic("__raw_writel called, but not implemented")

#endif

diff -urN /g/vanilla/v2.3.14/linux/include/asm-i386/io.h linux/include/asm-i386/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-i386/io.h Mon Aug 9 15:42:16 1999
+++ linux/include/asm-i386/io.h Thu Aug 19 15:21:15 1999
@@ -157,6 +157,13 @@
#define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b))
#define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b))

+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
#define memset_io(a,b,c) memset(__io_virt(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c))
#define memcpy_toio(a,b,c) memcpy(__io_virt(a),(b),(c))
diff -urN /g/vanilla/v2.3.14/linux/include/asm-m68k/io.h linux/include/asm-m68k/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-m68k/io.h Thu May 13 14:00:09 1999
+++ linux/include/asm-m68k/io.h Thu Aug 19 15:21:15 1999
@@ -33,6 +33,13 @@
#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b))
#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b))

+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
#define memset_io(a,b,c) memset((void *)(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
diff -urN /g/vanilla/v2.3.14/linux/include/asm-mips/io.h linux/include/asm-mips/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-mips/io.h Wed Jun 30 14:24:55 1999
+++ linux/include/asm-mips/io.h Thu Aug 19 15:21:15 1999
@@ -150,6 +150,13 @@
#define writew(b,addr) (*(volatile unsigned short *) (0xa0000000 + (unsigned long)(addr)) = (b))
#define writel(b,addr) (*(volatile unsigned int *) (0xa0000000 + (unsigned long)(addr)) = (b))

+#define __raw_readb readb
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writeb writeb
+#define __raw_writew writew
+#define __raw_writel writel
+
#define memset_io(a,b,c) memset((void *)(0xa0000000 + (unsigned long)a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(0xa0000000 + (unsigned long)(b)),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(0xa0000000 + (unsigned long)(a)),(b),(c))
diff -urN /g/vanilla/v2.3.14/linux/include/asm-ppc/io.h linux/include/asm-ppc/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-ppc/io.h Thu May 13 14:00:09 1999
+++ linux/include/asm-ppc/io.h Thu Aug 19 15:21:15 1999
@@ -45,12 +45,23 @@
#define readl(addr) (*(volatile unsigned int *) (addr))
#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
+#define __raw_readw readw
+#define __raw_readl readl
+#define __raw_writew writew
+#define __raw_writel writel
#else
#define readw(addr) in_le16((volatile unsigned short *)(addr))
#define readl(addr) in_le32((volatile unsigned *)(addr))
#define writew(b,addr) out_le16((volatile unsigned short *)(addr),(b))
#define writel(b,addr) out_le32((volatile unsigned *)(addr),(b))
+#define __raw_readw(addr) (*(volatile unsigned short *) (addr))
+#define __raw_readl(addr) (*(volatile unsigned int *) (addr))
+#define __raw_writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
+#define __raw_writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
#endif
+
+#define __raw_readb readb
+#define __raw_writeb writeb

#define insb(port, buf, ns) _insb((unsigned char *)((port)+_IO_BASE), (buf), (ns))
#define outsb(port, buf, ns) _outsb((unsigned char *)((port)+_IO_BASE), (buf), (ns))
diff -urN /g/vanilla/v2.3.14/linux/include/asm-sparc/io.h linux/include/asm-sparc/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-sparc/io.h Wed Jun 9 17:44:26 1999
+++ linux/include/asm-sparc/io.h Thu Aug 19 15:21:15 1999
@@ -40,6 +40,21 @@
return flip_dword(*(volatile unsigned long*)addr);
}

+extern __inline__ unsigned long __raw_readb(unsigned long addr)
+{
+ return *(volatile unsigned char*)addr;
+}
+
+extern __inline__ unsigned long __raw_readw(unsigned long addr)
+{
+ return *(volatile unsigned short*)addr;
+}
+
+extern __inline__ unsigned long __raw_readl(unsigned long addr)
+{
+ return *(volatile unsigned long*)addr;
+}
+
extern __inline__ void writeb(unsigned short b, unsigned long addr)
{
*(volatile unsigned char*)addr = b;
@@ -53,6 +68,21 @@
extern __inline__ void writel(unsigned int b, unsigned long addr)
{
*(volatile unsigned long*)addr = flip_dword(b);
+}
+
+extern __inline__ void __raw_writeb(unsigned short b, unsigned long addr)
+{
+ *(volatile unsigned char*)addr = b;
+}
+
+extern __inline__ void __raw_writew(unsigned short b, unsigned long addr)
+{
+ *(volatile unsigned short*)addr = b;
+}
+
+extern __inline__ void __raw_writel(unsigned int b, unsigned long addr)
+{
+ *(volatile unsigned long*)addr = b;
}

extern __inline__ unsigned long inb_local(unsigned long addr)
diff -urN /g/vanilla/v2.3.14/linux/include/asm-sparc64/io.h linux/include/asm-sparc64/io.h
--- /g/vanilla/v2.3.14/linux/include/asm-sparc64/io.h Sat May 15 14:12:10 1999
+++ linux/include/asm-sparc64/io.h Thu Aug 19 15:21:15 1999
@@ -109,6 +109,38 @@
: "r" (l), "r" (addr), "i" (ASI_PL));
}

+extern __inline__ unsigned long __raw_readb(unsigned long addr)
+{
+ return *(volatile unsigned char*)addr;
+}
+
+extern __inline__ unsigned long __raw_readw(unsigned long addr)
+{
+ return *(volatile unsigned short*)addr;
+}
+
+extern __inline__ unsigned long __raw_readl(unsigned long addr)
+{
+ return *(volatile unsigned long*)addr;
+}
+
+extern __inline__ void __raw_writeb(unsigned short b, unsigned long addr)
+{
+ *(volatile unsigned char*)addr = b;
+}
+
+extern __inline__ void __raw_writew(unsigned short b, unsigned long addr)
+{
+ *(volatile unsigned short*)addr = b;
+}
+
+extern __inline__ void __raw_writel(unsigned int b, unsigned long addr)
+{
+ *(volatile unsigned long*)addr = b;
+}
+
+
+
#define inb_p inb
#define outb_p outb
\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.042 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site