diff options
author | Joerg Roedel <jroedel@suse.de> | 2019-02-07 06:59:14 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-03-06 11:19:06 -0500 |
commit | 492366f7b4237257ef50ca9c431a6a0d50225aca (patch) | |
tree | 7d867810eb10e65b5b5de8d1d569a89351127c7b /include/linux/swiotlb.h | |
parent | abe420bfae528c92bd8cc5ecb62dc95672b1fd6f (diff) |
swiotlb: Add is_swiotlb_active() function
This function will be used from dma_direct code to determine
the maximum segment size of a dma mapping.
Cc: stable@vger.kernel.org
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux/swiotlb.h')
-rw-r--r-- | include/linux/swiotlb.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index d3980aeed4a0..29bc3a203283 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -77,6 +77,7 @@ bool swiotlb_map(struct device *dev, phys_addr_t *phys, dma_addr_t *dma_addr, | |||
77 | void __init swiotlb_exit(void); | 77 | void __init swiotlb_exit(void); |
78 | unsigned int swiotlb_max_segment(void); | 78 | unsigned int swiotlb_max_segment(void); |
79 | size_t swiotlb_max_mapping_size(struct device *dev); | 79 | size_t swiotlb_max_mapping_size(struct device *dev); |
80 | bool is_swiotlb_active(void); | ||
80 | #else | 81 | #else |
81 | #define swiotlb_force SWIOTLB_NO_FORCE | 82 | #define swiotlb_force SWIOTLB_NO_FORCE |
82 | static inline bool is_swiotlb_buffer(phys_addr_t paddr) | 83 | static inline bool is_swiotlb_buffer(phys_addr_t paddr) |
@@ -100,6 +101,11 @@ static inline size_t swiotlb_max_mapping_size(struct device *dev) | |||
100 | { | 101 | { |
101 | return SIZE_MAX; | 102 | return SIZE_MAX; |
102 | } | 103 | } |
104 | |||
105 | static inline bool is_swiotlb_active(void) | ||
106 | { | ||
107 | return false; | ||
108 | } | ||
103 | #endif /* CONFIG_SWIOTLB */ | 109 | #endif /* CONFIG_SWIOTLB */ |
104 | 110 | ||
105 | extern void swiotlb_print_info(void); | 111 | extern void swiotlb_print_info(void); |