Skip to content

Commit

Permalink
[PATCH] IB/mthca: add mthca_write64_raw() for writing to MTT table di…
Browse files Browse the repository at this point in the history
…rectly

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 <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Michael S. Tsirkin authored and Linus Torvalds committed Apr 16, 2005
1 parent 9095e20 commit ef416a3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/infiniband/hw/mthca/mthca_doorbell.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down

0 comments on commit ef416a3

Please sign in to comment.