Root/
Source at commit 2741 created 8 years 11 months ago. By ifabio, Add data for new logo and clut (grey) from macosxbootloader (Credits to Pike R. Alpha) | |
---|---|
1 | /*␊ |
2 | * IOStreamShared.h␊ |
3 | * IOStreamFamily␊ |
4 | *␊ |
5 | * Copyright 2006 Apple Computer, Inc. All rights reserved.␊ |
6 | *␊ |
7 | */␊ |
8 | ␊ |
9 | #if !defined(__IOKIT_IOSTREAMSHARED_H)␊ |
10 | #define __IOKIT_IOSTREAMSHARED_H␊ |
11 | ␊ |
12 | #include <sys/cdefs.h>␊ |
13 | ␊ |
14 | #include <IOKit/IOTypes.h>␊ |
15 | ␊ |
16 | /*!␊ |
17 | @header IOStreamShared.h␊ |
18 | IOStream definitions shared between kernel and user space.␊ |
19 | */␊ |
20 | ␊ |
21 | __BEGIN_DECLS ␊ |
22 | ␊ |
23 | // Buffer numbers are guaranteed to go from 0 to bufferCount - 1.␊ |
24 | /*!␊ |
25 | @typedef IOStreamBufferID␊ |
26 | */␊ |
27 | typedef UInt32 IOStreamBufferID;␊ |
28 | #define kIOStreamBufferIDInvalid (~0)␊ |
29 | ␊ |
30 | // This is the header for the shared-memory queue used to send buffer notifications␊ |
31 | // from kernel to user space or vice versa.␊ |
32 | ␊ |
33 | // Queue entry in input or output queue␊ |
34 | ␊ |
35 | #ifdef __cplusplus␊ |
36 | ␊ |
37 | /*!␊ |
38 | @struct IOStreamBufferQueueEntry␊ |
39 | @field bufferID The ID of the buffer passed in this queue entry.␊ |
40 | @field dataLength The length of the valid data in the buffer.␊ |
41 | @field reserved Reserved for future use.␊ |
42 | */␊ |
43 | ␊ |
44 | struct IOStreamBufferQueueEntry {␊ |
45 | IOStreamBufferID bufferID;␊ |
46 | UInt32 dataOffset;␊ |
47 | UInt32 dataLength;␊ |
48 | UInt32 controlOffset;␊ |
49 | UInt32 controlLength;␊ |
50 | UInt32 reserved[3];␊ |
51 | };␊ |
52 | ␊ |
53 | ␊ |
54 | /*!␊ |
55 | @struct IOStreamBufferQueue␊ |
56 | @field entryCount The number of queue entries in the queue.␊ |
57 | @field headIndex The index of the next queue slot that will be filled in by the queue writer.␊ |
58 | @field tailIndex The index of the next queue slot that can be read by the queue reader.␊ |
59 | @field reserved Reserved for future use.␊ |
60 | @field queue The array of queue entries.␊ |
61 | */␊ |
62 | ␊ |
63 | struct IOStreamBufferQueue {␊ |
64 | UInt32 entryCount;␊ |
65 | volatile UInt32 headIndex;␊ |
66 | volatile UInt32 tailIndex;␊ |
67 | UInt32 reserved;␊ |
68 | IOStreamBufferQueueEntry queue[0];␊ |
69 | };␊ |
70 | ␊ |
71 | #else␊ |
72 | ␊ |
73 | typedef struct __IOStreamBufferQueueEntry {␊ |
74 | IOStreamBufferID bufferID;␊ |
75 | UInt32 dataOffset;␊ |
76 | UInt32 dataLength;␊ |
77 | UInt32 controlOffset;␊ |
78 | UInt32 controlLength;␊ |
79 | UInt32 reserved[3];␊ |
80 | } IOStreamBufferQueueEntry;␊ |
81 | ␊ |
82 | typedef struct __IOStreamBufferQueue {␊ |
83 | UInt32 entryCount;␊ |
84 | volatile UInt32 headIndex;␊ |
85 | volatile UInt32 tailIndex;␊ |
86 | UInt32 reserved;␊ |
87 | IOStreamBufferQueueEntry queue[0];␊ |
88 | } IOStreamBufferQueue;␊ |
89 | ␊ |
90 | #endif␊ |
91 | ␊ |
92 | /*!␊ |
93 | @enum Memory mapping types␊ |
94 | @constant kIOStreamMemoryTypeOutputQueue␊ |
95 | @constant kIOStreamMemoryTypeInputQueue␊ |
96 | @constant kIOStreamMemoryTypeBufferData␊ |
97 | @constant kIOStreamMemoryTypeBufferControl␊ |
98 | @constant kIOStreamBufferIDMask␊ |
99 | @constant kIOStreamMemoryTypeMask␊ |
100 | @abstract Memory types used with IOConnectMapMemory().␊ |
101 | */␊ |
102 | enum {␊ |
103 | kIOStreamMemoryTypeOutputQueue = 0x10000000,␊ |
104 | kIOStreamMemoryTypeInputQueue = 0x20000000,␊ |
105 | kIOStreamMemoryTypeBufferData = 0x30000000,␊ |
106 | kIOStreamMemoryTypeBufferControl = 0x40000000,␊ |
107 | kIOStreamBufferIDMask = 0x0FFFFFFF,␊ |
108 | kIOStreamMemoryTypeMask = 0xF0000000␊ |
109 | };␊ |
110 | ␊ |
111 | /*!␊ |
112 | @enum Mach port types␊ |
113 | @constant kIOStreamPortTypeOutput␊ |
114 | @constant kIOStreamPortTypeInput␊ |
115 | @abstract Port types used with IOConnectSetNotificationPort().␊ |
116 | */␊ |
117 | enum {␊ |
118 | kIOStreamPortTypeOutput,␊ |
119 | kIOStreamPortTypeInput␊ |
120 | };␊ |
121 | ␊ |
122 | /*!␊ |
123 | @enum IOStream open options␊ |
124 | */␊ |
125 | ␊ |
126 | enum {␊ |
127 | kIOStreamOptionOpenExclusive = 0x00010000,␊ |
128 | kIOStreamOptionOpenShared = 0x00020000␊ |
129 | };␊ |
130 | ␊ |
131 | /*!␊ |
132 | @enum User client methods␊ |
133 | @constant kIOStreamMethodOpen␊ |
134 | @constant kIOStreamMethodClose␊ |
135 | @constant kIOStreamMethodStart␊ |
136 | @constant kIOStreamMethodStop␊ |
137 | @constant kIOStreamMethodSuspend␊ |
138 | @constant kIOStreamMethodGetMode␊ |
139 | @constant kIOStreamMethodSetMode␊ |
140 | ␊ |
141 | @abstract Client method numbers used with IOConnectMethod...() functions.␊ |
142 | */␊ |
143 | enum {␊ |
144 | kIOStreamMethodOpen,␊ |
145 | kIOStreamMethodClose,␊ |
146 | kIOStreamMethodStart,␊ |
147 | kIOStreamMethodStop,␊ |
148 | kIOStreamMethodSuspend,␊ |
149 | kIOStreamMethodGetMode,␊ |
150 | kIOStreamMethodSetMode,␊ |
151 | kIOStreamMethodGetBufferCount␊ |
152 | };␊ |
153 | ␊ |
154 | /*!␊ |
155 | @enum User client traps␊ |
156 | @constant kIOStreamEnqueueInputTrap␊ |
157 | @constant kIOStreamEnqueueInputSyncTrap␊ |
158 | @abstract Client trap numbers used with IOConnectTrap..() functions.␊ |
159 | */␊ |
160 | enum {␊ |
161 | kIOStreamEnqueueInputTrap,␊ |
162 | kIOStreamEnqueueInputSyncTrap␊ |
163 | };␊ |
164 | ␊ |
165 | typedef enum {␊ |
166 | kIOStreamModeInput, // From user to kernel space␊ |
167 | kIOStreamModeOutput, // From kernel to user space␊ |
168 | kIOStreamModeInputOutput // bidirectional␊ |
169 | } IOStreamMode;␊ |
170 | ␊ |
171 | ␊ |
172 | __END_DECLS␊ |
173 | ␊ |
174 | #endif /* ! __IOKIT_IOSTREAMSHARED_H */␊ |
175 | ␊ |
176 |