diff mbox

[4/4] Hack around IOMMU changes

Message ID 4BFC9765.6070200@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zachary Amsden May 26, 2010, 3:37 a.m. UTC
None
diff mbox

Patch

diff --git a/external-module-compat-comm.h b/external-module-compat-comm.h
index c5284e5..708019e 100644
--- a/external-module-compat-comm.h
+++ b/external-module-compat-comm.h
@@ -1128,3 +1128,15 @@  perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 #define lockdep_is_held(m)		(1)
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+/* This is a dirty, nasty trick */
+#define iommu_map(domain, iova, paddr, gfp_order, prot) \
+({ \
+	int _r = iommu_map_range(domain, iova, paddr, PAGE_SIZE, prot); \
+	page_size = PAGE_SIZE; \
+	_r; \
+})
+#define iommu_unmap(domain, iova, gfp_order) \
+	(iommu_unmap_range(domain, iova, PAGE_SIZE),1)
+#endif