xref: /illumos-gate/usr/src/uts/sun4v/sys/platsvc.h (revision 02b4e56ca3a4e4a4fe9e52fca9c2972101f0e57f)
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 /*
23  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
24  */
25 
26 #ifndef _PLATSVC_H
27 #define	_PLATSVC_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 #include <sys/ds.h>
35 
36 #define	MAX_REASON_SIZE		1
37 #define	SUSPEND_MAX_REASON_SIZE	256
38 
39 /*
40  * PLATSVC STATUS
41  */
42 #define	PLATSVC_SUCCESS		0x0
43 #define	PLATSVC_FAILURE		0x1
44 #define	PLATSVC_INVALID_MESG	0x2
45 
46 #define	MD_UPDATE_SUCCESS		PLATSVC_SUCCESS
47 #define	MD_UPDATE_FAILURE		PLATSVC_FAILURE
48 #define	MD_UPDATE_INVALID_MSG		PLATSVC_INVALID_MESG
49 
50 #define	DOMAIN_SHUTDOWN_SUCCESS		PLATSVC_SUCCESS
51 #define	DOMAIN_SHUTDOWN_FAILURE		PLATSVC_FAILURE
52 #define	DOMAIN_SHUTDOWN_INVALID_MSG	PLATSVC_INVALID_MESG
53 
54 #define	DOMAIN_PANIC_SUCCESS		PLATSVC_SUCCESS
55 #define	DOMAIN_PANIC_FAILURE		PLATSVC_FAILURE
56 #define	DOMAIN_PANIC_INVALID_MSG	PLATSVC_INVALID_MESG
57 
58 /*
59  * Suspend message types.
60  */
61 #define	DOMAIN_SUSPEND_SUSPEND		0x0
62 
63 /*
64  * Suspend response result values.
65  */
66 #define	DOMAIN_SUSPEND_PRE_SUCCESS	PLATSVC_SUCCESS
67 #define	DOMAIN_SUSPEND_PRE_FAILURE	PLATSVC_FAILURE
68 #define	DOMAIN_SUSPEND_INVALID_MSG	PLATSVC_INVALID_MESG
69 #define	DOMAIN_SUSPEND_INPROGRESS	0x3
70 #define	DOMAIN_SUSPEND_SUSPEND_FAILURE	0x4
71 #define	DOMAIN_SUSPEND_POST_SUCCESS	0x5
72 #define	DOMAIN_SUSPEND_POST_FAILURE	0x6
73 
74 /*
75  * Suspend recovery result values.
76  */
77 #define	DOMAIN_SUSPEND_REC_SUCCESS	0x0
78 #define	DOMAIN_SUSPEND_REC_FAILURE	0x1
79 
80 /*
81  * String used as the error reason in the failure response when a
82  * suspend request is denied due to an ongoing DR operation.
83  */
84 #define	DOMAIN_SUSPEND_DR_ERROR_STR	\
85 	"suspend failure: DR operation in progress"
86 
87 typedef struct platsvc_md_update_req {
88 	uint64_t	req_num;
89 } platsvc_md_update_req_t;
90 
91 typedef struct platsvc_md_update_resp {
92 	uint64_t	req_num;
93 	uint32_t	result;
94 } platsvc_md_update_resp_t;
95 
96 typedef struct platsvc_shutdown_req {
97 	uint64_t	req_num;
98 	uint32_t	delay;
99 } platsvc_shutdown_req_t;
100 
101 typedef struct platsvc_shutdown_resp {
102 	uint64_t	req_num;
103 	uint32_t	result;
104 	char		reason[MAX_REASON_SIZE];
105 } platsvc_shutdown_resp_t;
106 
107 typedef struct platsvc_panic_req {
108 	uint64_t	req_num;
109 } platsvc_panic_req_t;
110 
111 typedef struct platsvc_panic_resp {
112 	uint64_t	req_num;
113 	uint32_t	result;
114 	char		reason[MAX_REASON_SIZE];
115 } platsvc_panic_resp_t;
116 
117 typedef struct platsvc_suspend_req {
118 	uint64_t	req_num;
119 	uint64_t	type;
120 } platsvc_suspend_req_t;
121 
122 typedef struct platsvc_suspend_resp {
123 	uint64_t	req_num;
124 	uint32_t	result;
125 	uint32_t	rec_result;
126 	char		reason[MAX_REASON_SIZE];
127 } platsvc_suspend_resp_t;
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif /* _PLATSVC_H */
134