aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2018-03-19 20:41:04 -0400
committerMichael S. Tsirkin <mst@redhat.com>2018-03-19 21:17:37 -0400
commitc8f06a066816b17f3d1c07da9a5c4f387871c590 (patch)
tree623b5daf1714ce97fba9871f4645f0b19d95367e /tools
parent0c8efd610b58cb23cefdfa12015799079aef94ae (diff)
ptr_ring: fix build
Fixes after recent use of kvmalloc Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtio/ringtest/ptr_ring.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/virtio/ringtest/ptr_ring.c b/tools/virtio/ringtest/ptr_ring.c
index 477899c12c51..2d566fbd236b 100644
--- a/tools/virtio/ringtest/ptr_ring.c
+++ b/tools/virtio/ringtest/ptr_ring.c
@@ -17,6 +17,8 @@
17#define likely(x) (__builtin_expect(!!(x), 1)) 17#define likely(x) (__builtin_expect(!!(x), 1))
18#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a)) 18#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a))
19#define SIZE_MAX (~(size_t)0) 19#define SIZE_MAX (~(size_t)0)
20#define KMALLOC_MAX_SIZE SIZE_MAX
21#define BUG_ON(x) assert(x)
20 22
21typedef pthread_spinlock_t spinlock_t; 23typedef pthread_spinlock_t spinlock_t;
22 24
@@ -57,6 +59,9 @@ static void kfree(void *p)
57 free(p); 59 free(p);
58} 60}
59 61
62#define kvmalloc_array kmalloc_array
63#define kvfree kfree
64
60static void spin_lock_init(spinlock_t *lock) 65static void spin_lock_init(spinlock_t *lock)
61{ 66{
62 int r = pthread_spin_init(lock, 0); 67 int r = pthread_spin_init(lock, 0);