vserver 2.0 rc7
[linux-2.6.git] / drivers / infiniband / hw / mthca / mthca_doorbell.h
index cc8ad11..821039a 100644 (file)
 #define MTHCA_INIT_DOORBELL_LOCK(ptr)    do { } while (0)
 #define MTHCA_GET_DOORBELL_LOCK(ptr)      (NULL)
 
+static inline void mthca_write64_raw(__be64 val, void __iomem *dest)
+{
+       __raw_writeq((__force u64) val, dest);
+}
+
 static inline void mthca_write64(u32 val[2], void __iomem *dest,
                                 spinlock_t *doorbell_lock)
 {
        __raw_writeq(*(u64 *) val, dest);
 }
 
+static inline void mthca_write_db_rec(u32 val[2], u32 *db)
+{
+       *(u64 *) db = *(u64 *) val;
+}
+
 #else
 
 /*
@@ -69,6 +79,12 @@ static inline void mthca_write64(u32 val[2], void __iomem *dest,
 #define MTHCA_INIT_DOORBELL_LOCK(ptr)     spin_lock_init(ptr)
 #define MTHCA_GET_DOORBELL_LOCK(ptr)      (ptr)
 
+static inline void mthca_write64_raw(__be64 val, void __iomem *dest)
+{
+       __raw_writel(((__force u32 *) &val)[0], dest);
+       __raw_writel(((__force u32 *) &val)[1], dest + 4);
+}
+
 static inline void mthca_write64(u32 val[2], void __iomem *dest,
                                 spinlock_t *doorbell_lock)
 {
@@ -80,4 +96,11 @@ static inline void mthca_write64(u32 val[2], void __iomem *dest,
        spin_unlock_irqrestore(doorbell_lock, flags);
 }
 
+static inline void mthca_write_db_rec(u32 val[2], u32 *db)
+{
+       db[0] = val[0];
+       wmb();
+       db[1] = val[1];
+}
+
 #endif