xref: /onnv-gate/usr/src/uts/sun4/io/fpc/fpc-impl.h (revision 1370)
1*1370Sschwartz /*
2*1370Sschwartz  * CDDL HEADER START
3*1370Sschwartz  *
4*1370Sschwartz  * The contents of this file are subject to the terms of the
5*1370Sschwartz  * Common Development and Distribution License (the "License").
6*1370Sschwartz  * You may not use this file except in compliance with the License.
7*1370Sschwartz  *
8*1370Sschwartz  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1370Sschwartz  * or http://www.opensolaris.org/os/licensing.
10*1370Sschwartz  * See the License for the specific language governing permissions
11*1370Sschwartz  * and limitations under the License.
12*1370Sschwartz  *
13*1370Sschwartz  * When distributing Covered Code, include this CDDL HEADER in each
14*1370Sschwartz  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1370Sschwartz  * If applicable, add the following below this CDDL HEADER, with the
16*1370Sschwartz  * fields enclosed by brackets "[]" replaced with your own identifying
17*1370Sschwartz  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1370Sschwartz  *
19*1370Sschwartz  * CDDL HEADER END
20*1370Sschwartz  */
21*1370Sschwartz 
22*1370Sschwartz /*
23*1370Sschwartz  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*1370Sschwartz  * Use is subject to license terms.
25*1370Sschwartz  */
26*1370Sschwartz 
27*1370Sschwartz #ifndef	_FPC_IMPL_H
28*1370Sschwartz #define	_FPC_IMPL_H
29*1370Sschwartz 
30*1370Sschwartz #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*1370Sschwartz 
32*1370Sschwartz #ifdef	__cplusplus
33*1370Sschwartz extern "C" {
34*1370Sschwartz #endif
35*1370Sschwartz 
36*1370Sschwartz /* Hide what's behind the platform-specific handle from the common files. */
37*1370Sschwartz typedef struct __fire_perfreg_handle_t *fire_perfreg_handle_t;
38*1370Sschwartz 
39*1370Sschwartz #define	IS_READ		B_FALSE
40*1370Sschwartz #define	IS_WRITE	B_TRUE
41*1370Sschwartz 
42*1370Sschwartz typedef struct {
43*1370Sschwartz 	char		*name;
44*1370Sschwartz 	kmutex_t	mutex;
45*1370Sschwartz 	void		*plat_data_p;
46*1370Sschwartz } node_data_t;
47*1370Sschwartz 
48*1370Sschwartz /* Functions exported by platform specific file. */
49*1370Sschwartz 
50*1370Sschwartz extern int fpc_platform_module_init(dev_info_t *dip);
51*1370Sschwartz extern int fpc_platform_node_init(dev_info_t *dip, int *avail);
52*1370Sschwartz extern void fpc_platform_node_fini(void *arg);
53*1370Sschwartz extern void fpc_platform_module_fini(dev_info_t *dip);
54*1370Sschwartz extern fire_perfreg_handle_t fpc_get_perfreg_handle(int devnum);
55*1370Sschwartz extern int fpc_free_counter_handle(fire_perfreg_handle_t);
56*1370Sschwartz extern int fpc_event_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
57*1370Sschwartz     uint64_t *event, boolean_t is_write);
58*1370Sschwartz extern int fpc_counter_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
59*1370Sschwartz     int counter_index, uint64_t *value, boolean_t is_write);
60*1370Sschwartz 
61*1370Sschwartz /* Functions exported by common file. */
62*1370Sschwartz extern void fpc_common_node_setup(dev_info_t *dip, int *index_p);
63*1370Sschwartz extern char *fpc_get_dev_name_by_number(int index);
64*1370Sschwartz extern void *fpc_get_platform_data_by_number(int index);
65*1370Sschwartz extern int fpc_set_platform_data_by_number(int index, void *data);
66*1370Sschwartz 
67*1370Sschwartz #ifdef	__cplusplus
68*1370Sschwartz }
69*1370Sschwartz #endif
70*1370Sschwartz 
71*1370Sschwartz #endif	/* _FPC_IMPL_H */
72