]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/IOServicePrivate.h
xnu-792.13.8.tar.gz
[apple/xnu.git] / iokit / Kernel / IOServicePrivate.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
32 *
33 * HISTORY
34 *
35 */
36
37
38#ifndef _IOKIT_IOSERVICEPRIVATE_H
39#define _IOKIT_IOSERVICEPRIVATE_H
40
41// options for getExistingServices()
42enum {
91447636
A
43 kIONotifyOnce = 0x00000001,
44 kIOServiceExistingSet = 0x00000002
1c79356b
A
45};
46
47// masks for __state[1]
48enum {
49 kIOServiceBusyStateMask = 0x000000ff,
50 kIOServiceBusyMax = 255,
0b4e3aa0
A
51 kIOServiceNeedConfigState = 0x80000000,
52 kIOServiceSynchronousState = 0x40000000,
53 kIOServiceModuleStallState = 0x20000000,
54 kIOServiceBusyWaiterState = 0x10000000,
55
56 kIOServiceSyncPubState = 0x08000000,
57 kIOServiceConfigState = 0x04000000,
58 kIOServiceTermPhase2State = 0x01000000,
59 kIOServiceTermPhase3State = 0x00800000,
1c79356b
A
60};
61
62// options for terminate()
63enum {
64 kIOServiceRecursing = 0x00100000,
65};
66
1c79356b
A
67// notify state
68enum {
0b4e3aa0
A
69 kIOServiceNotifyEnable = 0x00000001,
70 kIOServiceNotifyWaiter = 0x00000002
1c79356b
A
71};
72
73struct _IOServiceNotifierInvocation
74{
75 IOThread thread;
76 queue_chain_t link;
77};
78
79class _IOServiceNotifier : public IONotifier
80{
9bccf70c 81 friend class IOService;
1c79356b
A
82
83 OSDeclareDefaultStructors(_IOServiceNotifier)
84
85public:
86 OSOrderedSet * whence;
87
88 OSDictionary * matching;
89 IOServiceNotificationHandler handler;
90 void * target;
91 void * ref;
92 SInt32 priority;
93 queue_head_t handlerInvocations;
94 IOOptionBits state;
95
96 virtual void free();
97 virtual void remove();
98 virtual bool disable();
99 virtual void enable( bool was );
100 virtual void wait();
101};
102
103class _IOServiceInterestNotifier : public IONotifier
104{
9bccf70c 105 friend class IOService;
1c79356b
A
106
107 OSDeclareDefaultStructors(_IOServiceInterestNotifier)
108
109public:
91447636 110 queue_chain_t chain;
1c79356b
A
111
112 IOServiceInterestHandler handler;
113 void * target;
114 void * ref;
115 queue_head_t handlerInvocations;
116 IOOptionBits state;
117
118 virtual void free();
119 virtual void remove();
120 virtual bool disable();
121 virtual void enable( bool was );
122 virtual void wait();
123};
124
125class _IOConfigThread : public OSObject
126{
9bccf70c 127 friend class IOService;
1c79356b
A
128
129 OSDeclareDefaultStructors(_IOConfigThread)
130
131public:
1c79356b
A
132 virtual void free();
133
91447636 134 static void configThread( void );
1c79356b
A
135 static void main( _IOConfigThread * self );
136};
137
138enum {
139#ifdef LESS_THREAD_CREATE
140 kMaxConfigThreads = 4,
141#else
142 kMaxConfigThreads = 32,
143#endif
144};
145
146enum {
147 kMatchNubJob = 10,
1c79356b
A
148};
149
150class _IOServiceJob : public OSObject
151{
9bccf70c 152 friend class IOService;
1c79356b
A
153
154 OSDeclareDefaultStructors(_IOServiceJob)
155
156public:
157 int type;
158 IOService * nub;
159 IOOptionBits options;
160
161 static _IOServiceJob * startJob( IOService * nub, int type,
162 IOOptionBits options = 0 );
163 static void pingConfig( class _IOServiceJob * job );
164
165};
166
167class IOResources : public IOService
168{
9bccf70c 169 friend class IOService;
1c79356b
A
170
171 OSDeclareDefaultStructors(IOResources)
172
173public:
174 static IOService * resources( void );
175 virtual IOWorkLoop * getWorkLoop( ) const;
176 virtual bool matchPropertyTable( OSDictionary * table );
9bccf70c 177 virtual IOReturn setProperties( OSObject * properties );
1c79356b
A
178};
179
180class _IOOpenServiceIterator : public OSIterator
181{
9bccf70c 182 friend class IOService;
1c79356b
A
183
184 OSDeclareDefaultStructors(_IOOpenServiceIterator)
185
186 OSIterator * iter;
187 const IOService * client;
188 const IOService * provider;
189 IOService * last;
190
191public:
192 static OSIterator * iterator( OSIterator * _iter,
193 const IOService * client,
194 const IOService * provider );
195 virtual void free();
196 virtual void reset();
197 virtual bool isValid();
198 virtual OSObject * getNextObject();
199};
200
55e303ae
A
201extern const OSSymbol * gIOConsoleUsersKey;
202extern const OSSymbol * gIOConsoleSessionUIDKey;
203
1c79356b
A
204#endif /* ! _IOKIT_IOSERVICEPRIVATE_H */
205