Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/include/linux linux: PCI_BUS_NUM; twea...
details: https://anonhg.NetBSD.org/src/rev/8a8ea5f04c3d
branches: trunk
changeset: 1028857:8a8ea5f04c3d
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 12:13:16 2021 +0000
description:
linux: PCI_BUS_NUM; tweak types for PCI_SLOT/PCI_FUNC.
diffstat:
sys/external/bsd/drm2/include/linux/pci.h | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diffs (24 lines):
diff -r e286c401b79a -r 8a8ea5f04c3d sys/external/bsd/drm2/include/linux/pci.h
--- a/sys/external/bsd/drm2/include/linux/pci.h Sun Dec 19 12:13:08 2021 +0000
+++ b/sys/external/bsd/drm2/include/linux/pci.h Sun Dec 19 12:13:16 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.h,v 1.50 2021/12/19 12:00:16 riastradh Exp $ */
+/* $NetBSD: pci.h,v 1.51 2021/12/19 12:13:16 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -119,8 +119,12 @@
#define PCI_DEVFN(DEV, FN) \
(__SHIFTIN((DEV), __BITS(3, 7)) | __SHIFTIN((FN), __BITS(0, 2)))
-#define PCI_SLOT(DEVFN) __SHIFTOUT((DEVFN), __BITS(3, 7))
-#define PCI_FUNC(DEVFN) __SHIFTOUT((DEVFN), __BITS(0, 2))
+#define PCI_SLOT(DEVFN) ((int)__SHIFTOUT((DEVFN), __BITS(3, 7)))
+#define PCI_FUNC(DEVFN) ((int)__SHIFTOUT((DEVFN), __BITS(0, 2)))
+
+#define PCI_DEVID(BUS, DEVFN) \
+ (__SHIFTIN((BUS), __BITS(15, 8)) | __SHIFTIN((DEVFN), __BITS(7, 0)))
+#define PCI_BUS_NUM(DEVID) ((int)__SHIFTOUT((DEVID), __BITS(15,8)))
#define PCI_NUM_RESOURCES ((PCI_MAPREG_END - PCI_MAPREG_START) / 4)
#define DEVICE_COUNT_RESOURCE PCI_NUM_RESOURCES
Home |
Main Index |
Thread Index |
Old Index