]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/IOServicePrivate.h
xnu-517.7.21.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 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
e5568f75
A
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.
1c79356b 11 *
e5568f75
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
e5568f75
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
24 *
25 * HISTORY
26 *
27 */
28
29
30#ifndef _IOKIT_IOSERVICEPRIVATE_H
31#define _IOKIT_IOSERVICEPRIVATE_H
32
33// options for getExistingServices()
34enum {
35 kIONotifyOnce = 0x00000001
36};
37
38// masks for __state[1]
39enum {
40 kIOServiceBusyStateMask = 0x000000ff,
41 kIOServiceBusyMax = 255,
0b4e3aa0
A
42 kIOServiceNeedConfigState = 0x80000000,
43 kIOServiceSynchronousState = 0x40000000,
44 kIOServiceModuleStallState = 0x20000000,
45 kIOServiceBusyWaiterState = 0x10000000,
46
47 kIOServiceSyncPubState = 0x08000000,
48 kIOServiceConfigState = 0x04000000,
49 kIOServiceTermPhase2State = 0x01000000,
50 kIOServiceTermPhase3State = 0x00800000,
1c79356b
A
51};
52
53// options for terminate()
54enum {
55 kIOServiceRecursing = 0x00100000,
56};
57
1c79356b
A
58// notify state
59enum {
0b4e3aa0
A
60 kIOServiceNotifyEnable = 0x00000001,
61 kIOServiceNotifyWaiter = 0x00000002
1c79356b
A
62};
63
64struct _IOServiceNotifierInvocation
65{
66 IOThread thread;
67 queue_chain_t link;
68};
69
70class _IOServiceNotifier : public IONotifier
71{
9bccf70c 72 friend class IOService;
1c79356b
A
73
74 OSDeclareDefaultStructors(_IOServiceNotifier)
75
76public:
77 OSOrderedSet * whence;
78
79 OSDictionary * matching;
80 IOServiceNotificationHandler handler;
81 void * target;
82 void * ref;
83 SInt32 priority;
84 queue_head_t handlerInvocations;
85 IOOptionBits state;
86
87 virtual void free();
88 virtual void remove();
89 virtual bool disable();
90 virtual void enable( bool was );
91 virtual void wait();
92};
93
94class _IOServiceInterestNotifier : public IONotifier
95{
9bccf70c 96 friend class IOService;
1c79356b
A
97
98 OSDeclareDefaultStructors(_IOServiceInterestNotifier)
99
100public:
101 OSArray * whence;
102
103 IOServiceInterestHandler handler;
104 void * target;
105 void * ref;
106 queue_head_t handlerInvocations;
107 IOOptionBits state;
108
109 virtual void free();
110 virtual void remove();
111 virtual bool disable();
112 virtual void enable( bool was );
113 virtual void wait();
114};
115
116class _IOConfigThread : public OSObject
117{
9bccf70c 118 friend class IOService;
1c79356b
A
119
120 OSDeclareDefaultStructors(_IOConfigThread)
121
122public:
123 IOThread thread;
124
125 virtual void free();
126
127 static _IOConfigThread * configThread( void );
128 static void main( _IOConfigThread * self );
129};
130
131enum {
132#ifdef LESS_THREAD_CREATE
133 kMaxConfigThreads = 4,
134#else
135 kMaxConfigThreads = 32,
136#endif
137};
138
139enum {
140 kMatchNubJob = 10,
1c79356b
A
141};
142
143class _IOServiceJob : public OSObject
144{
9bccf70c 145 friend class IOService;
1c79356b
A
146
147 OSDeclareDefaultStructors(_IOServiceJob)
148
149public:
150 int type;
151 IOService * nub;
152 IOOptionBits options;
153
154 static _IOServiceJob * startJob( IOService * nub, int type,
155 IOOptionBits options = 0 );
156 static void pingConfig( class _IOServiceJob * job );
157
158};
159
160class IOResources : public IOService
161{
9bccf70c 162 friend class IOService;
1c79356b
A
163
164 OSDeclareDefaultStructors(IOResources)
165
166public:
167 static IOService * resources( void );
168 virtual IOWorkLoop * getWorkLoop( ) const;
169 virtual bool matchPropertyTable( OSDictionary * table );
9bccf70c 170 virtual IOReturn setProperties( OSObject * properties );
1c79356b
A
171};
172
173class _IOOpenServiceIterator : public OSIterator
174{
9bccf70c 175 friend class IOService;
1c79356b
A
176
177 OSDeclareDefaultStructors(_IOOpenServiceIterator)
178
179 OSIterator * iter;
180 const IOService * client;
181 const IOService * provider;
182 IOService * last;
183
184public:
185 static OSIterator * iterator( OSIterator * _iter,
186 const IOService * client,
187 const IOService * provider );
188 virtual void free();
189 virtual void reset();
190 virtual bool isValid();
191 virtual OSObject * getNextObject();
192};
193
55e303ae
A
194extern const OSSymbol * gIOConsoleUsersKey;
195extern const OSSymbol * gIOConsoleSessionUIDKey;
196
1c79356b
A
197#endif /* ! _IOKIT_IOSERVICEPRIVATE_H */
198