1 /* 2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 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 10 * may not be used to create, or enable the creation or redistribution of, 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. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 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 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 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. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 29 #ifndef __IOKIT_IOMESSAGE_H 30 #define __IOKIT_IOMESSAGE_H 31 32 #include <IOKit/IOReturn.h> 33 #include <IOKit/IOTypes.h> 34 35 /*! 36 * @header IOMessage.h 37 * 38 * Defines message type constants for several IOKit messaging API's. 39 * 40 */ 41 42 typedef UInt32 IOMessage; 43 44 #define iokit_common_msg(message) (UInt32)(sys_iokit|sub_iokit_common|message) 45 #define iokit_family_msg(sub, message) (UInt32)(sys_iokit|sub|message) 46 47 /*! 48 * @defined iokit_vendor_specific_msg 49 * @discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific 50 * subsystem. It can be used to generate messages that are used for private 51 * communication between vendor specific code with the IOService::message() etc. APIs. 52 */ 53 #define iokit_vendor_specific_msg(message) (UInt32)(sys_iokit|sub_iokit_vendor_specific|message) 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) 60 #define kIOMessageServiceIsAttemptingOpen iokit_common_msg(0x101) 61 #define kIOMessageServiceWasClosed iokit_common_msg(0x110) 62 63 #define kIOMessageServiceBusyStateChange iokit_common_msg(0x120) 64 65 #define kIOMessageConsoleSecurityChange iokit_common_msg(0x128) 66 67 #define kIOMessageServicePropertyChange iokit_common_msg(0x130) 68 69 #define kIOMessageCopyClientID iokit_common_msg(0x330) 70 71 #define kIOMessageSystemCapabilityChange iokit_common_msg(0x340) 72 #define kIOMessageDeviceSignaledWakeup iokit_common_msg(0x350) 73 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 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 */ 87 #define kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) 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 */ 95 #define kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) 96 97 /*! @group In-kernel system shutdown and restart notifications 98 */ 99 100 /*! 101 * @defined kIOMessageSystemWillPowerOff 102 * @discussion Indicates an imminent system shutdown. Recipients have a limited 103 * amount of time to respond, otherwise the system will timeout and 104 * shutdown even without a response. 105 * Delivered to in-kernel IOKit drivers via <code>IOService::systemWillShutdown()</code>, 106 * and to clients of <code>registerPrioritySleepWakeInterest()</code>. 107 * Never delivered to user space notification clients. 108 */ 109 #define kIOMessageSystemWillPowerOff iokit_common_msg(0x250) 110 111 /*! 112 * @defined kIOMessageSystemWillRestart 113 * @discussion Indicates an imminent system restart. Recipients have a limited 114 * amount of time to respond, otherwise the system will timeout and 115 * restart even without a response. 116 * Delivered to in-kernel IOKit drivers via <code>IOService::systemWillShutdown()</code>, 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 */ 143 #define kIOMessageCanSystemSleep iokit_common_msg(0x270) 144 145 /*! 146 * @defined kIOMessageSystemWillNotSleep 147 * @discussion Announces that the system has retracted a previous attempt to sleep; 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 */ 153 #define kIOMessageSystemWillNotSleep iokit_common_msg(0x290) 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 166 * @discussion Announces that the system is beginning to power the device tree; most 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 */ 172 #define kIOMessageSystemWillPowerOn iokit_common_msg(0x320) 173 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 186 /*! 187 * @defined kIOMessageCanDevicePowerOff 188 * @discussion Delivered to <code>kIOAppPowerStateInterest</code> clients of 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 194 /*! 195 * @defined kIOMessageDeviceWillNotPowerOff 196 * @discussion This IOKit interest notification is largely unused; 197 * it's not very interesting. 198 */ 199 #define kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) 200 201 /*! 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 225 226 #endif /* ! __IOKIT_IOMESSAGE_H */ 227