18a40a695Sgavinm /*
28a40a695Sgavinm  * CDDL HEADER START
38a40a695Sgavinm  *
48a40a695Sgavinm  * The contents of this file are subject to the terms of the
58a40a695Sgavinm  * Common Development and Distribution License (the "License").
68a40a695Sgavinm  * You may not use this file except in compliance with the License.
78a40a695Sgavinm  *
88a40a695Sgavinm  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
98a40a695Sgavinm  * or http://www.opensolaris.org/os/licensing.
108a40a695Sgavinm  * See the License for the specific language governing permissions
118a40a695Sgavinm  * and limitations under the License.
128a40a695Sgavinm  *
138a40a695Sgavinm  * When distributing Covered Code, include this CDDL HEADER in each
148a40a695Sgavinm  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
158a40a695Sgavinm  * If applicable, add the following below this CDDL HEADER, with the
168a40a695Sgavinm  * fields enclosed by brackets "[]" replaced with your own identifying
178a40a695Sgavinm  * information: Portions Copyright [yyyy] [name of copyright owner]
188a40a695Sgavinm  *
198a40a695Sgavinm  * CDDL HEADER END
208a40a695Sgavinm  */
218a40a695Sgavinm 
228a40a695Sgavinm /*
23*e4b86885SCheng Sean Ye  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
248a40a695Sgavinm  * Use is subject to license terms.
258a40a695Sgavinm  */
268a40a695Sgavinm 
278a40a695Sgavinm #ifndef _MCAMD_PCICFG_H
288a40a695Sgavinm #define	_MCAMD_PCICFG_H
298a40a695Sgavinm 
308a40a695Sgavinm #include <sys/ddi.h>
318a40a695Sgavinm #include <sys/sunddi.h>
328a40a695Sgavinm 
338a40a695Sgavinm #include <mcamd.h>
348a40a695Sgavinm 
358a40a695Sgavinm #ifdef __cplusplus
368a40a695Sgavinm extern "C" {
378a40a695Sgavinm #endif
388a40a695Sgavinm 
398a40a695Sgavinm typedef void * mc_pcicfg_hdl_t;
408a40a695Sgavinm 
4120c794b3Sgavinm /*
4220c794b3Sgavinm  * MC PCI config where we have attached to an MC dev/function.
4320c794b3Sgavinm  */
448a40a695Sgavinm extern int mc_pcicfg_setup(mc_t *, enum mc_funcnum, mc_pcicfg_hdl_t *);
458a40a695Sgavinm extern void mc_pcicfg_teardown(mc_pcicfg_hdl_t);
468a40a695Sgavinm extern uint32_t mc_pcicfg_get32(mc_pcicfg_hdl_t, off_t);
4720c794b3Sgavinm extern void mc_pcicfg_put32(mc_pcicfg_hdl_t cookie, off_t offset, uint32_t val);
488a40a695Sgavinm 
498a40a695Sgavinm /* MC PCI config where we have not attached to the dev/function */
508a40a695Sgavinm extern uint32_t mc_pcicfg_get32_nohdl(mc_t *, enum mc_funcnum, off_t);
518a40a695Sgavinm extern void mc_pcicfg_put32_nohdl(mc_t *, enum mc_funcnum, off_t, uint32_t);
528a40a695Sgavinm 
538a40a695Sgavinm #ifdef __cplusplus
548a40a695Sgavinm }
558a40a695Sgavinm #endif
568a40a695Sgavinm 
578a40a695Sgavinm #endif	/* _MCAMD_PCICFG_H */
58