2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
30 #ifndef _IOKIT_IOSERVICEPRIVATE_H
31 #define _IOKIT_IOSERVICEPRIVATE_H
33 // options for getExistingServices()
35 kIONotifyOnce
= 0x00000001,
36 kIOServiceExistingSet
= 0x00000002
39 // masks for __state[1]
41 kIOServiceBusyStateMask
= 0x000000ff,
42 kIOServiceBusyMax
= 255,
43 kIOServiceNeedConfigState
= 0x80000000,
44 kIOServiceSynchronousState
= 0x40000000,
45 kIOServiceModuleStallState
= 0x20000000,
46 kIOServiceBusyWaiterState
= 0x10000000,
48 kIOServiceSyncPubState
= 0x08000000,
49 kIOServiceConfigState
= 0x04000000,
50 kIOServiceTermPhase2State
= 0x01000000,
51 kIOServiceTermPhase3State
= 0x00800000,
54 // options for terminate()
56 kIOServiceRecursing
= 0x00100000,
61 kIOServiceNotifyEnable
= 0x00000001,
62 kIOServiceNotifyWaiter
= 0x00000002
65 struct _IOServiceNotifierInvocation
71 class _IOServiceNotifier
: public IONotifier
73 friend class IOService
;
75 OSDeclareDefaultStructors(_IOServiceNotifier
)
78 OSOrderedSet
* whence
;
80 OSDictionary
* matching
;
81 IOServiceNotificationHandler handler
;
85 queue_head_t handlerInvocations
;
89 virtual void remove();
90 virtual bool disable();
91 virtual void enable( bool was
);
95 class _IOServiceInterestNotifier
: public IONotifier
97 friend class IOService
;
99 OSDeclareDefaultStructors(_IOServiceInterestNotifier
)
104 IOServiceInterestHandler handler
;
107 queue_head_t handlerInvocations
;
111 virtual void remove();
112 virtual bool disable();
113 virtual void enable( bool was
);
117 class _IOConfigThread
: public OSObject
119 friend class IOService
;
121 OSDeclareDefaultStructors(_IOConfigThread
)
126 static void configThread( void );
127 static void main( _IOConfigThread
* self
);
131 #ifdef LESS_THREAD_CREATE
132 kMaxConfigThreads
= 4,
134 kMaxConfigThreads
= 32,
142 class _IOServiceJob
: public OSObject
144 friend class IOService
;
146 OSDeclareDefaultStructors(_IOServiceJob
)
151 IOOptionBits options
;
153 static _IOServiceJob
* startJob( IOService
* nub
, int type
,
154 IOOptionBits options
= 0 );
155 static void pingConfig( class _IOServiceJob
* job
);
159 class IOResources
: public IOService
161 friend class IOService
;
163 OSDeclareDefaultStructors(IOResources
)
166 static IOService
* resources( void );
167 virtual IOWorkLoop
* getWorkLoop( ) const;
168 virtual bool matchPropertyTable( OSDictionary
* table
);
169 virtual IOReturn
setProperties( OSObject
* properties
);
172 class _IOOpenServiceIterator
: public OSIterator
174 friend class IOService
;
176 OSDeclareDefaultStructors(_IOOpenServiceIterator
)
179 const IOService
* client
;
180 const IOService
* provider
;
184 static OSIterator
* iterator( OSIterator
* _iter
,
185 const IOService
* client
,
186 const IOService
* provider
);
188 virtual void reset();
189 virtual bool isValid();
190 virtual OSObject
* getNextObject();
193 extern const OSSymbol
* gIOConsoleUsersKey
;
194 extern const OSSymbol
* gIOConsoleSessionUIDKey
;
196 #endif /* ! _IOKIT_IOSERVICEPRIVATE_H */