Author: imp Date: Tue Mar 19 15:03:20 2019 New Revision: 345298 URL: https://svnweb.freebsd.org/changeset/base/345298
Log: Add comment about why we bother to use endian macros here, and why we must use bitfields. Modified: head/sys/dev/pci/pcivar.h Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Tue Mar 19 14:34:53 2019 (r345297) +++ head/sys/dev/pci/pcivar.h Tue Mar 19 15:03:20 2019 (r345298) @@ -259,6 +259,14 @@ typedef struct { extern uint32_t pci_numdevs; +/* + * The bitfield has to be stable an match the fields below (so that + * match_flag_vendor must be bit 0) so we have to do the endian + * dance. We can't use enums or #define constants because then the + * the macros for subsetting matches wouldn't work. These tables + * are parsed by devmatch and others to connect modules with + * devices on the PCI bus. + */ struct pci_device_table { #if BYTE_ORDER == LITTLE_ENDIAN uint16_t _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"