debuggers.hg

changeset 20974:9a9ea52c3680

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 11 19:51:15 2010 +0000 (2010-02-11)
parents b882c558d4e4
children bd0d6ec8caaa
files xen/drivers/passthrough/vtd/ia64/vtd.c xen/drivers/passthrough/vtd/iommu.c xen/drivers/passthrough/vtd/x86/vtd.c
line diff
     1.1 --- a/xen/drivers/passthrough/vtd/ia64/vtd.c	Thu Feb 11 19:50:42 2010 +0000
     1.2 +++ b/xen/drivers/passthrough/vtd/ia64/vtd.c	Thu Feb 11 19:51:15 2010 +0000
     1.3 @@ -46,12 +46,6 @@ void unmap_vtd_domain_page(void *va)
     1.4      unmap_domain_page(va);
     1.5  }
     1.6  
     1.7 -void free_pgtable_maddr(u64 maddr)
     1.8 -{
     1.9 -    if ( maddr != 0 )
    1.10 -        free_domheap_page(maddr_to_page(maddr));
    1.11 -}
    1.12 -
    1.13  unsigned int get_cache_line_size(void)
    1.14  {
    1.15      return L1_CACHE_BYTES;
     2.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Thu Feb 11 19:50:42 2010 +0000
     2.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Thu Feb 11 19:51:15 2010 +0000
     2.3 @@ -193,6 +193,12 @@ u64 alloc_pgtable_maddr(struct acpi_drhd
     2.4      return page_to_maddr(pg);
     2.5  }
     2.6  
     2.7 +void free_pgtable_maddr(u64 maddr)
     2.8 +{
     2.9 +    if ( maddr != 0 )
    2.10 +        free_domheap_page(maddr_to_page(maddr));
    2.11 +}
    2.12 +
    2.13  /* context entry handling */
    2.14  static u64 bus_to_context_maddr(struct iommu *iommu, u8 bus)
    2.15  {
     3.1 --- a/xen/drivers/passthrough/vtd/x86/vtd.c	Thu Feb 11 19:50:42 2010 +0000
     3.2 +++ b/xen/drivers/passthrough/vtd/x86/vtd.c	Thu Feb 11 19:51:15 2010 +0000
     3.3 @@ -44,12 +44,6 @@ void unmap_vtd_domain_page(void *va)
     3.4      unmap_domain_page(va);
     3.5  }
     3.6  
     3.7 -void free_pgtable_maddr(u64 maddr)
     3.8 -{
     3.9 -    if ( maddr != 0 )
    3.10 -        free_domheap_page(maddr_to_page(maddr));
    3.11 -}
    3.12 -
    3.13  unsigned int get_cache_line_size(void)
    3.14  {
    3.15      return ((cpuid_ebx(1) >> 8) & 0xff) * 8;