xref: /onnv-gate/usr/src/uts/sun4/io/fpc/fpc-impl.h (revision 1691:4e20a3756674)
11370Sschwartz /*
21370Sschwartz  * CDDL HEADER START
31370Sschwartz  *
41370Sschwartz  * The contents of this file are subject to the terms of the
51370Sschwartz  * Common Development and Distribution License (the "License").
61370Sschwartz  * You may not use this file except in compliance with the License.
71370Sschwartz  *
81370Sschwartz  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91370Sschwartz  * or http://www.opensolaris.org/os/licensing.
101370Sschwartz  * See the License for the specific language governing permissions
111370Sschwartz  * and limitations under the License.
121370Sschwartz  *
131370Sschwartz  * When distributing Covered Code, include this CDDL HEADER in each
141370Sschwartz  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151370Sschwartz  * If applicable, add the following below this CDDL HEADER, with the
161370Sschwartz  * fields enclosed by brackets "[]" replaced with your own identifying
171370Sschwartz  * information: Portions Copyright [yyyy] [name of copyright owner]
181370Sschwartz  *
191370Sschwartz  * CDDL HEADER END
201370Sschwartz  */
211370Sschwartz 
221370Sschwartz /*
231370Sschwartz  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
241370Sschwartz  * Use is subject to license terms.
251370Sschwartz  */
261370Sschwartz 
271370Sschwartz #ifndef	_FPC_IMPL_H
281370Sschwartz #define	_FPC_IMPL_H
291370Sschwartz 
301370Sschwartz #pragma ident	"%Z%%M%	%I%	%E% SMI"
311370Sschwartz 
321370Sschwartz #ifdef	__cplusplus
331370Sschwartz extern "C" {
341370Sschwartz #endif
351370Sschwartz 
361370Sschwartz /* Hide what's behind the platform-specific handle from the common files. */
371370Sschwartz typedef struct __fire_perfreg_handle_t *fire_perfreg_handle_t;
381370Sschwartz 
391370Sschwartz #define	IS_READ		B_FALSE
401370Sschwartz #define	IS_WRITE	B_TRUE
411370Sschwartz 
421370Sschwartz typedef struct {
431370Sschwartz 	char		*name;
441370Sschwartz 	kmutex_t	mutex;
451370Sschwartz 	void		*plat_data_p;
461370Sschwartz } node_data_t;
471370Sschwartz 
481370Sschwartz /* Functions exported by platform specific file. */
491370Sschwartz 
50*1691Sschwartz extern int fpc_platform_check();
511370Sschwartz extern int fpc_platform_module_init(dev_info_t *dip);
521370Sschwartz extern int fpc_platform_node_init(dev_info_t *dip, int *avail);
531370Sschwartz extern void fpc_platform_node_fini(void *arg);
541370Sschwartz extern void fpc_platform_module_fini(dev_info_t *dip);
551370Sschwartz extern fire_perfreg_handle_t fpc_get_perfreg_handle(int devnum);
561370Sschwartz extern int fpc_free_counter_handle(fire_perfreg_handle_t);
571370Sschwartz extern int fpc_event_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
581370Sschwartz     uint64_t *event, boolean_t is_write);
591370Sschwartz extern int fpc_counter_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
601370Sschwartz     int counter_index, uint64_t *value, boolean_t is_write);
611370Sschwartz 
621370Sschwartz /* Functions exported by common file. */
631370Sschwartz extern void fpc_common_node_setup(dev_info_t *dip, int *index_p);
641370Sschwartz extern char *fpc_get_dev_name_by_number(int index);
651370Sschwartz extern void *fpc_get_platform_data_by_number(int index);
661370Sschwartz extern int fpc_set_platform_data_by_number(int index, void *data);
671370Sschwartz 
681370Sschwartz #ifdef	__cplusplus
691370Sschwartz }
701370Sschwartz #endif
711370Sschwartz 
721370Sschwartz #endif	/* _FPC_IMPL_H */
73