xref: /titanic_52/usr/src/uts/sun4u/sys/pci/pci_util.h (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_PCI_UTIL_H
28 #define	_SYS_PCI_UTIL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 extern int init_child(pci_t *pci_p, dev_info_t *child);
37 extern int uninit_child(pci_t *pci_p, dev_info_t *child);
38 extern int report_dev(dev_info_t *dip);
39 extern int get_pci_properties(pci_t *pci_p, dev_info_t *dip);
40 extern void free_pci_properties(pci_t *pci_p);
41 extern void unmap_pci_registers(pci_t *pci_p);
42 extern void fault_init(pci_t *pci_p);
43 extern void fault_fini(pci_t *pci_p);
44 extern int pci_log_cfg_err(dev_info_t *dip, ushort_t status_reg, char *err_msg);
45 extern int pci_get_portid(dev_info_t *dip);
46 
47 /* bus map routines */
48 extern int pci_reloc_reg(dev_info_t *dip, dev_info_t *rdip, pci_t *pci_p,
49 	pci_regspec_t *pci_rp);
50 extern int pci_xlate_reg(pci_t *pci_p, pci_regspec_t *pci_rp,
51 	struct regspec *new_rp);
52 
53 /* bus add intrspec */
54 extern uint_t get_nreg_set(dev_info_t *child);
55 extern uint_t get_nintr(dev_info_t *child);
56 extern uint64_t pci_get_cfg_pabase(pci_t *pci_p);
57 extern int pci_cfg_report(dev_info_t *, ddi_fm_error_t *, pci_errstate_t *,
58 	int, uint32_t);
59 
60 #ifdef	__cplusplus
61 }
62 #endif
63 
64 #endif	/* _SYS_PCI_UTIL_H */
65