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/3f61d89f385f
branches:  trunk
changeset: 1021913:3f61d89f385f
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 07c1c50c594b -r 3f61d89f385f 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 @@
         (((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