Module Name: src
Committed By: thorpej
Date: Thu Jun 24 23:48:08 UTC 2021
Modified Files:
src/sys/dev/pci: pcireg.h
Log Message:
>From the "Should have been done years ago" department, add some macros
describing the format of PCI Type 0 and Type 1 Configuration Cycle
addresses.
To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/pci/pcireg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.154 src/sys/dev/pci/pcireg.h:1.155
--- src/sys/dev/pci/pcireg.h:1.154 Sat May 15 13:00:45 2021
+++ src/sys/dev/pci/pcireg.h Thu Jun 24 23:48:08 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: pcireg.h,v 1.154 2021/05/15 13:00:45 jakllsch Exp $ */
+/* $NetBSD: pcireg.h,v 1.155 2021/06/24 23:48:08 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996, 1999, 2000
@@ -68,6 +68,21 @@ typedef u_int16_t pci_product_id_t;
(((pid) & PCI_PRODUCT_MASK) << PCI_PRODUCT_SHIFT)) \
/*
+ * Standard format of a PCI Type 0 Configuration Cycle address.
+ */
+#define PCI_CONF_TYPE0_IDSEL(d) __BIT((d) + 11)
+#define PCI_CONF_TYPE0_FUNCTION __BITS(8,10)
+#define PCI_CONF_TYPE0_OFFSET __BITS(0,7)
+
+/*
+ * Standard format of a PCI Type 1 Configuration Cycle address.
+ */
+#define PCI_CONF_TYPE1_BUS __BITS(16,23)
+#define PCI_CONF_TYPE1_DEVICE __BITS(11,15)
+#define PCI_CONF_TYPE1_FUNCTION __BITS(8,10)
+#define PCI_CONF_TYPE1_OFFSET __BITS(0,7)
+
+/*
* Command and status register.
*/
#define PCI_COMMAND_STATUS_REG 0x04