2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
31 #ifndef _IOKIT_IOSERVICEPRIVATE_H
32 #define _IOKIT_IOSERVICEPRIVATE_H
34 // options for getExistingServices()
36 kIONotifyOnce
= 0x00000001,
37 kIOServiceExistingSet
= 0x00000002
40 // masks for __state[1]
42 kIOServiceBusyStateMask
= 0x000000ff,
43 kIOServiceBusyMax
= 255,
44 kIOServiceNeedConfigState
= 0x80000000,
45 kIOServiceSynchronousState
= 0x40000000,
46 kIOServiceModuleStallState
= 0x20000000,
47 kIOServiceBusyWaiterState
= 0x10000000,
49 kIOServiceSyncPubState
= 0x08000000,
50 kIOServiceConfigState
= 0x04000000,
51 kIOServiceTermPhase2State
= 0x01000000,
52 kIOServiceTermPhase3State
= 0x00800000,
55 // options for terminate()
57 kIOServiceRecursing
= 0x00100000,
62 kIOServiceNotifyEnable
= 0x00000001,
63 kIOServiceNotifyWaiter
= 0x00000002
66 struct _IOServiceNotifierInvocation
72 class _IOServiceNotifier
: public IONotifier
74 friend class IOService
;
76 OSDeclareDefaultStructors(_IOServiceNotifier
)
79 OSOrderedSet
* whence
;
81 OSDictionary
* matching
;
82 IOServiceNotificationHandler handler
;
86 queue_head_t handlerInvocations
;
90 virtual void remove();
91 virtual bool disable();
92 virtual void enable( bool was
);
96 class _IOServiceInterestNotifier
: public IONotifier
98 friend class IOService
;
100 OSDeclareDefaultStructors(_IOServiceInterestNotifier
)
105 IOServiceInterestHandler handler
;
108 queue_head_t handlerInvocations
;
112 virtual void remove();
113 virtual bool disable();
114 virtual void enable( bool was
);
118 class _IOConfigThread
: public OSObject
120 friend class IOService
;
122 OSDeclareDefaultStructors(_IOConfigThread
)
127 static void configThread( void );
128 static void main( _IOConfigThread
* self
);
132 #ifdef LESS_THREAD_CREATE
133 kMaxConfigThreads
= 4,
135 kMaxConfigThreads
= 32,
143 class _IOServiceJob
: public OSObject
145 friend class IOService
;
147 OSDeclareDefaultStructors(_IOServiceJob
)
152 IOOptionBits options
;
154 static _IOServiceJob
* startJob( IOService
* nub
, int type
,
155 IOOptionBits options
= 0 );
156 static void pingConfig( class _IOServiceJob
* job
);
160 class IOResources
: public IOService
162 friend class IOService
;
164 OSDeclareDefaultStructors(IOResources
)
167 static IOService
* resources( void );
168 virtual IOWorkLoop
* getWorkLoop( ) const;
169 virtual bool matchPropertyTable( OSDictionary
* table
);
170 virtual IOReturn
setProperties( OSObject
* properties
);
173 class _IOOpenServiceIterator
: public OSIterator
175 friend class IOService
;
177 OSDeclareDefaultStructors(_IOOpenServiceIterator
)
180 const IOService
* client
;
181 const IOService
* provider
;
185 static OSIterator
* iterator( OSIterator
* _iter
,
186 const IOService
* client
,
187 const IOService
* provider
);
189 virtual void reset();
190 virtual bool isValid();
191 virtual OSObject
* getNextObject();
194 extern const OSSymbol
* gIOConsoleUsersKey
;
195 extern const OSSymbol
* gIOConsoleSessionUIDKey
;
197 #endif /* ! _IOKIT_IOSERVICEPRIVATE_H */