projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into upstream
[powerpc.git]
/
drivers
/
infiniband
/
hw
/
mthca
/
mthca_memfree.h
diff --git
a/drivers/infiniband/hw/mthca/mthca_memfree.h
b/drivers/infiniband/hw/mthca/mthca_memfree.h
index
4fdca26
..
6d42947
100644
(file)
--- a/
drivers/infiniband/hw/mthca/mthca_memfree.h
+++ b/
drivers/infiniband/hw/mthca/mthca_memfree.h
@@
-39,13
+39,18
@@
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/list.h>
#include <linux/pci.h>
-
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
#define MTHCA_ICM_CHUNK_LEN \
((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \
(sizeof (struct scatterlist)))
#define MTHCA_ICM_CHUNK_LEN \
((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \
(sizeof (struct scatterlist)))
+enum {
+ MTHCA_ICM_PAGE_SHIFT = 12,
+ MTHCA_ICM_PAGE_SIZE = 1 << MTHCA_ICM_PAGE_SHIFT,
+ MTHCA_DB_REC_PER_PAGE = MTHCA_ICM_PAGE_SIZE / 8
+};
+
struct mthca_icm_chunk {
struct list_head list;
int npages;
struct mthca_icm_chunk {
struct list_head list;
int npages;
@@
-64,7
+69,7
@@
struct mthca_icm_table {
int num_obj;
int obj_size;
int lowmem;
int num_obj;
int obj_size;
int lowmem;
- struct
semaphore
mutex;
+ struct
mutex
mutex;
struct mthca_icm *icm[0];
};
struct mthca_icm *icm[0];
};
@@
-132,10
+137,6
@@
static inline unsigned long mthca_icm_size(struct mthca_icm_iter *iter)
return sg_dma_len(&iter->chunk->mem[iter->page_idx]);
}
return sg_dma_len(&iter->chunk->mem[iter->page_idx]);
}
-enum {
- MTHCA_DB_REC_PER_PAGE = 4096 / 8
-};
-
struct mthca_db_page {
DECLARE_BITMAP(used, MTHCA_DB_REC_PER_PAGE);
__be64 *db_rec;
struct mthca_db_page {
DECLARE_BITMAP(used, MTHCA_DB_REC_PER_PAGE);
__be64 *db_rec;
@@
-147,7
+148,7
@@
struct mthca_db_table {
int max_group1;
int min_group2;
struct mthca_db_page *page;
int max_group1;
int min_group2;
struct mthca_db_page *page;
- struct
semaphore
mutex;
+ struct
mutex
mutex;
};
enum mthca_db_type {
};
enum mthca_db_type {