]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/IOReturn.h
xnu-344.49.tar.gz
[apple/xnu.git] / iokit / IOKit / IOReturn.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
27 *
28 * HISTORY
29 *
30 */
31
32 /*
33 * Core IOReturn values. Others may be family defined.
34 */
35
36 #ifndef __IOKIT_IORETURN_H
37 #define __IOKIT_IORETURN_H
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #include <mach/error.h>
44
45 typedef kern_return_t IOReturn;
46
47 #ifndef sys_iokit
48 #define sys_iokit err_system(0x38)
49 #endif /* sys_iokit */
50 #define sub_iokit_common err_sub(0)
51 #define sub_iokit_usb err_sub(1)
52 #define sub_iokit_firewire err_sub(2)
53 #define sub_iokit_block_storage err_sub(4)
54 #define sub_iokit_reserved err_sub(-1)
55 #define iokit_common_err(return) (sys_iokit|sub_iokit_common|return)
56 #define iokit_family_err(sub,return) (sys_iokit|sub|return)
57
58 #define kIOReturnSuccess KERN_SUCCESS // OK
59 #define kIOReturnError iokit_common_err(0x2bc) // general error
60 #define kIOReturnNoMemory iokit_common_err(0x2bd) // can't allocate memory
61 #define kIOReturnNoResources iokit_common_err(0x2be) // resource shortage
62 #define kIOReturnIPCError iokit_common_err(0x2bf) // error during IPC
63 #define kIOReturnNoDevice iokit_common_err(0x2c0) // no such device
64 #define kIOReturnNotPrivileged iokit_common_err(0x2c1) // privilege violation
65 #define kIOReturnBadArgument iokit_common_err(0x2c2) // invalid argument
66 #define kIOReturnLockedRead iokit_common_err(0x2c3) // device read locked
67 #define kIOReturnLockedWrite iokit_common_err(0x2c4) // device write locked
68 #define kIOReturnExclusiveAccess iokit_common_err(0x2c5) // exclusive access and
69 // device already open
70 #define kIOReturnBadMessageID iokit_common_err(0x2c6) // sent/received messages
71 // had different msg_id
72 #define kIOReturnUnsupported iokit_common_err(0x2c7) // unsupported function
73 #define kIOReturnVMError iokit_common_err(0x2c8) // misc. VM failure
74 #define kIOReturnInternalError iokit_common_err(0x2c9) // internal error
75 #define kIOReturnIOError iokit_common_err(0x2ca) // General I/O error
76 //#define kIOReturn???Error iokit_common_err(0x2cb) // ???
77 #define kIOReturnCannotLock iokit_common_err(0x2cc) // can't acquire lock
78 #define kIOReturnNotOpen iokit_common_err(0x2cd) // device not open
79 #define kIOReturnNotReadable iokit_common_err(0x2ce) // read not supported
80 #define kIOReturnNotWritable iokit_common_err(0x2cf) // write not supported
81 #define kIOReturnNotAligned iokit_common_err(0x2d0) // alignment error
82 #define kIOReturnBadMedia iokit_common_err(0x2d1) // Media Error
83 #define kIOReturnStillOpen iokit_common_err(0x2d2) // device(s) still open
84 #define kIOReturnRLDError iokit_common_err(0x2d3) // rld failure
85 #define kIOReturnDMAError iokit_common_err(0x2d4) // DMA failure
86 #define kIOReturnBusy iokit_common_err(0x2d5) // Device Busy
87 #define kIOReturnTimeout iokit_common_err(0x2d6) // I/O Timeout
88 #define kIOReturnOffline iokit_common_err(0x2d7) // device offline
89 #define kIOReturnNotReady iokit_common_err(0x2d8) // not ready
90 #define kIOReturnNotAttached iokit_common_err(0x2d9) // device not attached
91 #define kIOReturnNoChannels iokit_common_err(0x2da) // no DMA channels left
92 #define kIOReturnNoSpace iokit_common_err(0x2db) // no space for data
93 //#define kIOReturn???Error iokit_common_err(0x2dc) // ???
94 #define kIOReturnPortExists iokit_common_err(0x2dd) // port already exists
95 #define kIOReturnCannotWire iokit_common_err(0x2de) // can't wire down
96 // physical memory
97 #define kIOReturnNoInterrupt iokit_common_err(0x2df) // no interrupt attached
98 #define kIOReturnNoFrames iokit_common_err(0x2e0) // no DMA frames enqueued
99 #define kIOReturnMessageTooLarge iokit_common_err(0x2e1) // oversized msg received
100 // on interrupt port
101 #define kIOReturnNotPermitted iokit_common_err(0x2e2) // not permitted
102 #define kIOReturnNoPower iokit_common_err(0x2e3) // no power to device
103 #define kIOReturnNoMedia iokit_common_err(0x2e4) // media not present
104 #define kIOReturnUnformattedMedia iokit_common_err(0x2e5)// media not formatted
105 #define kIOReturnUnsupportedMode iokit_common_err(0x2e6) // no such mode
106 #define kIOReturnUnderrun iokit_common_err(0x2e7) // data underrun
107 #define kIOReturnOverrun iokit_common_err(0x2e8) // data overrun
108 #define kIOReturnDeviceError iokit_common_err(0x2e9) // the device is not working properly!
109 #define kIOReturnNoCompletion iokit_common_err(0x2ea) // a completion routine is required
110 #define kIOReturnAborted iokit_common_err(0x2eb) // operation aborted
111 #define kIOReturnNoBandwidth iokit_common_err(0x2ec) // bus bandwidth would be exceeded
112 #define kIOReturnNotResponding iokit_common_err(0x2ed) // device not responding
113 #define kIOReturnIsoTooOld iokit_common_err(0x2ee) // isochronous I/O request for distant past!
114 #define kIOReturnIsoTooNew iokit_common_err(0x2ef) // isochronous I/O request for distant future
115 #define kIOReturnNotFound iokit_common_err(0x2f0) // data was not found
116 #define kIOReturnInvalid iokit_common_err(0x1) // should never be seen
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122 #endif /* ! __IOKIT_IORETURN_H */