]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/IOServicePrivate.h
xnu-1699.22.81.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 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
1c79356b 5 *
2d21ac55
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 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.
8f6c56a5 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
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.
8f6c56a5 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35
36#ifndef _IOKIT_IOSERVICEPRIVATE_H
37#define _IOKIT_IOSERVICEPRIVATE_H
38
39// options for getExistingServices()
40enum {
91447636
A
41 kIONotifyOnce = 0x00000001,
42 kIOServiceExistingSet = 0x00000002
1c79356b
A
43};
44
45// masks for __state[1]
46enum {
47 kIOServiceBusyStateMask = 0x000000ff,
48 kIOServiceBusyMax = 255,
0b4e3aa0
A
49 kIOServiceNeedConfigState = 0x80000000,
50 kIOServiceSynchronousState = 0x40000000,
51 kIOServiceModuleStallState = 0x20000000,
52 kIOServiceBusyWaiterState = 0x10000000,
53
54 kIOServiceSyncPubState = 0x08000000,
55 kIOServiceConfigState = 0x04000000,
56 kIOServiceTermPhase2State = 0x01000000,
57 kIOServiceTermPhase3State = 0x00800000,
6d2010ae
A
58 kIOServiceTermPhase1State = 0x00400000,
59 kIOServiceTerm1WaiterState = 0x00200000
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;
b0d623f7
A
89 IOServiceMatchingNotificationHandler handler;
90 IOServiceNotificationHandler compatHandler;
1c79356b
A
91 void * target;
92 void * ref;
93 SInt32 priority;
94 queue_head_t handlerInvocations;
95 IOOptionBits state;
96
97 virtual void free();
98 virtual void remove();
99 virtual bool disable();
100 virtual void enable( bool was );
101 virtual void wait();
102};
103
104class _IOServiceInterestNotifier : public IONotifier
105{
9bccf70c 106 friend class IOService;
1c79356b
A
107
108 OSDeclareDefaultStructors(_IOServiceInterestNotifier)
109
110public:
91447636 111 queue_chain_t chain;
1c79356b
A
112
113 IOServiceInterestHandler handler;
114 void * target;
115 void * ref;
116 queue_head_t handlerInvocations;
117 IOOptionBits state;
118
119 virtual void free();
120 virtual void remove();
121 virtual bool disable();
122 virtual void enable( bool was );
123 virtual void wait();
124};
125
126class _IOConfigThread : public OSObject
127{
9bccf70c 128 friend class IOService;
1c79356b
A
129
130 OSDeclareDefaultStructors(_IOConfigThread)
131
132public:
1c79356b
A
133 virtual void free();
134
91447636 135 static void configThread( void );
b0d623f7 136 static void main( void * arg, wait_result_t result );
1c79356b
A
137};
138
139enum {
2d21ac55 140 kMaxConfigThreads = CONFIG_MAX_THREADS,
1c79356b
A
141};
142
143enum {
144 kMatchNubJob = 10,
1c79356b
A
145};
146
147class _IOServiceJob : public OSObject
148{
9bccf70c 149 friend class IOService;
1c79356b
A
150
151 OSDeclareDefaultStructors(_IOServiceJob)
152
153public:
154 int type;
155 IOService * nub;
156 IOOptionBits options;
157
158 static _IOServiceJob * startJob( IOService * nub, int type,
159 IOOptionBits options = 0 );
160 static void pingConfig( class _IOServiceJob * job );
161
162};
163
164class IOResources : public IOService
165{
9bccf70c 166 friend class IOService;
1c79356b
A
167
168 OSDeclareDefaultStructors(IOResources)
169
170public:
171 static IOService * resources( void );
6d2010ae 172 virtual bool init( OSDictionary * dictionary = 0 );
1c79356b
A
173 virtual IOWorkLoop * getWorkLoop( ) const;
174 virtual bool matchPropertyTable( OSDictionary * table );
9bccf70c 175 virtual IOReturn setProperties( OSObject * properties );
1c79356b
A
176};
177
178class _IOOpenServiceIterator : public OSIterator
179{
9bccf70c 180 friend class IOService;
1c79356b
A
181
182 OSDeclareDefaultStructors(_IOOpenServiceIterator)
183
184 OSIterator * iter;
185 const IOService * client;
186 const IOService * provider;
187 IOService * last;
188
189public:
190 static OSIterator * iterator( OSIterator * _iter,
191 const IOService * client,
192 const IOService * provider );
193 virtual void free();
194 virtual void reset();
195 virtual bool isValid();
196 virtual OSObject * getNextObject();
197};
198
55e303ae
A
199extern const OSSymbol * gIOConsoleUsersKey;
200extern const OSSymbol * gIOConsoleSessionUIDKey;
6d2010ae 201extern const OSSymbol * gIOConsoleSessionAuditIDKey;
8f6c56a5
A
202extern const OSSymbol * gIOConsoleSessionOnConsoleKey;
203extern const OSSymbol * gIOConsoleSessionSecureInputPIDKey;
55e303ae 204
1c79356b
A
205#endif /* ! _IOKIT_IOSERVICEPRIVATE_H */
206