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