summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ehca/ehca_iverbs.h
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@de.ibm.com>2006-11-07 00:56:39 +0100
committerRoland Dreier <rolandd@cisco.com>2006-11-09 12:41:57 -0800
commit7e28db5d8ff63b1cabc221c5cb84a5f45752f1c2 (patch)
tree4271d9afb545ab7e522a3a6e95c67a171f29cf84 /drivers/infiniband/hw/ehca/ehca_iverbs.h
parent40eb006685387b2861bd7196be0ab7144c5d5b71 (diff)
IB/ehca: Assure 4K alignment for firmware control blocks
Assure 4K alignment for firmware control blocks in 64K page mode, because kzalloc()'s result address might not be 4K aligned if 64K pages are enabled. Thus, we introduce wrappers called ehca_{alloc,free}_fw_ctrlblock(), which use a slab cache for objects with 4K length and 4K alignment in order to alloc/free firmware control blocks in 64K page mode. In 4K page mode those wrappers just are defines of get_zeroed_page() and free_page(). Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ehca/ehca_iverbs.h')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_iverbs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/infiniband/hw/ehca/ehca_iverbs.h
index 319c39d47f3..3720e3032cc 100644
--- a/drivers/infiniband/hw/ehca/ehca_iverbs.h
+++ b/drivers/infiniband/hw/ehca/ehca_iverbs.h
@@ -179,4 +179,12 @@ int ehca_mmap_register(u64 physical,void **mapped,
int ehca_munmap(unsigned long addr, size_t len);
+#ifdef CONFIG_PPC_64K_PAGES
+void *ehca_alloc_fw_ctrlblock(void);
+void ehca_free_fw_ctrlblock(void *ptr);
+#else
+#define ehca_alloc_fw_ctrlblock() ((void *) get_zeroed_page(GFP_KERNEL))
+#define ehca_free_fw_ctrlblock(ptr) free_page((unsigned long)(ptr))
+#endif
+
#endif