6198 Let's EOL cachefs
[illumos-gate.git] / usr / src / uts / common / sys / errorq.h
blob971b19e6ccd856213f766a175dea4101aed7f776
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _ERRORQ_H
28 #define _ERRORQ_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/types.h>
33 #include <sys/time.h>
34 #include <sys/nvpair.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
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 */
55 #ifdef _KERNEL
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 *,
74 errorq_elem_t **);
75 extern void errorq_dump();
77 #endif /* _KERNEL */
79 #ifdef __cplusplus
81 #endif
83 #endif /* _ERRORQ_H */