]> git.saurik.com Git - apple/xnu.git/blame - iokit/IOKit/IOMessage.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / iokit / IOKit / IOMessage.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
0a7de745 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
fe8ab488 10 * may not be used to create, or enable the creation or redistribution of,
2d21ac55
A
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
0a7de745 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
0a7de745 17 *
2d21ac55
A
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
0a7de745 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28
29#ifndef __IOKIT_IOMESSAGE_H
30#define __IOKIT_IOMESSAGE_H
31
32#include <IOKit/IOReturn.h>
33#include <IOKit/IOTypes.h>
34
6d2010ae
A
35/*!
36 * @header IOMessage.h
37 *
38 * Defines message type constants for several IOKit messaging API's.
39 *
40 */
41
1c79356b
A
42typedef UInt32 IOMessage;
43
91447636 44#define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message)
0a7de745 45#define iokit_family_msg(sub, message) (UInt32)(sys_iokit|sub|message)
91447636 46
0a7de745 47/*!
6d2010ae
A
48 * @defined iokit_vendor_specific_msg
49 * @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific
0a7de745 50 * subsystem. It can be used to generate messages that are used for private
6d2010ae
A
51 * communication between vendor specific code with the IOService::message() etc. APIs.
52 */
91447636 53#define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message)
1c79356b
A
54
55#define kIOMessageServiceIsTerminated iokit_common_msg(0x010)
56#define kIOMessageServiceIsSuspended iokit_common_msg(0x020)
57#define kIOMessageServiceIsResumed iokit_common_msg(0x030)
58
59#define kIOMessageServiceIsRequestingClose iokit_common_msg(0x100)
0b4e3aa0 60#define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101)
1c79356b
A
61#define kIOMessageServiceWasClosed iokit_common_msg(0x110)
62
63#define kIOMessageServiceBusyStateChange iokit_common_msg(0x120)
64
6d2010ae
A
65#define kIOMessageConsoleSecurityChange iokit_common_msg(0x128)
66
55e303ae
A
67#define kIOMessageServicePropertyChange iokit_common_msg(0x130)
68
6d2010ae
A
69#define kIOMessageCopyClientID iokit_common_msg(0x330)
70
71#define kIOMessageSystemCapabilityChange iokit_common_msg(0x340)
72#define kIOMessageDeviceSignaledWakeup iokit_common_msg(0x350)
73
cb323159
A
74#ifdef KERNEL_PRIVATE
75// sent to IOUserClients with the property kIOUserClientMessageAppSuspendedKey
76// when their task's app suspend state changes;
77// use task_is_app_suspended() to retrieve the owning task's current state
78#define kIOMessageTaskAppSuspendedChange iokit_common_msg(0x800)
79#endif
6d2010ae
A
80
81/*!
82 * @defined kIOMessageDeviceWillPowerOff
83 * @discussion Indicates the device is about to move to a lower power state.
84 * Sent to IOKit interest notification clients of type <code>kIOAppPowerStateInterest</code>
85 * and <code>kIOGeneralInterest</code>.
86 */
1c79356b 87#define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210)
6d2010ae
A
88
89/*!
90 * @defined kIOMessageDeviceHasPoweredOn
91 * @discussion Indicates the device has just moved to a higher power state.
92 * Sent to IOKit interest notification clients of type <code>kIOAppPowerStateInterest</code>
93 * and <code>kIOGeneralInterest</code>.
94 */
1c79356b 95#define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230)
0b4c1975 96
6d2010ae
A
97/*! @group In-kernel system shutdown and restart notifications
98 */
0b4c1975 99
6d2010ae
A
100/*!
101 * @defined kIOMessageSystemWillPowerOff
0a7de745
A
102 * @discussion Indicates an imminent system shutdown. Recipients have a limited
103 * amount of time to respond, otherwise the system will timeout and
6d2010ae 104 * shutdown even without a response.
0a7de745 105 * Delivered to in-kernel IOKit drivers via <code>IOService::systemWillShutdown()</code>,
6d2010ae
A
106 * and to clients of <code>registerPrioritySleepWakeInterest()</code>.
107 * Never delivered to user space notification clients.
108 */
1c79356b 109#define kIOMessageSystemWillPowerOff iokit_common_msg(0x250)
6d2010ae
A
110
111/*!
112 * @defined kIOMessageSystemWillRestart
0a7de745
A
113 * @discussion Indicates an imminent system restart. Recipients have a limited
114 * amount of time to respond, otherwise the system will timeout and
6d2010ae 115 * restart even without a response.
0a7de745 116 * Delivered to in-kernel IOKit drivers via <code>IOService::systemWillShutdown()</code>,
6d2010ae
A
117 * and to clients of <code>registerPrioritySleepWakeInterest()</code>.
118 * Never delivered to user space notification clients.
119 */
120#define kIOMessageSystemWillRestart iokit_common_msg(0x310)
121
122/*!
123 * @defined kIOMessageSystemPagingOff
124 * @discussion Indicates an imminent system shutdown, paging device now unavailable.
125 * Recipients have a limited amount of time to respond, otherwise the
126 * system will timeout and shutdown even without a response.
127 * Delivered to clients of <code>registerPrioritySleepWakeInterest()</code>.
128 * Never delivered to user space notification clients.
129 */
130#define kIOMessageSystemPagingOff iokit_common_msg(0x255)
131
132
133/*! @group System sleep and wake notifications
134 */
135
136/*!
137 * @defined kIOMessageCanSystemSleep
138 * @discussion Announces/Requests permission to proceed to system sleep.
139 * Delivered to in-kernel IOKit drivers via <code>kIOGeneralInterest</code>
140 * and <code>kIOPriorityPowerStateInterest</code>.
141 * Delivered to user clients of <code>IORegisterForSystemPower</code>.
142 */
1c79356b 143#define kIOMessageCanSystemSleep iokit_common_msg(0x270)
6d2010ae
A
144
145/*!
146 * @defined kIOMessageSystemWillNotSleep
0a7de745 147 * @discussion Announces that the system has retracted a previous attempt to sleep;
6d2010ae
A
148 * it follows <code>kIOMessageCanSystemSleep</code>.
149 * Delivered to in-kernel IOKit drivers via <code>kIOGeneralInterest</code>
150 * and <code>kIOPriorityPowerStateInterest</code>.
151 * Delivered to user clients of <code>IORegisterForSystemPower</code>.
152 */
1c79356b 153#define kIOMessageSystemWillNotSleep iokit_common_msg(0x290)
6d2010ae
A
154
155/*!
156 * @defined kIOMessageSystemWillSleep
157 * @discussion Announces that sleep is beginning.
158 * Delivered to in-kernel IOKit drivers via <code>kIOGeneralInterest</code>
159 * and <code>kIOPriorityPowerStateInterest</code>.
160 * Delivered to user clients of <code>IORegisterForSystemPower</code>.
161 */
162#define kIOMessageSystemWillSleep iokit_common_msg(0x280)
163
164/*!
165 * @defined kIOMessageSystemWillPowerOn
0a7de745 166 * @discussion Announces that the system is beginning to power the device tree; most
6d2010ae
A
167 * devices are unavailable at this point..
168 * Delivered to in-kernel IOKit drivers via <code>kIOGeneralInterest</code>
169 * and <code>kIOPriorityPowerStateInterest</code>.
170 * Delivered to user clients of <code>IORegisterForSystemPower</code>.
171 */
55e303ae 172#define kIOMessageSystemWillPowerOn iokit_common_msg(0x320)
1c79356b 173
6d2010ae
A
174/*!
175 * @defined kIOMessageSystemHasPoweredOn
176 * @discussion Announces that the system and its devices have woken up.
177 * Delivered to in-kernel IOKit drivers via <code>kIOGeneralInterest</code>
178 * and <code>kIOPriorityPowerStateInterest</code>.
179 * Delivered to user clients of <code>IORegisterForSystemPower</code>.
180 */
181#define kIOMessageSystemHasPoweredOn iokit_common_msg(0x300)
182
183/*! @group Unused and deprecated notifications
184 */
185
0a7de745 186/*!
6d2010ae 187 * @defined kIOMessageCanDevicePowerOff
0a7de745 188 * @discussion Delivered to <code>kIOAppPowerStateInterest</code> clients of
6d2010ae
A
189 * devices that implement their own idle timeouts.
190 * This message type is almost never used.
191 */
192#define kIOMessageCanDevicePowerOff iokit_common_msg(0x200)
193
0a7de745 194/*!
6d2010ae 195 * @defined kIOMessageDeviceWillNotPowerOff
0a7de745 196 * @discussion This IOKit interest notification is largely unused;
6d2010ae
A
197 * it's not very interesting.
198 */
199#define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220)
200
0a7de745 201/*!
6d2010ae
A
202 * @defined kIOMessageSystemWillNotPowerOff
203 * @deprecated This IOKit message is unused.
204 */
205#define kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260)
206
207/*!
208 * @defined kIOMessageCanSystemPowerOff
209 * @deprecated This IOKit message is unused.
210 */
211#define kIOMessageCanSystemPowerOff iokit_common_msg(0x240)
212
213/*!
214 * @defined kIOMessageDeviceWillPowerOn
215 * @discussion IOService power mgt does not send kIOMessageDeviceWillPowerOn.
216 */
217#define kIOMessageDeviceWillPowerOn iokit_common_msg(0x215)
218
219/*!
220 * @defined kIOMessageDeviceHasPoweredOff
221 * @discussion IOService power mgt does not send kIOMessageDeviceHasPoweredOff.
222 */
223#define kIOMessageDeviceHasPoweredOff iokit_common_msg(0x225)
224
2d21ac55 225
1c79356b 226#endif /* ! __IOKIT_IOMESSAGE_H */