aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-02-11 19:51:15 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-02-11 19:51:15 +0000
commit8eddd7f405d7120aaf284c222e119588275bed3f (patch)
tree6b054958e44906610b2d02086ddd203f88b34a4e
parent01c8d49675ca3394aa56acdda2a1e50b36d00a74 (diff)
downloadxen-8eddd7f405d7120aaf284c222e119588275bed3f.tar.gz
xen-8eddd7f405d7120aaf284c222e119588275bed3f.tar.bz2
xen-8eddd7f405d7120aaf284c222e119588275bed3f.zip
VT-d: get rid of duplicated definition
free_pgtable_maddr was implemented the same for x86 and IA64, so it's not necessary to define it separately for x86 and IA64. This patch moves free_pgtable_maddr definition to iommu.c to avoid duplicated definition. Signed-off-by: Weidong Han <weidong.han@intel.com>
-rw-r--r--xen/drivers/passthrough/vtd/ia64/vtd.c6
-rw-r--r--xen/drivers/passthrough/vtd/iommu.c6
-rw-r--r--xen/drivers/passthrough/vtd/x86/vtd.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/xen/drivers/passthrough/vtd/ia64/vtd.c b/xen/drivers/passthrough/vtd/ia64/vtd.c
index 5158060457..7b740d2d84 100644
--- a/xen/drivers/passthrough/vtd/ia64/vtd.c
+++ b/xen/drivers/passthrough/vtd/ia64/vtd.c
@@ -46,12 +46,6 @@ void unmap_vtd_domain_page(void *va)
unmap_domain_page(va);
}
-void free_pgtable_maddr(u64 maddr)
-{
- if ( maddr != 0 )
- free_domheap_page(maddr_to_page(maddr));
-}
-
unsigned int get_cache_line_size(void)
{
return L1_CACHE_BYTES;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c03e9ce300..bf325a8d5f 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -193,6 +193,12 @@ u64 alloc_pgtable_maddr(struct acpi_drhd_unit *drhd, unsigned long npages)
return page_to_maddr(pg);
}
+void free_pgtable_maddr(u64 maddr)
+{
+ if ( maddr != 0 )
+ free_domheap_page(maddr_to_page(maddr));
+}
+
/* context entry handling */
static u64 bus_to_context_maddr(struct iommu *iommu, u8 bus)
{
diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c
index c5435b6f27..74e31ccb72 100644
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -44,12 +44,6 @@ void unmap_vtd_domain_page(void *va)
unmap_domain_page(va);
}
-void free_pgtable_maddr(u64 maddr)
-{
- if ( maddr != 0 )
- free_domheap_page(maddr_to_page(maddr));
-}
-
unsigned int get_cache_line_size(void)
{
return ((cpuid_ebx(1) >> 8) & 0xff) * 8;