2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
31 Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
34 1999-4-15 Godfrey van der Linden(gvdl)
37 #include <IOKit/IOFilterInterruptEventSource.h>
38 #include <IOKit/IOService.h>
39 #include <IOKit/IOTimeStamp.h>
40 #include <IOKit/IOWorkLoop.h>
44 #define IOTimeTypeStampS(t) \
46 IOTimeStampStart(IODBG_INTES(t), \
47 (unsigned int) this, (unsigned int) owner); \
50 #define IOTimeTypeStampE(t) \
52 IOTimeStampEnd(IODBG_INTES(t), \
53 (unsigned int) this, (unsigned int) owner); \
56 #define IOTimeStampLatency() \
58 IOTimeStampEnd(IODBG_INTES(IOINTES_LAT), \
59 (unsigned int) this, (unsigned int) owner); \
63 #define IOTimeTypeStampS(t)
64 #define IOTimeTypeStampE(t)
65 #define IOTimeStampLatency()
68 #define super IOInterruptEventSource
70 OSDefineMetaClassAndStructors
71 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
72 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
73 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
74 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
75 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
76 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
77 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
78 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
79 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
82 * Implement the call throughs for the private protection conversion
84 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
86 IOService
*inProvider
,
92 IOInterruptEventSource
*
93 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
95 IOService
*inProvider
,
102 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
104 Filter inFilterAction
,
105 IOService
*inProvider
,
108 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
114 filterAction
= inFilterAction
;
118 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
119 ::filterInterruptEventSource(OSObject
*inOwner
,
121 Filter inFilterAction
,
122 IOService
*inProvider
,
125 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
128 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
136 void IOFilterInterruptEventSource::signalInterrupt()
138 IOTimeStampLatency();
142 IOTimeTypeStampS(IOINTES_SEMA
);
143 signalWorkAvailable();
144 IOTimeTypeStampE(IOINTES_SEMA
);
148 IOFilterInterruptEventSource::Filter
149 IOFilterInterruptEventSource::getFilterAction() const
157 void IOFilterInterruptEventSource::normalInterruptOccurred
158 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
162 IOTimeTypeStampS(IOINTES_INTCTXT
);
164 IOTimeTypeStampS(IOINTES_INTFLTR
);
165 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
166 (unsigned int) filterAction
, (unsigned int) owner
);
167 filterRes
= (*filterAction
)(owner
, this);
168 IOTimeTypeStampE(IOINTES_INTFLTR
);
173 IOTimeTypeStampE(IOINTES_INTCTXT
);
176 void IOFilterInterruptEventSource::disableInterruptOccurred
177 (void */
*refcon*/
, IOService
*prov
, int source
)
181 IOTimeTypeStampS(IOINTES_INTCTXT
);
183 IOTimeTypeStampS(IOINTES_INTFLTR
);
184 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
185 (unsigned int) filterAction
, (unsigned int) owner
);
186 filterRes
= (*filterAction
)(owner
, this);
187 IOTimeTypeStampE(IOINTES_INTFLTR
);
190 prov
->disableInterrupt(source
); /* disable the interrupt */
194 IOTimeTypeStampE(IOINTES_INTCTXT
);