From: Konrad Rzeszutek Wilk Subject: [PATCH 13/15] [swiotlb] Make io_tlb_nslabs visible outside lib/swiotlb.c and rename it. Date: Thu, 14 Jan 2010 18:01:02 -0500 Message-ID: <1263510064-16788-14-git-send-email-konrad.wilk@oracle.com> References: <1263510064-16788-1-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-2-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-3-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-4-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-5-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-6-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-7-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-8-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-9-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-10-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-11-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-12-git-send-email-konrad.wilk@oracle.com> <1263510064-16788-13-git-send-email-konrad.wilk@oracle.com> Return-path: In-Reply-To: <1263510064-16788-13-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: fujita.tomonori@lab.ntt.co.jp, alex.williamson@hp.com, joerg.roedel@amd.com, dwmw2@infradead.org, chrisw@sous-sol.org, iommu@lists.linux-foundation.org Cc: Ian.Campbell@eu.citrix.com, jeremy@goop.org, xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org We rename it to something more generic: swiotlb_nslabs and make it visible outside the lib/swiotlb.c library. Signed-off-by: Konrad Rzeszutek Wilk --- include/linux/swiotlb.h | 1 + lib/swiotlb.c | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 3bc3c42..23739b0 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -9,6 +9,7 @@ struct scatterlist; extern int swiotlb_force; +extern unsigned long swiotlb_nslabs; /* * Maximum allowable number of contiguous slabs to map, * must be a power of 2. What is the appropriate value ? diff --git a/lib/swiotlb.c b/lib/swiotlb.c index c11dcb1..8e65cee 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -63,7 +63,7 @@ int swiotlb_force; * The number of IO TLB blocks (in groups of 64) betweeen io_tlb_start and * io_tlb_end. This is command line adjustable via setup_io_tlb_npages. */ -static unsigned long io_tlb_nslabs; +unsigned long swiotlb_nslabs; /* * Protect the iommu_sw data structures in the map and unmap calls @@ -81,9 +81,9 @@ setup_io_tlb_npages(char *str) { while (*str) { if (isdigit(*str)) { - io_tlb_nslabs = simple_strtoul(str, &str, 0); + swiotlb_nslabs = simple_strtoul(str, &str, 0); /* avoid tail segment of size < IO_TLB_SEGSIZE */ - io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE); + swiotlb_nslabs = ALIGN(swiotlb_nslabs, IO_TLB_SEGSIZE); } if (!strncmp(str, "force", 5)) swiotlb_force = 1; @@ -174,11 +174,11 @@ swiotlb_init_with_default_size(size_t default_size, int verbose) { unsigned long i, bytes; - if (!io_tlb_nslabs) { + if (!swiotlb_nslabs) { iommu_sw->nslabs = (default_size >> IO_TLB_SHIFT); iommu_sw->nslabs = ALIGN(iommu_sw->nslabs, IO_TLB_SEGSIZE); } else - iommu_sw->nslabs = io_tlb_nslabs; + iommu_sw->nslabs = swiotlb_nslabs; bytes = iommu_sw->nslabs << IO_TLB_SHIFT; @@ -263,11 +263,11 @@ swiotlb_late_init_with_default_size(size_t default_size) unsigned long i, bytes, req_nslabs = iommu_sw->nslabs; unsigned int order; - if (!io_tlb_nslabs) { + if (!swiotlb_nslabs) { iommu_sw->nslabs = (default_size >> IO_TLB_SHIFT); iommu_sw->nslabs = ALIGN(iommu_sw->nslabs, IO_TLB_SEGSIZE); } else - iommu_sw->nslabs = io_tlb_nslabs; + iommu_sw->nslabs = swiotlb_nslabs; /* * Get IO TLB memory from the low pages -- 1.6.2.5