xref: /onnv-gate/usr/src/uts/sun4v/sys/varconfig.h (revision 1991:f29baf5bf770)
1*1991Sheppo /*
2*1991Sheppo  * CDDL HEADER START
3*1991Sheppo  *
4*1991Sheppo  * The contents of this file are subject to the terms of the
5*1991Sheppo  * Common Development and Distribution License (the "License").
6*1991Sheppo  * You may not use this file except in compliance with the License.
7*1991Sheppo  *
8*1991Sheppo  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*1991Sheppo  * or http://www.opensolaris.org/os/licensing.
10*1991Sheppo  * See the License for the specific language governing permissions
11*1991Sheppo  * and limitations under the License.
12*1991Sheppo  *
13*1991Sheppo  * When distributing Covered Code, include this CDDL HEADER in each
14*1991Sheppo  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*1991Sheppo  * If applicable, add the following below this CDDL HEADER, with the
16*1991Sheppo  * fields enclosed by brackets "[]" replaced with your own identifying
17*1991Sheppo  * information: Portions Copyright [yyyy] [name of copyright owner]
18*1991Sheppo  *
19*1991Sheppo  * CDDL HEADER END
20*1991Sheppo  */
21*1991Sheppo 
22*1991Sheppo /*
23*1991Sheppo  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*1991Sheppo  * Use is subject to license terms.
25*1991Sheppo  */
26*1991Sheppo 
27*1991Sheppo #ifndef	_SYS_VARCONFIG_H
28*1991Sheppo #define	_SYS_VARCONFIG_H
29*1991Sheppo 
30*1991Sheppo #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*1991Sheppo 
32*1991Sheppo #ifdef	__cplusplus
33*1991Sheppo extern "C" {
34*1991Sheppo #endif
35*1991Sheppo 
36*1991Sheppo 
37*1991Sheppo typedef enum {
38*1991Sheppo 	VAR_CONFIG_SET_REQ,
39*1991Sheppo 	VAR_CONFIG_DELETE_REQ,
40*1991Sheppo 	VAR_CONFIG_SET_RESP,
41*1991Sheppo 	VAR_CONFIG_DELETE_RESP
42*1991Sheppo } var_config_cmd_t;
43*1991Sheppo 
44*1991Sheppo typedef struct  {
45*1991Sheppo 	var_config_cmd_t cmd;
46*1991Sheppo } var_config_hdr_t;
47*1991Sheppo 
48*1991Sheppo 
49*1991Sheppo typedef struct {
50*1991Sheppo 	char name_and_value[1];
51*1991Sheppo } var_config_set_req_t;
52*1991Sheppo 
53*1991Sheppo typedef struct {
54*1991Sheppo 	char name[1];
55*1991Sheppo } var_config_delete_req_t;
56*1991Sheppo 
57*1991Sheppo 
58*1991Sheppo typedef enum {
59*1991Sheppo 	VAR_CONFIG_SUCCESS = 0,
60*1991Sheppo 	VAR_CONFIG_NO_SPACE,
61*1991Sheppo 	VAR_CONFIG_INVALID_VAR,
62*1991Sheppo 	VAR_CONFIG_INVALID_VAL,
63*1991Sheppo 	VAR_CONFIG_VAR_NOT_PRESENT
64*1991Sheppo } var_config_status_t;
65*1991Sheppo 
66*1991Sheppo typedef struct {
67*1991Sheppo 	var_config_status_t result;
68*1991Sheppo } var_config_resp_t;
69*1991Sheppo 
70*1991Sheppo 
71*1991Sheppo typedef struct {
72*1991Sheppo 	var_config_hdr_t vc_hdr;
73*1991Sheppo 	union {
74*1991Sheppo 		var_config_set_req_t vc_set;
75*1991Sheppo 		var_config_delete_req_t vc_delete;
76*1991Sheppo 		var_config_resp_t vc_resp;
77*1991Sheppo 	} un;
78*1991Sheppo } var_config_msg_t;
79*1991Sheppo 
80*1991Sheppo #define	var_config_cmd		vc_hdr.cmd
81*1991Sheppo #define	var_config_set		un.vc_set
82*1991Sheppo #define	var_config_delete	un.vc_delete
83*1991Sheppo #define	var_config_resp		un.vc_resp
84*1991Sheppo 
85*1991Sheppo #ifdef	__cplusplus
86*1991Sheppo }
87*1991Sheppo #endif
88*1991Sheppo 
89*1991Sheppo #endif /* _SYS_VARCONFIG_H */
90