summaryrefslogtreecommitdiff
path: root/sys/dev/pv/virtio.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2019-03-24 18:21:13 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2019-03-24 18:21:13 +0000
commit3a694342e6b1a22d33c6e05c443fc6bb5c81c686 (patch)
tree416bd5f07024c473f59d51ebaa5e884b19c1025a /sys/dev/pv/virtio.c
parentc372793d0df7d5ba3134e978e10ef5eb40f81925 (diff)
virtio: Prepare for 64 feature bits
virtio 1.0 supports an arbitrary number of feature bits. However, so far no more than 64 are used (compared to 32 in virtio 0.9). Adjust data types to support 64 feature bits. Later, we may want to use bitmaps and setbit(), ... to support even more feature bits. ok mlarkin@
Diffstat (limited to 'sys/dev/pv/virtio.c')
-rw-r--r--sys/dev/pv/virtio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/pv/virtio.c b/sys/dev/pv/virtio.c
index 242789d0c70..27bca1a5506 100644
--- a/sys/dev/pv/virtio.c
+++ b/sys/dev/pv/virtio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtio.c,v 1.14 2019/03/24 18:17:24 sf Exp $ */
+/* $OpenBSD: virtio.c,v 1.15 2019/03/24 18:21:12 sf Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
@@ -84,7 +84,7 @@ static const struct virtio_feature_name transport_feature_names[] = {
};
void
-virtio_log_features(uint32_t host, uint32_t neg,
+virtio_log_features(uint64_t host, uint64_t neg,
const struct virtio_feature_name *guest_feature_names)
{
const struct virtio_feature_name *namep;
@@ -92,7 +92,7 @@ virtio_log_features(uint32_t host, uint32_t neg,
char c;
uint32_t bit;
- for (i = 0; i < 32; i++) {
+ for (i = 0; i < 64; i++) {
if (i == 30) {
/*
* VIRTIO_F_BAD_FEATURE is only used for
@@ -103,7 +103,7 @@ virtio_log_features(uint32_t host, uint32_t neg,
bit = 1 << i;
if ((host&bit) == 0)
continue;
- namep = (i < 24) ? guest_feature_names :
+ namep = (i < 24 || i > 37) ? guest_feature_names :
transport_feature_names;
while (namep->bit && namep->bit != bit)
namep++;