linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: add generic ide iops
@ 2003-02-18 17:57 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2003-02-18 17:57 UTC (permalink / raw)
  To: torvalds, linux-kernel

This abstracts out the mmio copies as PPC at least has better ways to
this and there are other issues on other platforms. It keeps DaveM happy
too 8)

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.61/include/asm-generic/ide_iops.h linux-2.5.61-ac2/include/asm-generic/ide_iops.h
--- linux-2.5.61/include/asm-generic/ide_iops.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.61-ac2/include/asm-generic/ide_iops.h	2003-02-18 14:31:01.000000000 +0000
@@ -0,0 +1,38 @@
+/* Generic I/O and MEMIO string operations.  */
+
+#define __ide_insw	insw
+#define __ide_insl	insl
+#define __ide_outsw	outsw
+#define __ide_outsl	outsl
+
+static __inline__ void __ide_mm_insw(unsigned long port, void *addr, u32 count)
+{
+	while (count--) {
+		*(u16 *)addr = readw(port);
+		addr += 2;
+	}
+}
+
+static __inline__ void __ide_mm_insl(unsigned long port, void *addr, u32 count)
+{
+	while (count--) {
+		*(u32 *)addr = readl(port);
+		addr += 4;
+	}
+}
+
+static __inline__ void __ide_mm_outsw(unsigned long port, void *addr, u32 count)
+{
+	while (count--) {
+		writew(*(u16 *)addr, port);
+		addr += 2;
+	}
+}
+
+static __inline__ void __ide_mm_outsl(unsigned long port, void *addr, u32 count)
+{
+	while (count--) {
+		writel(*(u32 *)addr, port);
+		addr += 4;
+	}
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-18 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-18 17:57 PATCH: add generic ide iops Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).