110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz/*
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * CDDL HEADER START
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz *
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * The contents of this file are subject to the terms of the
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * Common Development and Distribution License (the "License").
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * You may not use this file except in compliance with the License.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz *
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * or http://www.opensolaris.org/os/licensing.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * See the License for the specific language governing permissions
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * and limitations under the License.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz *
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * When distributing Covered Code, include this CDDL HEADER in each
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * If applicable, add the following below this CDDL HEADER, with the
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * fields enclosed by brackets "[]" replaced with your own identifying
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * information: Portions Copyright [yyyy] [name of copyright owner]
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz *
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * CDDL HEADER END
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz */
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz/*
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz * Use is subject to license terms.
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz */
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#ifndef _FPC_IMPL_H
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#define _FPC_IMPL_H
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#pragma ident "%Z%%M% %I% %E% SMI"
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#ifdef __cplusplus
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern "C" {
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#endif
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz/* Hide what's behind the platform-specific handle from the common files. */
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartztypedef struct __fire_perfreg_handle_t *fire_perfreg_handle_t;
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#define IS_READ B_FALSE
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#define IS_WRITE B_TRUE
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartztypedef struct {
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz char *name;
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz kmutex_t mutex;
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz void *plat_data_p;
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz} node_data_t;
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz/* Functions exported by platform specific file. */
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
0ad689d678ef901f32945172f48ddc7b16dde50dschwartzextern int fpc_platform_check();
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_platform_module_init(dev_info_t *dip);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_platform_node_init(dev_info_t *dip, int *avail);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern void fpc_platform_node_fini(void *arg);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern void fpc_platform_module_fini(dev_info_t *dip);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern fire_perfreg_handle_t fpc_get_perfreg_handle(int devnum);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_free_counter_handle(fire_perfreg_handle_t);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_event_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz uint64_t *event, boolean_t is_write);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_counter_io(fire_perfreg_handle_t handle, fire_perfcnt_t group,
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz int counter_index, uint64_t *value, boolean_t is_write);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz/* Functions exported by common file. */
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern void fpc_common_node_setup(dev_info_t *dip, int *index_p);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern char *fpc_get_dev_name_by_number(int index);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern void *fpc_get_platform_data_by_number(int index);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartzextern int fpc_set_platform_data_by_number(int index, void *data);
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#ifdef __cplusplus
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz}
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#endif
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz
110e73f9b5ccaa10e26a8f79807001a5da72604eschwartz#endif /* _FPC_IMPL_H */