Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ofw expand this a little further to include defines of:



details:   https://anonhg.NetBSD.org/src/rev/b2b403e0cb12
branches:  trunk
changeset: 503855:b2b403e0cb12
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Feb 16 14:16:30 2001 +0000

description:
expand this a little further to include defines of:
        OFW_PCI_PHYS_HI_DEVICE() - extract PCI device from phys_hi
        OFW_PCI_PHYS_HI_FUNCTION() - extract PCI function from phys_hi
and the definition of `struct ofw_pci_register'.

diffstat:

 sys/dev/ofw/ofw_pci.h |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r 8d3ed917a98d -r b2b403e0cb12 sys/dev/ofw/ofw_pci.h
--- a/sys/dev/ofw/ofw_pci.h     Fri Feb 16 12:31:46 2001 +0000
+++ b/sys/dev/ofw/ofw_pci.h     Fri Feb 16 14:16:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_pci.h,v 1.2 1999/05/05 08:09:34 tsubai Exp $       */
+/*     $NetBSD: ofw_pci.h,v 1.3 2001/02/16 14:16:30 mrg Exp $  */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -87,4 +87,20 @@
 #define        OFW_PCI_PHYS_HI_SPACE_MEM32     0x02000000
 #define        OFW_PCI_PHYS_HI_SPACE_MEM64     0x03000000
 
+#define OFW_PCI_PHYS_HI_DEVICE(hi) \
+       (((hi) & OFW_PCI_PHYS_HI_DEVICEMASK) >> OFW_PCI_PHYS_HI_DEVICESHIFT)
+#define OFW_PCI_PHYS_HI_FUNCTION(hi) \
+       (((hi) & OFW_PCI_PHYS_HI_FUNCTIONMASK) >> OFW_PCI_PHYS_HI_FUNCTIONSHIFT)
+
+/*
+ * This has the 3 32bit cell values, plus 2 more to make up a 64-bit size.
+ */
+struct ofw_pci_register {
+       u_int32_t       phys_hi;
+       u_int32_t       phys_mid;
+       u_int32_t       phys_lo;
+       u_int32_t       size_hi;
+       u_int32_t       size_lo;
+};
+
 #endif /* _DEV_OFW_OFW_PCI_H_ */



Home | Main Index | Thread Index | Old Index