16683 pthread_cond_timedwait broken when using static initializer
[illumos-gate.git] / usr / src / uts / common / sys / ppmio.h
blobb25edce9030ca7b4fda4209dcbfab419aa449eb8
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_PPMIO_H
27 #define _SYS_PPMIO_H
29 #include <sys/types.h>
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #define PPMIOC ('p' << 8)
36 #define PPMIOCSET (PPMIOC | 1)
37 #define PPMIOCGET (PPMIOC | 2)
38 #define PPMGET_DPWR (PPMIOC | 3)
39 #define PPMGET_DOMBYDEV (PPMIOC | 4)
40 #define PPMGET_DEVBYDOM (PPMIOC | 5)
42 * The following two ioctls are used for testing purposes only.
44 #if defined(__x86)
45 #define PPMGET_NORMAL (PPMIOC | 6)
46 #define PPMSET_NORMAL (PPMIOC | 7)
47 #endif
50 * PPMIOCGET
51 * Note: this ioctl command is available for Excalibur and Grover
52 * only, but will be removed in future, replacing with PPMGET_DPWR
54 typedef struct ppmreq {
55 int ppmdev;
56 union ppmop {
57 struct idev_power {
58 int level;
59 } idev_power;
60 } ppmop;
61 } ppmreq_t;
63 /* definition for ppmdev */
64 #define PPM_INTERNAL_DEVICE_POWER 1
67 * PPMGET_DPWR
69 struct ppm_dpwr {
70 char *domain; /* domain name */
71 int level; /* domain power level */
75 * PPMGET_DOMBYDEV
77 struct ppm_bydev {
78 char *path; /* device prom path */
79 char *domlist; /* domain names */
80 size_t size; /* size of domlist buffer */
84 * PPMGET_DEVBYDOM
86 struct ppm_bydom {
87 char *domain; /* domain name */
88 char *devlist; /* domain device list */
89 size_t size; /* size of devlist buffer */
93 * PPM[GS]ET_NORM
95 struct ppm_norm {
96 char *path; /* device prom path */
97 int norm; /* normal level */
100 #ifdef _SYSCALL32
102 * kernel view of ILP32 data structure
104 struct ppm_dpwr32 {
105 caddr32_t domain; /* domain name */
106 int32_t level; /* domain power level */
109 struct ppm_bydev32 {
110 caddr32_t path; /* device prom path */
111 caddr32_t domlist; /* domain names */
112 size32_t size; /* size of domlist buffer */
115 struct ppm_bydom32 {
116 caddr32_t domain; /* domain name */
117 caddr32_t devlist; /* domain device list */
118 size32_t size; /* size of devlist buffer */
121 struct ppm_norm32 {
122 caddr32_t path; /* device prom path */
123 int32_t norm; /* normal level */
125 #endif /* _SYSCALL32 */
128 * .level may be the following
130 #define PPMIO_POWER_OFF 0
131 #define PPMIO_POWER_ON 1
132 #define PPMIO_LED_BLINKING 2
133 #define PPMIO_LED_SOLIDON 3
134 /* (s10) */
135 #define PPM_IDEV_POWER_OFF PPMIO_POWER_OFF
136 #define PPM_IDEV_POWER_ON PPMIO_POWER_ON
139 #ifdef __cplusplus
141 #endif
143 #endif /* _SYS_PPMIO_H */