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 (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_INSTANCE_H
26 #define _SYS_INSTANCE_H
27
28 /*
29 * Instance number assignment data structures
30 */
31
32 #include <sys/types.h>
33 #include <sys/param.h>
34 #include <sys/dditypes.h>
35 #include <sys/list.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #define INSTANCE_FILE "/etc/path_to_inst"
117 /* Platform instance override functions */
118 uint_t impl_assign_instance(dev_info_t *dip);
119 int impl_keep_instance(dev_info_t *dip);
120 int impl_free_instance(dev_info_t *dip);
121
122 /* walk the instance tree */
123 int e_ddi_walk_instances(int (*)(const char *,
124 in_node_t *, in_drv_t *, void *), void *);
125
126 /* for DDI-MP */
127 in_node_t *e_ddi_path_to_instance(char *path);
128 void e_ddi_borrow_instance(dev_info_t *cdip, in_node_t *cnp);
129 void e_ddi_return_instance(dev_info_t *cdip, char *addr, in_node_t *cnp);
130
131 /* return values from e_ddi_walk_instances callback */
132 #define INST_WALK_CONTINUE 0
133 #define INST_WALK_TERMINATE 1
134
135
136 #else /* _KERNEL */
137 #ifdef __STDC__
138 extern int inst_sync(char *pathname, int flags);
139 #else
140 extern int inst_sync();
141 #endif /* __STDC__ */
142 #endif /* _KERNEL */
143
144 #define INST_SYNC_IF_REQUIRED 0
145 #define INST_SYNC_ALWAYS 1
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* _SYS_INSTANCE_H */
|
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 2014 Garrett D'Amore <garrett@damore.org>
23 *
24 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
25 */
26
27 #ifndef _SYS_INSTANCE_H
28 #define _SYS_INSTANCE_H
29
30 /*
31 * Instance number assignment data structures
32 */
33
34 #include <sys/types.h>
35 #include <sys/param.h>
36 #include <sys/dditypes.h>
37 #include <sys/list.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #define INSTANCE_FILE "/etc/path_to_inst"
119 /* Platform instance override functions */
120 uint_t impl_assign_instance(dev_info_t *dip);
121 int impl_keep_instance(dev_info_t *dip);
122 int impl_free_instance(dev_info_t *dip);
123
124 /* walk the instance tree */
125 int e_ddi_walk_instances(int (*)(const char *,
126 in_node_t *, in_drv_t *, void *), void *);
127
128 /* for DDI-MP */
129 in_node_t *e_ddi_path_to_instance(char *path);
130 void e_ddi_borrow_instance(dev_info_t *cdip, in_node_t *cnp);
131 void e_ddi_return_instance(dev_info_t *cdip, char *addr, in_node_t *cnp);
132
133 /* return values from e_ddi_walk_instances callback */
134 #define INST_WALK_CONTINUE 0
135 #define INST_WALK_TERMINATE 1
136
137
138 #else /* _KERNEL */
139 extern int inst_sync(char *pathname, int flags);
140 #endif /* _KERNEL */
141
142 #define INST_SYNC_IF_REQUIRED 0
143 #define INST_SYNC_ALWAYS 1
144
145 #ifdef __cplusplus
146 }
147 #endif
148
149 #endif /* _SYS_INSTANCE_H */
|