2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
36 #ifndef _IOKIT_IOSERVICEPRIVATE_H
37 #define _IOKIT_IOSERVICEPRIVATE_H
39 // options for getExistingServices()
41 kIONotifyOnce
= 0x00000001,
42 kIOServiceExistingSet
= 0x00000002,
43 kIOServiceChangesOK
= 0x00000004,
44 kIOServiceInternalDone
= 0x00000008,
45 kIOServiceClassDone
= 0x00000010,
48 // masks for __state[1]
50 kIOServiceBusyStateMask
= 0x000000ff,
51 kIOServiceBusyMax
= 255,
52 kIOServiceNeedConfigState
= 0x80000000,
53 kIOServiceSynchronousState
= 0x40000000,
54 kIOServiceModuleStallState
= 0x20000000,
55 kIOServiceBusyWaiterState
= 0x10000000,
57 kIOServiceSyncPubState
= 0x08000000,
58 kIOServiceConfigState
= 0x04000000,
59 kIOServiceStartState
= 0x02000000,
60 kIOServiceTermPhase2State
= 0x01000000,
61 kIOServiceTermPhase3State
= 0x00800000,
62 kIOServiceTermPhase1State
= 0x00400000,
63 kIOServiceTerm1WaiterState
= 0x00200000,
64 kIOServiceRecursing
= 0x00100000,
65 kIOServiceNeedWillTerminate
= 0x00080000,
70 kIOServiceNotifyEnable
= 0x00000001,
71 kIOServiceNotifyWaiter
= 0x00000002
74 struct _IOServiceNotifierInvocation
80 class _IOServiceNotifier
: public IONotifier
82 friend class IOService
;
84 OSDeclareDefaultStructors(_IOServiceNotifier
)
87 OSOrderedSet
* whence
;
89 OSDictionary
* matching
;
90 IOServiceMatchingNotificationHandler handler
;
91 IOServiceNotificationHandler compatHandler
;
95 queue_head_t handlerInvocations
;
99 virtual void remove();
100 virtual bool disable();
101 virtual void enable( bool was
);
105 class _IOServiceInterestNotifier
: public IONotifier
107 friend class IOService
;
109 OSDeclareDefaultStructors(_IOServiceInterestNotifier
)
114 IOServiceInterestHandler handler
;
117 queue_head_t handlerInvocations
;
121 virtual void remove();
122 virtual bool disable();
123 virtual void enable( bool was
);
128 class _IOConfigThread
: public OSObject
130 friend class IOService
;
132 OSDeclareDefaultStructors(_IOConfigThread
)
137 static void configThread( void );
138 static void main( void * arg
, wait_result_t result
);
142 kMaxConfigThreads
= CONFIG_MAX_THREADS
,
149 class _IOServiceJob
: public OSObject
151 friend class IOService
;
153 OSDeclareDefaultStructors(_IOServiceJob
)
158 IOOptionBits options
;
160 static _IOServiceJob
* startJob( IOService
* nub
, int type
,
161 IOOptionBits options
= 0 );
162 static void pingConfig( class _IOServiceJob
* job
);
166 class IOResources
: public IOService
168 friend class IOService
;
170 OSDeclareDefaultStructors(IOResources
)
173 static IOService
* resources( void );
174 virtual bool init( OSDictionary
* dictionary
= 0 );
175 virtual IOWorkLoop
* getWorkLoop( ) const;
176 virtual bool matchPropertyTable( OSDictionary
* table
);
177 virtual IOReturn
setProperties( OSObject
* properties
);
180 class _IOOpenServiceIterator
: public OSIterator
182 friend class IOService
;
184 OSDeclareDefaultStructors(_IOOpenServiceIterator
)
187 const IOService
* client
;
188 const IOService
* provider
;
192 static OSIterator
* iterator( OSIterator
* _iter
,
193 const IOService
* client
,
194 const IOService
* provider
);
196 virtual void reset();
197 virtual bool isValid();
198 virtual OSObject
* getNextObject();
201 extern const OSSymbol
* gIOConsoleUsersKey
;
202 extern const OSSymbol
* gIOConsoleSessionUIDKey
;
203 extern const OSSymbol
* gIOConsoleSessionAuditIDKey
;
204 extern const OSSymbol
* gIOConsoleSessionOnConsoleKey
;
205 extern const OSSymbol
* gIOConsoleSessionSecureInputPIDKey
;
207 #endif /* ! _IOKIT_IOSERVICEPRIVATE_H */