xref: /titanic_52/usr/src/uts/sun4v/sys/soft_state.h (revision a83cadce5d3331b64803bfc641036cec23602c74)
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 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_SOFT_STATE_H
28 #define	_SYS_SOFT_STATE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * sun4v Hypervisor Guest State API
34  */
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * String definitions for Solaris
42  */
43 
44 #define	SOLARIS_SOFT_STATE_BOOT_MSG_STR		"Solaris booting"
45 #define	SOLARIS_SOFT_STATE_RUN_MSG_STR		"Solaris running"
46 #define	SOLARIS_SOFT_STATE_HALT_MSG_STR		"Solaris halting"
47 #define	SOLARIS_SOFT_STATE_POWER_MSG_STR	"Solaris powering down"
48 #define	SOLARIS_SOFT_STATE_PANIC_MSG_STR	"Solaris panicking"
49 #define	SOLARIS_SOFT_STATE_REBOOT_MSG_STR	"Solaris rebooting"
50 #define	SOLARIS_SOFT_STATE_DEBUG_MSG_STR	"Solaris debugging"
51 #define	SSM_SIZE				32
52 
53 #ifndef _ASM
54 
55 extern char	soft_state_message_strings[][SSM_SIZE];
56 
57 #define	SOLARIS_SOFT_STATE_BOOT_MSG		soft_state_message_ra[0]
58 #define	SOLARIS_SOFT_STATE_RUN_MSG		soft_state_message_ra[1]
59 #define	SOLARIS_SOFT_STATE_HALT_MSG		soft_state_message_ra[2]
60 #define	SOLARIS_SOFT_STATE_POWER_MSG		soft_state_message_ra[3]
61 #define	SOLARIS_SOFT_STATE_PANIC_MSG		soft_state_message_ra[4]
62 #define	SOLARIS_SOFT_STATE_REBOOT_MSG		soft_state_message_ra[5]
63 #define	SOLARIS_SOFT_STATE_DEBUG_MSG		soft_state_message_ra[6]
64 #define	SOLARIS_SOFT_STATE_SAVED_MSG		soft_state_message_ra[7]
65 #define	SOLARIS_SOFT_STATE_MSG_CNT		8
66 
67 extern uint64_t	soft_state_message_ra[SOLARIS_SOFT_STATE_MSG_CNT];
68 
69 extern void mach_get_soft_state(uint64_t *state,
70 		uint64_t *string_ra);
71 
72 extern void mach_set_soft_state(uint64_t state,
73 		uint64_t *description_ra);
74 
75 extern void prom_sun4v_soft_state_supported(void);
76 
77 #endif	/* _ASM */
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif /* _SYS_SOFT_STATE_H */
84