]>
git.saurik.com Git - apple/xnu.git/blob - iokit/Kernel/IOEventSource.cpp
5f9fe156fff1580f0ce8654c4150ebcac87a099b
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
27 1998-7-13 Godfrey van der Linden(gvdl)
30 #include <IOKit/IOLib.h>
32 #include <IOKit/IOEventSource.h>
33 #include <IOKit/IOWorkLoop.h>
35 #define super OSObject
37 OSDefineMetaClassAndAbstractStructors(IOEventSource
, OSObject
)
38 OSMetaClassDefineReservedUnused(IOEventSource
, 0);
39 OSMetaClassDefineReservedUnused(IOEventSource
, 1);
40 OSMetaClassDefineReservedUnused(IOEventSource
, 2);
41 OSMetaClassDefineReservedUnused(IOEventSource
, 3);
42 OSMetaClassDefineReservedUnused(IOEventSource
, 4);
43 OSMetaClassDefineReservedUnused(IOEventSource
, 5);
44 OSMetaClassDefineReservedUnused(IOEventSource
, 6);
45 OSMetaClassDefineReservedUnused(IOEventSource
, 7);
47 /* inline function implementations */
48 void IOEventSource::signalWorkAvailable() { workLoop
->signalWorkAvailable(); }
49 void IOEventSource::openGate() { workLoop
->openGate(); }
50 void IOEventSource::closeGate() { workLoop
->closeGate(); }
51 bool IOEventSource::tryCloseGate() { return workLoop
->tryCloseGate(); }
52 int IOEventSource::sleepGate(void *event
, UInt32 type
)
53 { return workLoop
->sleepGate(event
, type
); }
54 void IOEventSource::wakeupGate(void *event
, bool oneThread
)
55 { workLoop
->wakeupGate(event
, oneThread
); }
57 bool IOEventSource::init(OSObject
*inOwner
,
68 (void) setAction(inAction
);
74 IOEventSource::Action
IOEventSource::getAction () const { return action
; };
76 void IOEventSource::setAction(Action inAction
)
81 IOEventSource
*IOEventSource::getNext() const { return eventChainNext
; };
83 void IOEventSource::setNext(IOEventSource
*inNext
)
85 eventChainNext
= inNext
;
88 void IOEventSource::enable()
92 return signalWorkAvailable();
95 void IOEventSource::disable()
100 bool IOEventSource::isEnabled() const
105 void IOEventSource::setWorkLoop(IOWorkLoop
*inWorkLoop
)
109 workLoop
= inWorkLoop
;
112 IOWorkLoop
*IOEventSource::getWorkLoop() const
117 bool IOEventSource::onThread() const
119 return (workLoop
!= 0) && workLoop
->onThread();