summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2003-02-17 19:41:30 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2003-02-17 19:41:30 -0800
commit7d52ede74feb7c19819f34ee8205c9ed9951a3fc (patch)
tree1de033925fb020be1f764d306bd224ea4e042c81 /include
parente04b25796483d5a6786879a14072b4403ff6ffed (diff)
[PATCH] add generic ide iops
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)
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/ide_iops.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/asm-generic/ide_iops.h b/include/asm-generic/ide_iops.h
new file mode 100644
index 000000000000..8574de4bde41
--- /dev/null
+++ b/include/asm-generic/ide_iops.h
@@ -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;
+ }
+}