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
38 // masks for __state[1]
40 kIOServiceBusyStateMask
= 0x000000ff,
41 kIOServiceBusyMax
= 255,
42 kIOServiceNeedConfigState
= 0x80000000,
43 kIOServiceSynchronousState
= 0x40000000,
44 kIOServiceModuleStallState
= 0x20000000,
45 kIOServiceBusyWaiterState
= 0x10000000,
47 kIOServiceSyncPubState
= 0x08000000,
48 kIOServiceConfigState
= 0x04000000,
49 kIOServiceTermPhase2State
= 0x01000000,
50 kIOServiceTermPhase3State
= 0x00800000,
53 // options for terminate()
55 kIOServiceRecursing
= 0x00100000,
60 kIOServiceNotifyEnable
= 0x00000001,
61 kIOServiceNotifyWaiter
= 0x00000002
64 struct _IOServiceNotifierInvocation
70 class _IOServiceNotifier
: public IONotifier
72 friend class IOService
;
74 OSDeclareDefaultStructors(_IOServiceNotifier
)
77 OSOrderedSet
* whence
;
79 OSDictionary
* matching
;
80 IOServiceNotificationHandler handler
;
84 queue_head_t handlerInvocations
;
88 virtual void remove();
89 virtual bool disable();
90 virtual void enable( bool was
);
94 class _IOServiceInterestNotifier
: public IONotifier
96 friend class IOService
;
98 OSDeclareDefaultStructors(_IOServiceInterestNotifier
)
103 IOServiceInterestHandler handler
;
106 queue_head_t handlerInvocations
;
110 virtual void remove();
111 virtual bool disable();
112 virtual void enable( bool was
);
116 class _IOConfigThread
: public OSObject
118 friend class IOService
;
120 OSDeclareDefaultStructors(_IOConfigThread
)
127 static _IOConfigThread
* 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 #endif /* ! _IOKIT_IOSERVICEPRIVATE_H */