fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / asm-sparc64 / ide.h
index f850b61..55149cf 100644 (file)
 
 #ifdef __KERNEL__
 
-#include <linux/config.h>
 #include <asm/pgalloc.h>
 #include <asm/io.h>
-#include <asm/page.h>
 #include <asm/spitfire.h>
+#include <asm/cacheflush.h>
+#include <asm/page.h>
 
 #ifndef MAX_HWIFS
 # ifdef CONFIG_BLK_DEV_IDEPCI
@@ -38,7 +38,7 @@
 #define __ide_mm_outsw __ide_outsw
 #define __ide_mm_outsl __ide_outsl
 
-static __inline__ unsigned int inw_be(unsigned long addr)
+static inline unsigned int inw_be(void __iomem *addr)
 {
        unsigned int ret;
 
@@ -49,11 +49,9 @@ static __inline__ unsigned int inw_be(unsigned long addr)
        return ret;
 }
 
-static __inline__ void __ide_insw(unsigned long port,
-                                 void *dst,
-                                 u32 count)
+static inline void __ide_insw(void __iomem *port, void *dst, u32 count)
 {
-#if (L1DCACHE_SIZE > PAGE_SIZE)                /* is there D$ aliasing problem */
+#ifdef DCACHE_ALIASING_POSSIBLE
        unsigned long end = (unsigned long)dst + (count << 1);
 #endif
        u16 *ps = dst;
@@ -76,23 +74,21 @@ static __inline__ void __ide_insw(unsigned long port,
        if(count)
                *ps++ = inw_be(port);
 
-#if (L1DCACHE_SIZE > PAGE_SIZE)                /* is there D$ aliasing problem */
+#ifdef DCACHE_ALIASING_POSSIBLE
        __flush_dcache_range((unsigned long)dst, end);
 #endif
 }
 
-static __inline__ void outw_be(unsigned short w, unsigned long addr)
+static inline void outw_be(unsigned short w, void __iomem *addr)
 {
        __asm__ __volatile__("stha %0, [%1] %2"
                             : /* no outputs */
                             : "r" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-static __inline__ void __ide_outsw(unsigned long port,
-                                  void *src,
-                                  u32 count)
+static inline void __ide_outsw(void __iomem *port, void *src, u32 count)
 {
-#if (L1DCACHE_SIZE > PAGE_SIZE)                /* is there D$ aliasing problem */
+#ifdef DCACHE_ALIASING_POSSIBLE
        unsigned long end = (unsigned long)src + (count << 1);
 #endif
        const u16 *ps = src;
@@ -115,7 +111,7 @@ static __inline__ void __ide_outsw(unsigned long port,
        if(count)
                outw_be(*ps, port);
 
-#if (L1DCACHE_SIZE > PAGE_SIZE)                /* is there D$ aliasing problem */
+#ifdef DCACHE_ALIASING_POSSIBLE
        __flush_dcache_range((unsigned long)src, end);
 #endif
 }