xref: /titanic_52/usr/src/uts/sun4v/sys/platsvc.h (revision 02b4e56ca3a4e4a4fe9e52fca9c2972101f0e57f)
11ae08745Sheppo /*
21ae08745Sheppo  * CDDL HEADER START
31ae08745Sheppo  *
41ae08745Sheppo  * The contents of this file are subject to the terms of the
51ae08745Sheppo  * Common Development and Distribution License (the "License").
61ae08745Sheppo  * You may not use this file except in compliance with the License.
71ae08745Sheppo  *
81ae08745Sheppo  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91ae08745Sheppo  * or http://www.opensolaris.org/os/licensing.
101ae08745Sheppo  * See the License for the specific language governing permissions
111ae08745Sheppo  * and limitations under the License.
121ae08745Sheppo  *
131ae08745Sheppo  * When distributing Covered Code, include this CDDL HEADER in each
141ae08745Sheppo  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151ae08745Sheppo  * If applicable, add the following below this CDDL HEADER, with the
161ae08745Sheppo  * fields enclosed by brackets "[]" replaced with your own identifying
171ae08745Sheppo  * information: Portions Copyright [yyyy] [name of copyright owner]
181ae08745Sheppo  *
191ae08745Sheppo  * CDDL HEADER END
201ae08745Sheppo  */
211ae08745Sheppo 
221ae08745Sheppo /*
23*02b4e56cSHaik Aftandilian  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
241ae08745Sheppo  */
251ae08745Sheppo 
261ae08745Sheppo #ifndef _PLATSVC_H
271ae08745Sheppo #define	_PLATSVC_H
281ae08745Sheppo 
291ae08745Sheppo #ifdef __cplusplus
301ae08745Sheppo extern "C" {
311ae08745Sheppo #endif
321ae08745Sheppo 
331ae08745Sheppo #include <sys/types.h>
341ae08745Sheppo #include <sys/ds.h>
351ae08745Sheppo 
361ae08745Sheppo #define	MAX_REASON_SIZE		1
37023e71deSHaik Aftandilian #define	SUSPEND_MAX_REASON_SIZE	256
381ae08745Sheppo 
391ae08745Sheppo /*
401ae08745Sheppo  * PLATSVC STATUS
411ae08745Sheppo  */
421ae08745Sheppo #define	PLATSVC_SUCCESS		0x0
431ae08745Sheppo #define	PLATSVC_FAILURE		0x1
441ae08745Sheppo #define	PLATSVC_INVALID_MESG	0x2
451ae08745Sheppo 
461ae08745Sheppo #define	MD_UPDATE_SUCCESS		PLATSVC_SUCCESS
471ae08745Sheppo #define	MD_UPDATE_FAILURE		PLATSVC_FAILURE
481ae08745Sheppo #define	MD_UPDATE_INVALID_MSG		PLATSVC_INVALID_MESG
491ae08745Sheppo 
501ae08745Sheppo #define	DOMAIN_SHUTDOWN_SUCCESS		PLATSVC_SUCCESS
511ae08745Sheppo #define	DOMAIN_SHUTDOWN_FAILURE		PLATSVC_FAILURE
521ae08745Sheppo #define	DOMAIN_SHUTDOWN_INVALID_MSG	PLATSVC_INVALID_MESG
531ae08745Sheppo 
541ae08745Sheppo #define	DOMAIN_PANIC_SUCCESS		PLATSVC_SUCCESS
551ae08745Sheppo #define	DOMAIN_PANIC_FAILURE		PLATSVC_FAILURE
561ae08745Sheppo #define	DOMAIN_PANIC_INVALID_MSG	PLATSVC_INVALID_MESG
571ae08745Sheppo 
58023e71deSHaik Aftandilian /*
59023e71deSHaik Aftandilian  * Suspend message types.
60023e71deSHaik Aftandilian  */
61023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_SUSPEND		0x0
62023e71deSHaik Aftandilian 
63023e71deSHaik Aftandilian /*
64023e71deSHaik Aftandilian  * Suspend response result values.
65023e71deSHaik Aftandilian  */
66023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_PRE_SUCCESS	PLATSVC_SUCCESS
67023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_PRE_FAILURE	PLATSVC_FAILURE
68023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_INVALID_MSG	PLATSVC_INVALID_MESG
69023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_INPROGRESS	0x3
70023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_SUSPEND_FAILURE	0x4
71023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_POST_SUCCESS	0x5
72023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_POST_FAILURE	0x6
73023e71deSHaik Aftandilian 
74023e71deSHaik Aftandilian /*
75023e71deSHaik Aftandilian  * Suspend recovery result values.
76023e71deSHaik Aftandilian  */
77023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_REC_SUCCESS	0x0
78023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_REC_FAILURE	0x1
79023e71deSHaik Aftandilian 
80*02b4e56cSHaik Aftandilian /*
81*02b4e56cSHaik Aftandilian  * String used as the error reason in the failure response when a
82*02b4e56cSHaik Aftandilian  * suspend request is denied due to an ongoing DR operation.
83*02b4e56cSHaik Aftandilian  */
84*02b4e56cSHaik Aftandilian #define	DOMAIN_SUSPEND_DR_ERROR_STR	\
85*02b4e56cSHaik Aftandilian 	"suspend failure: DR operation in progress"
86*02b4e56cSHaik Aftandilian 
871ae08745Sheppo typedef struct platsvc_md_update_req {
881ae08745Sheppo 	uint64_t	req_num;
891ae08745Sheppo } platsvc_md_update_req_t;
901ae08745Sheppo 
911ae08745Sheppo typedef struct platsvc_md_update_resp {
921ae08745Sheppo 	uint64_t	req_num;
931ae08745Sheppo 	uint32_t	result;
941ae08745Sheppo } platsvc_md_update_resp_t;
951ae08745Sheppo 
961ae08745Sheppo typedef struct platsvc_shutdown_req {
971ae08745Sheppo 	uint64_t	req_num;
981ae08745Sheppo 	uint32_t	delay;
991ae08745Sheppo } platsvc_shutdown_req_t;
1001ae08745Sheppo 
1011ae08745Sheppo typedef struct platsvc_shutdown_resp {
1021ae08745Sheppo 	uint64_t	req_num;
1031ae08745Sheppo 	uint32_t	result;
1041ae08745Sheppo 	char		reason[MAX_REASON_SIZE];
1051ae08745Sheppo } platsvc_shutdown_resp_t;
1061ae08745Sheppo 
1071ae08745Sheppo typedef struct platsvc_panic_req {
1081ae08745Sheppo 	uint64_t	req_num;
1091ae08745Sheppo } platsvc_panic_req_t;
1101ae08745Sheppo 
1111ae08745Sheppo typedef struct platsvc_panic_resp {
1121ae08745Sheppo 	uint64_t	req_num;
1131ae08745Sheppo 	uint32_t	result;
1141ae08745Sheppo 	char		reason[MAX_REASON_SIZE];
1151ae08745Sheppo } platsvc_panic_resp_t;
1161ae08745Sheppo 
117023e71deSHaik Aftandilian typedef struct platsvc_suspend_req {
118023e71deSHaik Aftandilian 	uint64_t	req_num;
119023e71deSHaik Aftandilian 	uint64_t	type;
120023e71deSHaik Aftandilian } platsvc_suspend_req_t;
121023e71deSHaik Aftandilian 
122023e71deSHaik Aftandilian typedef struct platsvc_suspend_resp {
123023e71deSHaik Aftandilian 	uint64_t	req_num;
124023e71deSHaik Aftandilian 	uint32_t	result;
125023e71deSHaik Aftandilian 	uint32_t	rec_result;
126023e71deSHaik Aftandilian 	char		reason[MAX_REASON_SIZE];
127023e71deSHaik Aftandilian } platsvc_suspend_resp_t;
128023e71deSHaik Aftandilian 
1291ae08745Sheppo #ifdef __cplusplus
1301ae08745Sheppo }
1311ae08745Sheppo #endif
1321ae08745Sheppo 
1331ae08745Sheppo #endif /* _PLATSVC_H */
134