4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
34 #include <sys/nvpair.h>
40 typedef struct errorq errorq_t
;
41 typedef struct errorq_elem errorq_elem_t
;
42 typedef void (*errorq_func_t
)(void *, const void *, const errorq_elem_t
*);
45 * Public flags for errorq_create(): bit range 0-15
47 #define ERRORQ_VITAL 0x0001 /* drain queue automatically on system reset */
50 * Public flags for errorq_dispatch():
52 #define ERRORQ_ASYNC 0 /* schedule async queue drain for caller */
53 #define ERRORQ_SYNC 1 /* do not schedule drain; caller will drain */
57 extern errorq_t
*errorq_create(const char *, errorq_func_t
, void *,
58 ulong_t
, size_t, uint_t
, uint_t
);
60 extern errorq_t
*errorq_nvcreate(const char *, errorq_func_t
, void *,
61 ulong_t
, size_t, uint_t
, uint_t
);
63 extern void errorq_destroy(errorq_t
*);
64 extern void errorq_dispatch(errorq_t
*, const void *, size_t, uint_t
);
65 extern void errorq_drain(errorq_t
*);
66 extern void errorq_init(void);
67 extern void errorq_panic(void);
68 extern errorq_elem_t
*errorq_reserve(errorq_t
*);
69 extern void errorq_commit(errorq_t
*, errorq_elem_t
*, uint_t
);
70 extern void errorq_cancel(errorq_t
*, errorq_elem_t
*);
71 extern nvlist_t
*errorq_elem_nvl(errorq_t
*, const errorq_elem_t
*);
72 extern nv_alloc_t
*errorq_elem_nva(errorq_t
*, const errorq_elem_t
*);
73 extern void *errorq_elem_dup(errorq_t
*, const errorq_elem_t
*,
75 extern void errorq_dump();
83 #endif /* _ERRORQ_H */