xref: /illumos-gate/usr/src/uts/intel/os/cpr_intel.c (revision 2d6eb4a5)
1*2df1fe9cSrandyf /*
2*2df1fe9cSrandyf  * CDDL HEADER START
3*2df1fe9cSrandyf  *
4*2df1fe9cSrandyf  * The contents of this file are subject to the terms of the
5*2df1fe9cSrandyf  * Common Development and Distribution License (the "License").
6*2df1fe9cSrandyf  * You may not use this file except in compliance with the License.
7*2df1fe9cSrandyf  *
8*2df1fe9cSrandyf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2df1fe9cSrandyf  * or http://www.opensolaris.org/os/licensing.
10*2df1fe9cSrandyf  * See the License for the specific language governing permissions
11*2df1fe9cSrandyf  * and limitations under the License.
12*2df1fe9cSrandyf  *
13*2df1fe9cSrandyf  * When distributing Covered Code, include this CDDL HEADER in each
14*2df1fe9cSrandyf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2df1fe9cSrandyf  * If applicable, add the following below this CDDL HEADER, with the
16*2df1fe9cSrandyf  * fields enclosed by brackets "[]" replaced with your own identifying
17*2df1fe9cSrandyf  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2df1fe9cSrandyf  *
19*2df1fe9cSrandyf  * CDDL HEADER END
20*2df1fe9cSrandyf  */
21*2df1fe9cSrandyf /*
22*2df1fe9cSrandyf  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*2df1fe9cSrandyf  * Use is subject to license terms.
24*2df1fe9cSrandyf  */
25*2df1fe9cSrandyf 
26*2df1fe9cSrandyf /*
27*2df1fe9cSrandyf  * cpr functions for supported sparc platforms
28*2df1fe9cSrandyf  */
29*2df1fe9cSrandyf #include <sys/types.h>
30*2df1fe9cSrandyf #include <sys/systm.h>
31*2df1fe9cSrandyf #include <sys/cpr.h>
32*2df1fe9cSrandyf #include <sys/kmem.h>
33*2df1fe9cSrandyf #include <sys/errno.h>
34*2df1fe9cSrandyf 
35*2df1fe9cSrandyf /*
36*2df1fe9cSrandyf  * setup the original and new sets of property names/values
37*2df1fe9cSrandyf  * Not relevant to S3, which is all we support for now.
38*2df1fe9cSrandyf  */
39*2df1fe9cSrandyf /*ARGSUSED*/
40*2df1fe9cSrandyf int
cpr_default_setup(int alloc)41*2df1fe9cSrandyf cpr_default_setup(int alloc)
42*2df1fe9cSrandyf {
43*2df1fe9cSrandyf 	return (0);
44*2df1fe9cSrandyf }
45*2df1fe9cSrandyf 
46*2df1fe9cSrandyf void
cpr_send_notice(void)47*2df1fe9cSrandyf cpr_send_notice(void)
48*2df1fe9cSrandyf {
49*2df1fe9cSrandyf 	static char cstr[] = "\014" "\033[1P" "\033[18;21H";
50*2df1fe9cSrandyf 
51*2df1fe9cSrandyf 	prom_printf(cstr);
52*2df1fe9cSrandyf 	prom_printf("Saving System State. Please Wait... ");
53*2df1fe9cSrandyf }
54*2df1fe9cSrandyf 
55*2df1fe9cSrandyf void
cpr_spinning_bar(void)56*2df1fe9cSrandyf cpr_spinning_bar(void)
57*2df1fe9cSrandyf {
58*2df1fe9cSrandyf 	static char *spin_strings[] = { "|\b", "/\b", "-\b", "\\\b" };
59*2df1fe9cSrandyf 	static int idx;
60*2df1fe9cSrandyf 
61*2df1fe9cSrandyf 	prom_printf(spin_strings[idx]);
62*2df1fe9cSrandyf 	if (++idx == 4)
63*2df1fe9cSrandyf 		idx = 0;
64*2df1fe9cSrandyf }
65*2df1fe9cSrandyf 
66*2df1fe9cSrandyf void
cpr_resume_notice(void)67*2df1fe9cSrandyf cpr_resume_notice(void)
68*2df1fe9cSrandyf {
69*2df1fe9cSrandyf 	static char cstr[] = "\014" "\033[1P" "\033[18;21H";
70*2df1fe9cSrandyf 
71*2df1fe9cSrandyf 	prom_printf(cstr);
72*2df1fe9cSrandyf 	prom_printf("Restoring System State. Please Wait... ");
73*2df1fe9cSrandyf }
74