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 #include <IOKit/IOFilterInterruptEventSource.h>
30 #include <IOKit/IOService.h>
31 #include <IOKit/IOKitDebug.h>
32 #include <IOKit/IOTimeStamp.h>
33 #include <IOKit/IOWorkLoop.h>
35 #define super IOInterruptEventSource
37 OSDefineMetaClassAndStructors
38 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
39 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
40 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
41 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
42 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
43 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
44 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
45 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
46 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
49 * Implement the call throughs for the private protection conversion
51 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
53 IOService
*inProvider
,
59 IOInterruptEventSource
*
60 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
62 IOService
*inProvider
,
69 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
71 Filter inFilterAction
,
72 IOService
*inProvider
,
75 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
81 filterAction
= inFilterAction
;
85 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
86 ::filterInterruptEventSource(OSObject
*inOwner
,
88 Filter inFilterAction
,
89 IOService
*inProvider
,
92 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
95 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
103 void IOFilterInterruptEventSource::signalInterrupt()
105 bool trace
= (gIOKitTrace
& kIOTraceIntEventSource
) ? true : false;
110 IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA
), (uintptr_t) this, (uintptr_t) owner
);
112 signalWorkAvailable();
115 IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA
), (uintptr_t) this, (uintptr_t) owner
);
120 IOFilterInterruptEventSource::Filter
121 IOFilterInterruptEventSource::getFilterAction() const
129 void IOFilterInterruptEventSource::normalInterruptOccurred
130 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
133 bool trace
= (gIOKitTrace
& kIOTraceIntEventSource
) ? true : false;
136 IOTimeStampStartConstant(IODBG_INTES(IOINTES_FILTER
),
137 (uintptr_t) filterAction
, (uintptr_t) owner
, (uintptr_t) this, (uintptr_t) workLoop
);
140 filterRes
= (*filterAction
)(owner
, this);
143 IOTimeStampEndConstant(IODBG_INTES(IOINTES_FILTER
),
144 (uintptr_t) filterAction
, (uintptr_t) owner
, (uintptr_t) this, (uintptr_t) workLoop
);
150 void IOFilterInterruptEventSource::disableInterruptOccurred
151 (void */
*refcon*/
, IOService
*prov
, int source
)
154 bool trace
= (gIOKitTrace
& kIOTraceIntEventSource
) ? true : false;
157 IOTimeStampStartConstant(IODBG_INTES(IOINTES_FILTER
),
158 (uintptr_t) filterAction
, (uintptr_t) owner
, (uintptr_t) this, (uintptr_t) workLoop
);
161 filterRes
= (*filterAction
)(owner
, this);
164 IOTimeStampEndConstant(IODBG_INTES(IOINTES_FILTER
),
165 (uintptr_t) filterAction
, (uintptr_t) owner
, (uintptr_t) this, (uintptr_t) workLoop
);
168 prov
->disableInterrupt(source
); /* disable the interrupt */