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) 1999 Apple Computer, Inc. All rights reserved.
27 1999-4-15 Godfrey van der Linden(gvdl)
30 #include <IOKit/IOFilterInterruptEventSource.h>
31 #include <IOKit/IOService.h>
32 #include <IOKit/IOTimeStamp.h>
33 #include <IOKit/IOWorkLoop.h>
37 #define IOTimeTypeStampS(t) \
39 IOTimeStampStart(IODBG_INTES(t), \
40 (unsigned int) this, (unsigned int) owner); \
43 #define IOTimeTypeStampE(t) \
45 IOTimeStampEnd(IODBG_INTES(t), \
46 (unsigned int) this, (unsigned int) owner); \
49 #define IOTimeStampLatency() \
51 IOTimeStampEnd(IODBG_INTES(IOINTES_LAT), \
52 (unsigned int) this, (unsigned int) owner); \
56 #define IOTimeTypeStampS(t)
57 #define IOTimeTypeStampE(t)
58 #define IOTimeStampLatency()
61 #define super IOInterruptEventSource
63 OSDefineMetaClassAndStructors
64 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
65 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
66 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
67 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
68 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
69 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
70 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
71 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
72 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
75 * Implement the call throughs for the private protection conversion
77 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
79 IOService
*inProvider
,
85 IOInterruptEventSource
*
86 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
88 IOService
*inProvider
,
95 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
97 Filter inFilterAction
,
98 IOService
*inProvider
,
101 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
107 filterAction
= inFilterAction
;
111 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
112 ::filterInterruptEventSource(OSObject
*inOwner
,
114 Filter inFilterAction
,
115 IOService
*inProvider
,
118 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
121 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
129 void IOFilterInterruptEventSource::signalInterrupt()
131 IOTimeStampLatency();
135 IOTimeTypeStampS(IOINTES_SEMA
);
136 signalWorkAvailable();
137 IOTimeTypeStampE(IOINTES_SEMA
);
141 IOFilterInterruptEventSource::Filter
142 IOFilterInterruptEventSource::getFilterAction() const
150 void IOFilterInterruptEventSource::normalInterruptOccurred
151 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
155 IOTimeTypeStampS(IOINTES_INTCTXT
);
157 IOTimeTypeStampS(IOINTES_INTFLTR
);
158 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
159 (unsigned int) filterAction
, (unsigned int) owner
);
160 filterRes
= (*filterAction
)(owner
, this);
161 IOTimeTypeStampE(IOINTES_INTFLTR
);
166 IOTimeTypeStampE(IOINTES_INTCTXT
);
169 void IOFilterInterruptEventSource::disableInterruptOccurred
170 (void */
*refcon*/
, IOService
*prov
, int source
)
174 IOTimeTypeStampS(IOINTES_INTCTXT
);
176 IOTimeTypeStampS(IOINTES_INTFLTR
);
177 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
178 (unsigned int) filterAction
, (unsigned int) owner
);
179 filterRes
= (*filterAction
)(owner
, this);
180 IOTimeTypeStampE(IOINTES_INTFLTR
);
183 prov
->disableInterrupt(source
); /* disable the interrupt */
187 IOTimeTypeStampE(IOINTES_INTCTXT
);