2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
29 1999-4-15 Godfrey van der Linden(gvdl)
32 #include <IOKit/IOFilterInterruptEventSource.h>
33 #include <IOKit/IOService.h>
34 #include <IOKit/IOTimeStamp.h>
35 #include <IOKit/IOWorkLoop.h>
39 #define IOTimeTypeStampS(t) \
41 IOTimeStampStart(IODBG_INTES(t), \
42 (unsigned int) this, (unsigned int) owner); \
45 #define IOTimeTypeStampE(t) \
47 IOTimeStampEnd(IODBG_INTES(t), \
48 (unsigned int) this, (unsigned int) owner); \
51 #define IOTimeStampLatency() \
53 IOTimeStampEnd(IODBG_INTES(IOINTES_LAT), \
54 (unsigned int) this, (unsigned int) owner); \
58 #define IOTimeTypeStampS(t)
59 #define IOTimeTypeStampE(t)
60 #define IOTimeStampLatency()
63 #define super IOInterruptEventSource
65 OSDefineMetaClassAndStructors
66 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
67 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
68 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
69 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
70 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
71 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
72 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
73 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
74 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
77 * Implement the call throughs for the private protection conversion
79 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
81 IOService
*inProvider
,
87 IOInterruptEventSource
*
88 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
90 IOService
*inProvider
,
97 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
99 Filter inFilterAction
,
100 IOService
*inProvider
,
103 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
109 filterAction
= inFilterAction
;
113 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
114 ::filterInterruptEventSource(OSObject
*inOwner
,
116 Filter inFilterAction
,
117 IOService
*inProvider
,
120 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
123 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
131 void IOFilterInterruptEventSource::signalInterrupt()
133 IOTimeStampLatency();
137 IOTimeTypeStampS(IOINTES_SEMA
);
138 signalWorkAvailable();
139 IOTimeTypeStampE(IOINTES_SEMA
);
143 IOFilterInterruptEventSource::Filter
144 IOFilterInterruptEventSource::getFilterAction() const
152 void IOFilterInterruptEventSource::normalInterruptOccurred
153 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
157 IOTimeTypeStampS(IOINTES_INTCTXT
);
159 IOTimeTypeStampS(IOINTES_INTFLTR
);
160 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
161 (unsigned int) filterAction
, (unsigned int) owner
);
162 filterRes
= (*filterAction
)(owner
, this);
163 IOTimeTypeStampE(IOINTES_INTFLTR
);
168 IOTimeTypeStampE(IOINTES_INTCTXT
);
171 void IOFilterInterruptEventSource::disableInterruptOccurred
172 (void */
*refcon*/
, IOService
*prov
, int source
)
176 IOTimeTypeStampS(IOINTES_INTCTXT
);
178 IOTimeTypeStampS(IOINTES_INTFLTR
);
179 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
180 (unsigned int) filterAction
, (unsigned int) owner
);
181 filterRes
= (*filterAction
)(owner
, this);
182 IOTimeTypeStampE(IOINTES_INTFLTR
);
185 prov
->disableInterrupt(source
); /* disable the interrupt */
189 IOTimeTypeStampE(IOINTES_INTCTXT
);