svn commit: r345298 - head/sys/dev/pci
Warner Losh
imp at FreeBSD.org
Tue Mar 19 15:03:21 UTC 2019
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
More information about the svn-src-head
mailing list