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 Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
32 1999-4-15 Godfrey van der Linden(gvdl)
35 #include <IOKit/IOFilterInterruptEventSource.h>
36 #include <IOKit/IOService.h>
37 #include <IOKit/IOTimeStamp.h>
38 #include <IOKit/IOWorkLoop.h>
42 #define IOTimeTypeStampS(t) \
44 IOTimeStampStart(IODBG_INTES(t), \
45 (unsigned int) this, (unsigned int) owner); \
48 #define IOTimeTypeStampE(t) \
50 IOTimeStampEnd(IODBG_INTES(t), \
51 (unsigned int) this, (unsigned int) owner); \
54 #define IOTimeStampLatency() \
56 IOTimeStampEnd(IODBG_INTES(IOINTES_LAT), \
57 (unsigned int) this, (unsigned int) owner); \
61 #define IOTimeTypeStampS(t)
62 #define IOTimeTypeStampE(t)
63 #define IOTimeStampLatency()
66 #define super IOInterruptEventSource
68 OSDefineMetaClassAndStructors
69 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
70 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
71 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
72 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
73 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
74 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
75 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
76 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
77 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
80 * Implement the call throughs for the private protection conversion
82 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
84 IOService
*inProvider
,
90 IOInterruptEventSource
*
91 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
93 IOService
*inProvider
,
100 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
102 Filter inFilterAction
,
103 IOService
*inProvider
,
106 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
112 filterAction
= inFilterAction
;
116 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
117 ::filterInterruptEventSource(OSObject
*inOwner
,
119 Filter inFilterAction
,
120 IOService
*inProvider
,
123 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
126 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
134 void IOFilterInterruptEventSource::signalInterrupt()
136 IOTimeStampLatency();
140 IOTimeTypeStampS(IOINTES_SEMA
);
141 signalWorkAvailable();
142 IOTimeTypeStampE(IOINTES_SEMA
);
146 IOFilterInterruptEventSource::Filter
147 IOFilterInterruptEventSource::getFilterAction() const
155 void IOFilterInterruptEventSource::normalInterruptOccurred
156 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
160 IOTimeTypeStampS(IOINTES_INTCTXT
);
162 IOTimeTypeStampS(IOINTES_INTFLTR
);
163 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
164 (unsigned int) filterAction
, (unsigned int) owner
);
165 filterRes
= (*filterAction
)(owner
, this);
166 IOTimeTypeStampE(IOINTES_INTFLTR
);
171 IOTimeTypeStampE(IOINTES_INTCTXT
);
174 void IOFilterInterruptEventSource::disableInterruptOccurred
175 (void */
*refcon*/
, IOService
*prov
, int source
)
179 IOTimeTypeStampS(IOINTES_INTCTXT
);
181 IOTimeTypeStampS(IOINTES_INTFLTR
);
182 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
183 (unsigned int) filterAction
, (unsigned int) owner
);
184 filterRes
= (*filterAction
)(owner
, this);
185 IOTimeTypeStampE(IOINTES_INTFLTR
);
188 prov
->disableInterrupt(source
); /* disable the interrupt */
192 IOTimeTypeStampE(IOINTES_INTCTXT
);