xref: /titanic_44/usr/src/uts/sun4v/sys/platsvc.h (revision 023e71de9e5670cebc23dd51162833661d3d2d3b)
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*023e71deSHaik Aftandilian  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
241ae08745Sheppo  * Use is subject to license terms.
251ae08745Sheppo  */
261ae08745Sheppo 
271ae08745Sheppo #ifndef _PLATSVC_H
281ae08745Sheppo #define	_PLATSVC_H
291ae08745Sheppo 
301ae08745Sheppo #ifdef __cplusplus
311ae08745Sheppo extern "C" {
321ae08745Sheppo #endif
331ae08745Sheppo 
341ae08745Sheppo #include <sys/types.h>
351ae08745Sheppo #include <sys/ds.h>
361ae08745Sheppo 
371ae08745Sheppo #define	MAX_REASON_SIZE		1
38*023e71deSHaik Aftandilian #define	SUSPEND_MAX_REASON_SIZE	256
391ae08745Sheppo 
401ae08745Sheppo /*
411ae08745Sheppo  * PLATSVC STATUS
421ae08745Sheppo  */
431ae08745Sheppo #define	PLATSVC_SUCCESS		0x0
441ae08745Sheppo #define	PLATSVC_FAILURE		0x1
451ae08745Sheppo #define	PLATSVC_INVALID_MESG	0x2
461ae08745Sheppo 
471ae08745Sheppo #define	MD_UPDATE_SUCCESS		PLATSVC_SUCCESS
481ae08745Sheppo #define	MD_UPDATE_FAILURE		PLATSVC_FAILURE
491ae08745Sheppo #define	MD_UPDATE_INVALID_MSG		PLATSVC_INVALID_MESG
501ae08745Sheppo 
511ae08745Sheppo #define	DOMAIN_SHUTDOWN_SUCCESS		PLATSVC_SUCCESS
521ae08745Sheppo #define	DOMAIN_SHUTDOWN_FAILURE		PLATSVC_FAILURE
531ae08745Sheppo #define	DOMAIN_SHUTDOWN_INVALID_MSG	PLATSVC_INVALID_MESG
541ae08745Sheppo 
551ae08745Sheppo #define	DOMAIN_PANIC_SUCCESS		PLATSVC_SUCCESS
561ae08745Sheppo #define	DOMAIN_PANIC_FAILURE		PLATSVC_FAILURE
571ae08745Sheppo #define	DOMAIN_PANIC_INVALID_MSG	PLATSVC_INVALID_MESG
581ae08745Sheppo 
59*023e71deSHaik Aftandilian /*
60*023e71deSHaik Aftandilian  * Suspend message types.
61*023e71deSHaik Aftandilian  */
62*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_SUSPEND		0x0
63*023e71deSHaik Aftandilian 
64*023e71deSHaik Aftandilian /*
65*023e71deSHaik Aftandilian  * Suspend response result values.
66*023e71deSHaik Aftandilian  */
67*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_PRE_SUCCESS	PLATSVC_SUCCESS
68*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_PRE_FAILURE	PLATSVC_FAILURE
69*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_INVALID_MSG	PLATSVC_INVALID_MESG
70*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_INPROGRESS	0x3
71*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_SUSPEND_FAILURE	0x4
72*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_POST_SUCCESS	0x5
73*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_POST_FAILURE	0x6
74*023e71deSHaik Aftandilian 
75*023e71deSHaik Aftandilian /*
76*023e71deSHaik Aftandilian  * Suspend recovery result values.
77*023e71deSHaik Aftandilian  */
78*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_REC_SUCCESS	0x0
79*023e71deSHaik Aftandilian #define	DOMAIN_SUSPEND_REC_FAILURE	0x1
80*023e71deSHaik Aftandilian 
811ae08745Sheppo typedef struct platsvc_md_update_req {
821ae08745Sheppo 	uint64_t	req_num;
831ae08745Sheppo } platsvc_md_update_req_t;
841ae08745Sheppo 
851ae08745Sheppo typedef struct platsvc_md_update_resp {
861ae08745Sheppo 	uint64_t	req_num;
871ae08745Sheppo 	uint32_t	result;
881ae08745Sheppo } platsvc_md_update_resp_t;
891ae08745Sheppo 
901ae08745Sheppo typedef struct platsvc_shutdown_req {
911ae08745Sheppo 	uint64_t	req_num;
921ae08745Sheppo 	uint32_t	delay;
931ae08745Sheppo } platsvc_shutdown_req_t;
941ae08745Sheppo 
951ae08745Sheppo typedef struct platsvc_shutdown_resp {
961ae08745Sheppo 	uint64_t	req_num;
971ae08745Sheppo 	uint32_t	result;
981ae08745Sheppo 	char		reason[MAX_REASON_SIZE];
991ae08745Sheppo } platsvc_shutdown_resp_t;
1001ae08745Sheppo 
1011ae08745Sheppo typedef struct platsvc_panic_req {
1021ae08745Sheppo 	uint64_t	req_num;
1031ae08745Sheppo } platsvc_panic_req_t;
1041ae08745Sheppo 
1051ae08745Sheppo typedef struct platsvc_panic_resp {
1061ae08745Sheppo 	uint64_t	req_num;
1071ae08745Sheppo 	uint32_t	result;
1081ae08745Sheppo 	char		reason[MAX_REASON_SIZE];
1091ae08745Sheppo } platsvc_panic_resp_t;
1101ae08745Sheppo 
111*023e71deSHaik Aftandilian typedef struct platsvc_suspend_req {
112*023e71deSHaik Aftandilian 	uint64_t	req_num;
113*023e71deSHaik Aftandilian 	uint64_t	type;
114*023e71deSHaik Aftandilian } platsvc_suspend_req_t;
115*023e71deSHaik Aftandilian 
116*023e71deSHaik Aftandilian typedef struct platsvc_suspend_resp {
117*023e71deSHaik Aftandilian 	uint64_t	req_num;
118*023e71deSHaik Aftandilian 	uint32_t	result;
119*023e71deSHaik Aftandilian 	uint32_t	rec_result;
120*023e71deSHaik Aftandilian 	char		reason[MAX_REASON_SIZE];
121*023e71deSHaik Aftandilian } platsvc_suspend_resp_t;
122*023e71deSHaik Aftandilian 
1231ae08745Sheppo #ifdef __cplusplus
1241ae08745Sheppo }
1251ae08745Sheppo #endif
1261ae08745Sheppo 
1271ae08745Sheppo #endif /* _PLATSVC_H */
128