Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 Implement pci_decompose_tag().
details: https://anonhg.NetBSD.org/src/rev/1857d1a78442
branches: trunk
changeset: 527007:1857d1a78442
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed May 15 17:40:11 2002 +0000
description:
Implement pci_decompose_tag().
diffstat:
sys/arch/sparc64/dev/pci_machdep.c | 17 ++++++++++++++++-
sys/arch/sparc64/include/pci_machdep.h | 7 ++++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diffs (59 lines):
diff -r b16807c144af -r 1857d1a78442 sys/arch/sparc64/dev/pci_machdep.c
--- a/sys/arch/sparc64/dev/pci_machdep.c Wed May 15 17:30:04 2002 +0000
+++ b/sys/arch/sparc64/dev/pci_machdep.c Wed May 15 17:40:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.c,v 1.27 2002/05/06 22:18:51 eeh Exp $ */
+/* $NetBSD: pci_machdep.c,v 1.28 2002/05/15 17:40:11 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000 Matthew R. Green
@@ -332,6 +332,21 @@
return (tag);
}
+void
+pci_decompose_tag(pc, tag, bp, dp, fp)
+ pci_chipset_tag_t pc;
+ pcitag_t tag;
+ int *bp, *dp, *fp;
+{
+
+ if (bp != NULL)
+ *bp = PCITAG_BUS(tag);
+ if (dp != NULL)
+ *dp = PCITAG_DEV(tag);
+ if (fp != NULL)
+ *fp = PCITAG_FUN(tag);
+}
+
pcitag_t
ofpci_make_tag(pc, node, b, d, f)
pci_chipset_tag_t pc;
diff -r b16807c144af -r 1857d1a78442 sys/arch/sparc64/include/pci_machdep.h
--- a/sys/arch/sparc64/include/pci_machdep.h Wed May 15 17:30:04 2002 +0000
+++ b/sys/arch/sparc64/include/pci_machdep.h Wed May 15 17:40:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.9 2002/02/26 22:39:14 eeh Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.10 2002/05/15 17:40:12 thorpej Exp $ */
/*
* Copyright (c) 1999 Matthew R. Green
@@ -66,6 +66,9 @@
#define PCITAG_NODE(x) (int)(((x)>>32)&0xffffffff)
#define PCITAG_OFFSET(x) ((x)&0xffffffff)
+#define PCITAG_BUS(t) ((PCITAG_OFFSET(t)>>16)&0xff)
+#define PCITAG_DEV(t) ((PCITAG_OFFSET(t)>>11)&0x1f)
+#define PCITAG_FUN(t) ((PCITAG_OFFSET(t)>>8)&0x7)
#define PCITAG_CREATE(n,b,d,f) (((u_int64_t)(n)<<32)|((b)<<16)|((d)<<11)|((f)<<8))
#define PCITAG_SETNODE(t,n) ((t)&0xffffffff)|(((n)<<32)
typedef u_int64_t pcitag_t;
@@ -81,6 +84,8 @@
#endif
int pci_bus_maxdevs(pci_chipset_tag_t, int);
pcitag_t pci_make_tag(pci_chipset_tag_t, int, int, int);
+void pci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *,
+ int *);
pcireg_t pci_conf_read(pci_chipset_tag_t, pcitag_t, int);
void pci_conf_write(pci_chipset_tag_t, pcitag_t, int,
pcireg_t);
Home |
Main Index |
Thread Index |
Old Index