projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ringtest: commonize implementation of poll_avail/poll_used
[cascardo/linux.git]
/
tools
/
virtio
/
ringtest
/
main.c
diff --git
a/tools/virtio/ringtest/main.c
b/tools/virtio/ringtest/main.c
index
147abb4
..
b00ecd6
100644
(file)
--- a/
tools/virtio/ringtest/main.c
+++ b/
tools/virtio/ringtest/main.c
@@
-96,7
+96,13
@@
void set_affinity(const char *arg)
assert(!ret);
}
assert(!ret);
}
-static void run_guest(void)
+void poll_used(void)
+{
+ while (used_empty())
+ busy_wait();
+}
+
+static void __attribute__((__flatten__)) run_guest(void)
{
int completed_before;
int completed = 0;
{
int completed_before;
int completed = 0;
@@
-149,7
+155,13
@@
static void run_guest(void)
}
}
}
}
-static void run_host(void)
+void poll_avail(void)
+{
+ while (avail_empty())
+ busy_wait();
+}
+
+static void __attribute__((__flatten__)) run_host(void)
{
int completed_before;
int completed = 0;
{
int completed_before;
int completed = 0;