xref: /openbmc/linux/tools/virtio/ringtest/noring.c (revision d236d361)
1 #define _GNU_SOURCE
2 #include "main.h"
3 #include <assert.h>
4 
5 /* stub implementation: useful for measuring overhead */
6 void alloc_ring(void)
7 {
8 }
9 
10 /* guest side */
11 int add_inbuf(unsigned len, void *buf, void *datap)
12 {
13 	return 0;
14 }
15 
16 /*
17  * skb_array API provides no way for producer to find out whether a given
18  * buffer was consumed.  Our tests merely require that a successful get_buf
19  * implies that add_inbuf succeed in the past, and that add_inbuf will succeed,
20  * fake it accordingly.
21  */
22 void *get_buf(unsigned *lenp, void **bufp)
23 {
24 	return "Buffer";
25 }
26 
27 bool used_empty()
28 {
29 	return false;
30 }
31 
32 void disable_call()
33 {
34 	assert(0);
35 }
36 
37 bool enable_call()
38 {
39 	assert(0);
40 }
41 
42 void kick_available(void)
43 {
44 	assert(0);
45 }
46 
47 /* host side */
48 void disable_kick()
49 {
50 	assert(0);
51 }
52 
53 bool enable_kick()
54 {
55 	assert(0);
56 }
57 
58 bool avail_empty()
59 {
60 	return false;
61 }
62 
63 bool use_buf(unsigned *lenp, void **bufp)
64 {
65 	return true;
66 }
67 
68 void call_used(void)
69 {
70 	assert(0);
71 }
72