-/* $OpenBSD: virtio.c,v 1.23 2023/07/07 10:23:39 patrick Exp $ */
+/* $OpenBSD: virtio.c,v 1.24 2023/12/02 10:01:35 sf Exp $ */
/* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */
/*
const struct virtio_feature_name *namep;
int i;
char c;
- uint32_t bit;
+ uint64_t bit;
for (i = 0; i < 64; i++) {
if (i == 30) {
*/
continue;
}
- bit = 1 << i;
+ bit = 1ULL << i;
if ((host&bit) == 0)
continue;
- namep = (i < 24 || i > 37) ? guest_feature_names :
- transport_feature_names;
+ namep = guest_feature_names;
while (namep->bit && namep->bit != bit)
namep++;
+ if (namep->name == NULL) {
+ namep = transport_feature_names;
+ while (namep->bit && namep->bit != bit)
+ namep++;
+ }
c = (neg&bit) ? '+' : '-';
if (namep->name)
printf(" %c%s", c, namep->name);
-/* $OpenBSD: virtiovar.h,v 1.15 2023/07/07 10:23:39 patrick Exp $ */
+/* $OpenBSD: virtiovar.h,v 1.16 2023/12/02 10:01:35 sf Exp $ */
/* $NetBSD: virtiovar.h,v 1.1 2011/10/30 12:12:21 hannken Exp $ */
/*
};
struct virtio_feature_name {
- uint32_t bit;
+ uint64_t bit;
const char *name;
};
#define virtio_device_reset(sc) virtio_set_status((sc), 0)
static inline int
-virtio_has_feature(struct virtio_softc *sc, unsigned int fbit)
+virtio_has_feature(struct virtio_softc *sc, uint64_t fbit)
{
if (sc->sc_active_features & fbit)
return 1;