xref: /titanic_41/usr/src/cmd/power/powerd.h (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 
23 /* Copyright (c) 1994 - 2001 by Sun Microsystems, Inc.	*/
24 /* All rights reserved.					*/
25 
26 #ifndef _POWERD_H
27 #define	_POWERD_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * path shared by powerd and pmconfig
37  */
38 #define	PIDPATH	"/var/run/powerd.pid"
39 
40 /*
41  * AutoShutdown configuration data
42  */
43 struct pwr_info {
44 	int	pd_flags;		/* Status of powerd */
45 	int	pd_idle_time;		/* in minutes */
46 	int	pd_start_time;		/* in minutes since midnight */
47 	int	pd_finish_time;		/* in minutes since midnight */
48 
49 	int	pd_autoresume;		/* Autoresume active */
50 	int	pd_autoshutdown;	/* Autoshutdown active */
51 
52 	int	pd_ttychars_idle;	/* Tty chars idle time */
53 	int	pd_ttychars_sum;	/* Sum of tty chars */
54 	int	pd_loadaverage_idle;	/* Load average idle time */
55 	float	pd_loadaverage;		/* Load average */
56 	int	pd_diskreads_idle;	/* Disk reads idle time */
57 	int	pd_diskreads_sum;	/* Sum of disk reads */
58 	int	pd_nfsreqs_idle;	/* NFS requests idle time */
59 	int	pd_nfsreqs_sum;		/* Sum of NFS requests */
60 };
61 typedef struct pwr_info pwr_info_t;
62 
63 /* Various status flags for pd_flags */
64 #define	PD_AC		0x02
65 #define	PD_AUTORESUME	0x04
66 #define	PD_RESUME_ON	0x08
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _POWERD_H */
73