|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] xen: iommu: Define PAGE_{SHIFT, SIZE, ALIGN, MASK)_64K
commit 81bccf87465e0e7db0061c6c7aecfe0e0f5ef4c9
Author: Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Mon May 19 17:23:58 2014 +0100
Commit: Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed May 21 13:53:32 2014 +0100
xen: iommu: Define PAGE_{SHIFT, SIZE, ALIGN, MASK)_64K
Also add IOMMU_PAGE_* helper macros to help creating PAGE_* defines.
Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
xen/include/xen/iommu.h | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 2ec7834..8eb764a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -35,10 +35,19 @@ extern bool_t iommu_hap_pt_share;
extern bool_t iommu_debug;
extern bool_t amd_iommu_perdev_intremap;
+#define IOMMU_PAGE_SIZE(sz) (1UL << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_MASK(sz) (~(u64)0 << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_ALIGN(sz, addr) (((addr) + ~PAGE_MASK_##sz) &
PAGE_MASK_##sz)
+
#define PAGE_SHIFT_4K (12)
-#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K)
-#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K)
-#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
+#define PAGE_SIZE_4K IOMMU_PAGE_SIZE(4K)
+#define PAGE_MASK_4K IOMMU_PAGE_MASK(4K)
+#define PAGE_ALIGN_4K(addr) IOMMU_PAGE_ALIGN(4K, addr)
+
+#define PAGE_SHIFT_64K (16)
+#define PAGE_SIZE_64K IOMMU_PAGE_SIZE(64K)
+#define PAGE_MASK_64K IOMMU_PAGE_MASK(64K)
+#define PAGE_ALIGN_64K(addr) IOMMU_PAGE_ALIGN(64K, addr)
int iommu_setup(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |