WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 13/15] [swiotlb] Make io_tlb_nslabs visible outside l

To: fujita.tomonori@xxxxxxxxxxxxx, alex.williamson@xxxxxx, joerg.roedel@xxxxxxx, dwmw2@xxxxxxxxxxxxx, chrisw@xxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 13/15] [swiotlb] Make io_tlb_nslabs visible outside lib/swiotlb.c and rename it.
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Thu, 14 Jan 2010 18:01:02 -0500
Cc: Ian.Campbell@xxxxxxxxxxxxx, jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 14 Jan 2010 15:17:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1263510064-16788-13-git-send-email-konrad.wilk@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1263510064-16788-1-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-2-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-3-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-4-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-5-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-6-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-7-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-8-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-9-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-10-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-11-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-12-git-send-email-konrad.wilk@xxxxxxxxxx> <1263510064-16788-13-git-send-email-konrad.wilk@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 <konrad.wilk@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>