Author: br
Date: Fri Jan 24 16:08:06 2020
New Revision: 357083
URL: https://svnweb.freebsd.org/changeset/base/357083

Log:
  Move the ECAM macroses to the header file.
  
  These will be used by other PCI root complex drivers.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/pci/pci_host_generic.c
  head/sys/dev/pci/pci_host_generic.h

Modified: head/sys/dev/pci/pci_host_generic.c
==============================================================================
--- head/sys/dev/pci/pci_host_generic.c Fri Jan 24 15:29:33 2020        
(r357082)
+++ head/sys/dev/pci/pci_host_generic.c Fri Jan 24 16:08:06 2020        
(r357083)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Ruslan Bukin <b...@bsdpad.com>
+ * Copyright (c) 2015, 2020 Ruslan Bukin <b...@bsdpad.com>
  * Copyright (c) 2014 The FreeBSD Foundation
  * All rights reserved.
  *
@@ -53,21 +53,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/intr.h>
 
 #include "pcib_if.h"
-
-/* Assembling ECAM Configuration Address */
-#define        PCIE_BUS_SHIFT          20
-#define        PCIE_SLOT_SHIFT         15
-#define        PCIE_FUNC_SHIFT         12
-#define        PCIE_BUS_MASK           0xFF
-#define        PCIE_SLOT_MASK          0x1F
-#define        PCIE_FUNC_MASK          0x07
-#define        PCIE_REG_MASK           0xFFF
-
-#define        PCIE_ADDR_OFFSET(bus, slot, func, reg)                  \
-       ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT)    |       \
-       (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT)  |       \
-       (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT)  |       \
-       ((reg) & PCIE_REG_MASK))
 
 /* Forward prototypes */
 

Modified: head/sys/dev/pci/pci_host_generic.h
==============================================================================
--- head/sys/dev/pci/pci_host_generic.h Fri Jan 24 15:29:33 2020        
(r357082)
+++ head/sys/dev/pci/pci_host_generic.h Fri Jan 24 16:08:06 2020        
(r357083)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Ruslan Bukin <b...@bsdpad.com>
+ * Copyright (c) 2015, 2020 Ruslan Bukin <b...@bsdpad.com>
  * Copyright (c) 2015 The FreeBSD Foundation
  * All rights reserved.
  *
@@ -35,6 +35,21 @@
 #define        __PCI_HOST_GENERIC_H_
 
 #include "pci_if.h"
+
+/* Assembling ECAM Configuration Address */
+#define        PCIE_BUS_SHIFT          20
+#define        PCIE_SLOT_SHIFT         15
+#define        PCIE_FUNC_SHIFT         12
+#define        PCIE_BUS_MASK           0xFF
+#define        PCIE_SLOT_MASK          0x1F
+#define        PCIE_FUNC_MASK          0x07
+#define        PCIE_REG_MASK           0xFFF
+
+#define        PCIE_ADDR_OFFSET(bus, slot, func, reg)                  \
+       ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT)    |       \
+       (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT)  |       \
+       (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT)  |       \
+       ((reg) & PCIE_REG_MASK))
 
 #define        MAX_RANGES_TUPLES       16
 #define        MIN_RANGES_TUPLES       2
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to