[SeaBIOS] [PATCH 05/18] virtio: add version 1.0 structs and #defines

Gerd Hoffmann kraxel at redhat.com
Mon Jun 29 15:35:59 CEST 2015


> > +typedef struct virtio_pci_common_cfg {
> > +    /* About the whole device. */
> > +    u32 device_feature_select;   /* read-write */
> If I understand these structs correctly, they don't reside in memory,
> but instead represent an interface layout and are used with offsetof()
> and sizeof().


> If so, I think they should be marked with PACKED.

They are carefully ordered and padded so that adding PACKED should not
change anything.  The linux kernel has them without PACKED too.

> BTW, it would be nice (but certainly not required) to move these types
> of interface definitions to a new virtio header in the std/ directory.

Can do that.


More information about the SeaBIOS mailing list