summaryrefslogtreecommitdiff
path: root/tools/virtio
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2018-03-20 02:41:04 +0200
committerMichael S. Tsirkin <mst@redhat.com>2018-03-20 03:17:37 +0200
commitc8f06a066816b17f3d1c07da9a5c4f387871c590 (patch)
tree623b5daf1714ce97fba9871f4645f0b19d95367e /tools/virtio
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/virtio')
-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 @@
#define likely(x) (__builtin_expect(!!(x), 1))
#define ALIGN(x, a) (((x) + (a) - 1) / (a) * (a))
#define SIZE_MAX (~(size_t)0)
+#define KMALLOC_MAX_SIZE SIZE_MAX
+#define BUG_ON(x) assert(x)
typedef pthread_spinlock_t spinlock_t;
@@ -57,6 +59,9 @@ static void kfree(void *p)
free(p);
}
+#define kvmalloc_array kmalloc_array
+#define kvfree kfree
+
static void spin_lock_init(spinlock_t *lock)
{
int r = pthread_spin_init(lock, 0);