From: Michael S. Tsirkin Date: Sat, 16 Apr 2005 22:26:27 +0000 (-0700) Subject: [PATCH] IB/mthca: add mthca_write64_raw() for writing to MTT table directly X-Git-Tag: v2.6.12-rc3~65 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef416a33acbd2d68a58ea1ffdc13c674e53bc78f;p=linux-2.6 [PATCH] IB/mthca: add mthca_write64_raw() for writing to MTT table directly Add mthca_write64_raw() function, which will be used to write FMR entries that are in ioremapped PCI memory. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/hw/mthca/mthca_doorbell.h b/drivers/infiniband/hw/mthca/mthca_doorbell.h index 78b183cab5..821039a490 100644 --- a/drivers/infiniband/hw/mthca/mthca_doorbell.h +++ b/drivers/infiniband/hw/mthca/mthca_doorbell.h @@ -51,6 +51,11 @@ #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) { @@ -74,6 +79,12 @@ static inline void mthca_write_db_rec(u32 val[2], u32 *db) #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) {