import less(1)
[unleashed/tickless.git] / usr / src / lib / fm / libfmevent / common / fmev_impl.h
blobdc9e97cb492aaa8726c4ef284820efc08f6d08e9
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
26 #ifndef _FMEV_IMPL_H
27 #define _FMEV_IMPL_H
30 * libfmevent - private implementation
32 * Note: The contents of this file are private to the implementation of
33 * libfmevent and are subject to change at any time without notice.
34 * This file is not delivered into /usr/include.
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 #include <assert.h>
42 #include <errno.h>
43 #include <libuutil.h>
44 #include <libsysevent.h>
45 #include <fm/libfmevent.h>
46 #include <fm/libtopo.h>
48 #include "fmev_channels.h"
50 #ifdef DEBUG
51 #define ASSERT(x) (assert(x))
52 #else
53 #define ASSERT(x)
54 #endif
56 struct fmev_hdl_cmn {
57 uint32_t hc_magic;
58 uint32_t hc_api_vers;
59 void *(*hc_alloc)(size_t);
60 void *(*hc_zalloc)(size_t);
61 void (*hc_free)(void *, size_t);
64 #define _FMEV_SHMAGIC 0x5368446c /* ShDl */
66 struct fmev_hdl_cmn *fmev_shdl_cmn(fmev_shdl_t);
68 extern void *dflt_alloc(size_t);
69 extern void *dflt_zalloc(size_t);
70 extern void dflt_free(void *, size_t);
72 extern int fmev_api_init(struct fmev_hdl_cmn *);
73 extern int fmev_api_enter(struct fmev_hdl_cmn *, uint32_t);
74 extern void fmev_api_freetsd(void);
75 extern fmev_err_t fmev_seterr(fmev_err_t);
76 extern int fmev_shdl_valid(fmev_shdl_t);
77 extern fmev_t fmev_sysev2fmev(fmev_shdl_t, sysevent_t *sep, char **,
78 nvlist_t **);
79 extern topo_hdl_t *fmev_topohdl(fmev_shdl_t);
81 #ifdef __cplusplus
83 #endif
85 #endif /* _FMEV_IMPL_H */