xref: /onnv-gate/usr/src/lib/fm/libfmevent/common/fmev_impl.h (revision 12967:ab9ae749152f)
111102SGavin.Maltby@Sun.COM /*
211102SGavin.Maltby@Sun.COM  * CDDL HEADER START
311102SGavin.Maltby@Sun.COM  *
411102SGavin.Maltby@Sun.COM  * The contents of this file are subject to the terms of the
511102SGavin.Maltby@Sun.COM  * Common Development and Distribution License (the "License").
611102SGavin.Maltby@Sun.COM  * You may not use this file except in compliance with the License.
711102SGavin.Maltby@Sun.COM  *
811102SGavin.Maltby@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
911102SGavin.Maltby@Sun.COM  * or http://www.opensolaris.org/os/licensing.
1011102SGavin.Maltby@Sun.COM  * See the License for the specific language governing permissions
1111102SGavin.Maltby@Sun.COM  * and limitations under the License.
1211102SGavin.Maltby@Sun.COM  *
1311102SGavin.Maltby@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
1411102SGavin.Maltby@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1511102SGavin.Maltby@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
1611102SGavin.Maltby@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
1711102SGavin.Maltby@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
1811102SGavin.Maltby@Sun.COM  *
1911102SGavin.Maltby@Sun.COM  * CDDL HEADER END
2011102SGavin.Maltby@Sun.COM  */
2111102SGavin.Maltby@Sun.COM 
2211102SGavin.Maltby@Sun.COM /*
23*12967Sgavin.maltby@oracle.com  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
2411102SGavin.Maltby@Sun.COM  */
2511102SGavin.Maltby@Sun.COM 
2611102SGavin.Maltby@Sun.COM #ifndef _FMEV_IMPL_H
2711102SGavin.Maltby@Sun.COM #define	_FMEV_IMPL_H
2811102SGavin.Maltby@Sun.COM 
2911102SGavin.Maltby@Sun.COM /*
3011102SGavin.Maltby@Sun.COM  * libfmevent - private implementation
3111102SGavin.Maltby@Sun.COM  *
3211102SGavin.Maltby@Sun.COM  * Note: The contents of this file are private to the implementation of
3311102SGavin.Maltby@Sun.COM  * libfmevent and are subject to change at any time without notice.
3411102SGavin.Maltby@Sun.COM  * This file is not delivered into /usr/include.
3511102SGavin.Maltby@Sun.COM  */
3611102SGavin.Maltby@Sun.COM 
3711102SGavin.Maltby@Sun.COM #ifdef __cplusplus
3811102SGavin.Maltby@Sun.COM extern "C" {
3911102SGavin.Maltby@Sun.COM #endif
4011102SGavin.Maltby@Sun.COM 
4111102SGavin.Maltby@Sun.COM #include <assert.h>
4211102SGavin.Maltby@Sun.COM #include <errno.h>
4311102SGavin.Maltby@Sun.COM #include <libuutil.h>
4411102SGavin.Maltby@Sun.COM #include <libsysevent.h>
4511102SGavin.Maltby@Sun.COM #include <fm/libfmevent.h>
46*12967Sgavin.maltby@oracle.com #include <fm/libtopo.h>
47*12967Sgavin.maltby@oracle.com 
48*12967Sgavin.maltby@oracle.com #include "fmev_channels.h"
4911102SGavin.Maltby@Sun.COM 
5011102SGavin.Maltby@Sun.COM #ifdef DEBUG
5111102SGavin.Maltby@Sun.COM #define	ASSERT(x) (assert(x))
5211102SGavin.Maltby@Sun.COM #else
5311102SGavin.Maltby@Sun.COM #define	ASSERT(x)
5411102SGavin.Maltby@Sun.COM #endif
5511102SGavin.Maltby@Sun.COM 
5611102SGavin.Maltby@Sun.COM struct fmev_hdl_cmn {
5711102SGavin.Maltby@Sun.COM 	uint32_t hc_magic;
5811102SGavin.Maltby@Sun.COM 	uint32_t hc_api_vers;
5911102SGavin.Maltby@Sun.COM 	void *(*hc_alloc)(size_t);
6011102SGavin.Maltby@Sun.COM 	void *(*hc_zalloc)(size_t);
6111102SGavin.Maltby@Sun.COM 	void (*hc_free)(void *, size_t);
6211102SGavin.Maltby@Sun.COM };
6311102SGavin.Maltby@Sun.COM 
64*12967Sgavin.maltby@oracle.com #define	_FMEV_SHMAGIC	0x5368446c	/* ShDl */
65*12967Sgavin.maltby@oracle.com 
6611102SGavin.Maltby@Sun.COM struct fmev_hdl_cmn *fmev_shdl_cmn(fmev_shdl_t);
6711102SGavin.Maltby@Sun.COM 
68*12967Sgavin.maltby@oracle.com extern void *dflt_alloc(size_t);
69*12967Sgavin.maltby@oracle.com extern void *dflt_zalloc(size_t);
70*12967Sgavin.maltby@oracle.com extern void dflt_free(void *, size_t);
71*12967Sgavin.maltby@oracle.com 
7211102SGavin.Maltby@Sun.COM extern int fmev_api_init(struct fmev_hdl_cmn *);
7311102SGavin.Maltby@Sun.COM extern int fmev_api_enter(struct fmev_hdl_cmn *, uint32_t);
7411102SGavin.Maltby@Sun.COM extern void fmev_api_freetsd(void);
7511102SGavin.Maltby@Sun.COM extern fmev_err_t fmev_seterr(fmev_err_t);
7611102SGavin.Maltby@Sun.COM extern int fmev_shdl_valid(fmev_shdl_t);
7711102SGavin.Maltby@Sun.COM extern fmev_t fmev_sysev2fmev(fmev_shdl_t, sysevent_t *sep, char **,
7811102SGavin.Maltby@Sun.COM     nvlist_t **);
79*12967Sgavin.maltby@oracle.com extern topo_hdl_t *fmev_topohdl(fmev_shdl_t);
8011102SGavin.Maltby@Sun.COM 
8111102SGavin.Maltby@Sun.COM #ifdef __cplusplus
8211102SGavin.Maltby@Sun.COM }
8311102SGavin.Maltby@Sun.COM #endif
8411102SGavin.Maltby@Sun.COM 
8511102SGavin.Maltby@Sun.COM #endif /* _FMEV_IMPL_H */
86