Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci From the "Should have been done years ago" depar...



details:   https://anonhg.NetBSD.org/src/rev/018e13fdd4ae
branches:  trunk
changeset: 379882:018e13fdd4ae
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jun 24 23:48:08 2021 +0000

description:
>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.

diffstat:

 sys/dev/pci/pcireg.h |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r b8588f6de039 -r 018e13fdd4ae sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Thu Jun 24 23:22:17 2021 +0000
+++ b/sys/dev/pci/pcireg.h      Thu Jun 24 23:48:08 2021 +0000
@@ -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



Home | Main Index | Thread Index | Old Index