xref: /titanic_51/usr/src/uts/common/avs/ns/sdbc/safestore_ram.h (revision fcf3ce441efd61da9bb2884968af01cb7c1452cc)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SD_SAFESTORE_RAM_H
27 #define	_SD_SAFESTORE_RAM_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #ifdef _KERNEL
34 
35 typedef struct ss_ram_config_s {
36 	uint_t ss_configured;		/* configured bit */
37 	ss_voldata_impl_t *sn_volumes; /* volume directory */
38 	struct ss_wr_cctl	*sn_wr_cctl; /* the write control blocks   */
39 	ss_centry_info_impl_t *sn_gl_centry_info; /* dirty bits */
40 	struct  _sd_wr_queue	sn_wr_queue; /* the write queue */
41 } ss_ram_config_t;
42 
43 /* internal volume directory stream struct must be same size as ss_vdir_t */
44 typedef struct ss_ram_vdir_s {
45 	intptr_t rv_type;	/* stream type */
46 	union {
47 		struct {
48 			ss_voldata_impl_t *rv_current;
49 			ss_voldata_impl_t *rv_end;
50 		} rv_all;
51 
52 		struct {
53 			intptr_t v[5];
54 		} rv_vol;
55 
56 		struct {
57 			intptr_t n[5];
58 		} rv_node;
59 	} rv_u;
60 } ss_ram_vdir_t;
61 
62 /* internal centry stream struct must be same size as ss_cdir_t */
63 typedef struct ss_ram_cdir_t_s {
64 	intptr_t rc_type;	/* stream type */
65 	union {
66 		struct {
67 			ss_wr_cctl_t *rc_current;
68 			ss_wr_cctl_t *rc_end;
69 		} rc_all;
70 
71 		struct {
72 			intptr_t v[5];
73 		} rc_vol;
74 
75 		struct {
76 			intptr_t n[5];
77 		} rc_node;
78 	} rc_u;
79 }ss_ram_cdir_t;
80 
81 typedef ss_wr_cctl_t *ss_ram_resource_t;
82 typedef ss_wr_cctl_t *ss_ram_resourcelist_t;
83 
84 #endif /* _KERNEL */
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif	/* _SD_SAFESTORE_RAM_H */
91