xref: /titanic_51/usr/src/uts/common/sys/nvpair_impl.h (revision d583b39bfb4e2571d3e41097c5c357ffe353ad45)
1 /*
2  * CDDL HEADER START
3  *
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.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_NVPAIR_IMPL_H
28 #define	_NVPAIR_IMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/nvpair.h>
37 
38 /*
39  * The structures here provided for information and debugging purposes only
40  * may be changed in the future.
41  */
42 
43 /*
44  * implementation linked list for pre-packed data
45  */
46 typedef struct i_nvp i_nvp_t;
47 
48 struct i_nvp {
49 	union {
50 		uint64_t	_nvi_align;	/* ensure alignment */
51 		struct {
52 			i_nvp_t	*_nvi_next;	/* pointer to next nvpair */
53 			i_nvp_t	*_nvi_prev;	/* pointer to prev nvpair */
54 		} _nvi;
55 	} _nvi_un;
56 	nvpair_t nvi_nvp;			/* nvpair */
57 };
58 #define	nvi_next	_nvi_un._nvi._nvi_next
59 #define	nvi_prev	_nvi_un._nvi._nvi_prev
60 
61 typedef struct {
62 	i_nvp_t		*nvp_list;	/* linked list of nvpairs */
63 	i_nvp_t		*nvp_last;	/* last nvpair */
64 	i_nvp_t		*nvp_curr;	/* current walker nvpair */
65 	nv_alloc_t	*nvp_nva;	/* pluggable allocator */
66 	uint32_t	nvp_stat;	/* internal state */
67 } nvpriv_t;
68 
69 #ifdef	__cplusplus
70 }
71 #endif
72 
73 #endif	/* _NVPAIR_IMPL_H */
74