aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/swiotlb.h14
-rw-r--r--lib/swiotlb.c14
2 files changed, 15 insertions, 13 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index b8c5fc766a56..58b996a642f9 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -7,6 +7,20 @@ struct device;
7struct dma_attrs; 7struct dma_attrs;
8struct scatterlist; 8struct scatterlist;
9 9
10/*
11 * Maximum allowable number of contiguous slabs to map,
12 * must be a power of 2. What is the appropriate value ?
13 * The complexity of {map,unmap}_single is linearly dependent on this value.
14 */
15#define IO_TLB_SEGSIZE 128
16
17
18/*
19 * log of the size of each IO TLB slab. The number of slabs is command line
20 * controllable.
21 */
22#define IO_TLB_SHIFT 11
23
10extern void 24extern void
11swiotlb_init(void); 25swiotlb_init(void);
12 26
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index abecb2857556..db724ba7ebf6 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -23,6 +23,7 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/swiotlb.h> 24#include <linux/swiotlb.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/swiotlb.h>
26#include <linux/types.h> 27#include <linux/types.h>
27#include <linux/ctype.h> 28#include <linux/ctype.h>
28 29
@@ -40,19 +41,6 @@
40#define SG_ENT_VIRT_ADDRESS(sg) (sg_virt((sg))) 41#define SG_ENT_VIRT_ADDRESS(sg) (sg_virt((sg)))
41#define SG_ENT_PHYS_ADDRESS(sg) virt_to_bus(SG_ENT_VIRT_ADDRESS(sg)) 42#define SG_ENT_PHYS_ADDRESS(sg) virt_to_bus(SG_ENT_VIRT_ADDRESS(sg))
42 43
43/*
44 * Maximum allowable number of contiguous slabs to map,
45 * must be a power of 2. What is the appropriate value ?
46 * The complexity of {map,unmap}_single is linearly dependent on this value.
47 */
48#define IO_TLB_SEGSIZE 128
49
50/*
51 * log of the size of each IO TLB slab. The number of slabs is command line
52 * controllable.
53 */
54#define IO_TLB_SHIFT 11
55
56#define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT)) 44#define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT))
57 45
58/* 46/*