From: "Michael S. Tsirkin" <mst@redhat.com>
To: linux-kernel@vger.kernel.org,
Rusty Russell <rusty@rustcorp.com.au>,
virtualization@lists.linux-foundation.org
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
David Hildenbrand <dahi@linux.vnet.ibm.com>,
Joel Stanley <joel@jms.id.au>,
virtualization@lists.linux-foundation.org
Subject: [PATCH 1/6] tools/virtio: more stubs
Date: Mon, 15 Dec 2014 00:04:17 +0200 [thread overview]
Message-ID: <1418594542-22623-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1418594542-22623-1-git-send-email-mst@redhat.com>
As usual, add more stubs to fix test build after main
codebase changes.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tools/virtio/linux/virtio.h | 1 +
tools/virtio/linux/virtio_byteorder.h | 8 ++++++++
tools/virtio/linux/virtio_config.h | 25 +++++++++++++++++++++++--
tools/virtio/uapi/linux/virtio_types.h | 1 +
4 files changed, 33 insertions(+), 2 deletions(-)
create mode 100644 tools/virtio/linux/virtio_byteorder.h
create mode 100644 tools/virtio/uapi/linux/virtio_types.h
diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index 8eb6421..a3e0701 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -6,6 +6,7 @@
/* TODO: empty stubs for now. Broken but enough for virtio_ring.c */
#define list_add_tail(a, b) do {} while (0)
#define list_del(a) do {} while (0)
+#define list_for_each_entry(a, b, c) while (0)
/* end of stubs */
struct virtio_device {
diff --git a/tools/virtio/linux/virtio_byteorder.h b/tools/virtio/linux/virtio_byteorder.h
new file mode 100644
index 0000000..9de9e6a
--- /dev/null
+++ b/tools/virtio/linux/virtio_byteorder.h
@@ -0,0 +1,8 @@
+#ifndef _LINUX_VIRTIO_BYTEORDER_STUB_H
+#define _LINUX_VIRTIO_BYTEORDER_STUB_H
+
+#include <asm/byteorder.h>
+#include "../../include/linux/byteorder/generic.h"
+#include "../../include/linux/virtio_byteorder.h"
+
+#endif
diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio_config.h
index dafe1c9..806d683 100644
--- a/tools/virtio/linux/virtio_config.h
+++ b/tools/virtio/linux/virtio_config.h
@@ -1,8 +1,7 @@
#include <linux/virtio_byteorder.h>
#include <linux/virtio.h>
+#include <uapi/linux/virtio_config.h>
-#define VIRTIO_TRANSPORT_F_START 28
-#define VIRTIO_TRANSPORT_F_END 32
/*
* __virtio_test_bit - helper to test feature bits. For use by transports.
* Devices should normally use virtio_has_feature,
@@ -16,6 +15,28 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev,
return vdev->features & (1ULL << fbit);
}
+/**
+ * __virtio_set_bit - helper to set feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_set_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ vdev->features |= (1ULL << fbit);
+}
+
+/**
+ * __virtio_clear_bit - helper to clear feature bits. For use by transports.
+ * @vdev: the device
+ * @fbit: the feature bit
+ */
+static inline void __virtio_clear_bit(struct virtio_device *vdev,
+ unsigned int fbit)
+{
+ vdev->features &= ~(1ULL << fbit);
+}
+
#define virtio_has_feature(dev, feature) \
(__virtio_test_bit((dev), feature))
diff --git a/tools/virtio/uapi/linux/virtio_types.h b/tools/virtio/uapi/linux/virtio_types.h
new file mode 100644
index 0000000..e7a1096
--- /dev/null
+++ b/tools/virtio/uapi/linux/virtio_types.h
@@ -0,0 +1 @@
+#include "../../include/uapi/linux/virtio_types.h"
--
MST
next prev parent reply other threads:[~2014-12-14 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 22:04 [PATCH 0/6] virtio 1.0: tools update Michael S. Tsirkin
2014-12-14 22:04 ` Michael S. Tsirkin [this message]
2014-12-19 1:28 ` [PATCH 1/6] tools/virtio: more stubs Rusty Russell
2014-12-14 22:04 ` [PATCH 2/6] tools/virtio: fix vringh test Michael S. Tsirkin
2014-12-14 22:04 ` [PATCH 3/6] tools/virtio: 64 bit features Michael S. Tsirkin
2014-12-14 22:04 ` [PATCH 4/6] tools/virtio: enable -Werror Michael S. Tsirkin
2014-12-14 22:04 ` [PATCH 5/6] tools/virtio: add virtio 1.0 in virtio_test Michael S. Tsirkin
2014-12-14 22:04 ` [PATCH 6/6] tools/virtio: add virtio 1.0 in vringh_test Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418594542-22623-2-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®