Skip to content

Commit e07744b

Browse files
Liming Wumstsirkin
authored andcommitted
tools/virtio: Add dma sync api for virtio test
Fixes: 8bd2f71 ("virtio_ring: introduce dma sync api for virtqueue") also add dma sync api for virtio test. Signed-off-by: Liming Wu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 5872080 commit e07744b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/virtio/linux/dma-mapping.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,23 @@ enum dma_data_direction {
2424
#define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o))
2525

2626
#define dma_map_single(d, p, s, dir) (virt_to_phys(p))
27+
#define dma_map_single_attrs(d, p, s, dir, a) (virt_to_phys(p))
2728
#define dma_mapping_error(...) (0)
2829

2930
#define dma_unmap_single(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
3031
#define dma_unmap_page(d, a, s, r) do { (void)(d); (void)(a); (void)(s); (void)(r); } while (0)
3132

33+
#define sg_dma_address(sg) (0)
34+
#define dma_need_sync(v, a) (0)
35+
#define dma_unmap_single_attrs(d, a, s, r, t) do { \
36+
(void)(d); (void)(a); (void)(s); (void)(r); (void)(t); \
37+
} while (0)
38+
#define dma_sync_single_range_for_cpu(d, a, o, s, r) do { \
39+
(void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \
40+
} while (0)
41+
#define dma_sync_single_range_for_device(d, a, o, s, r) do { \
42+
(void)(d); (void)(a); (void)(o); (void)(s); (void)(r); \
43+
} while (0)
3244
#define dma_max_mapping_size(...) SIZE_MAX
3345

3446
#endif

0 commit comments

Comments
 (0)