2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
26 1999-4-15 Godfrey van der Linden(gvdl)
29 #include <IOKit/IOFilterInterruptEventSource.h>
30 #include <IOKit/IOService.h>
31 #include <IOKit/IOTimeStamp.h>
32 #include <IOKit/IOWorkLoop.h>
36 #define IOTimeTypeStampS(t) \
38 IOTimeStampStart(IODBG_INTES(t), \
39 (unsigned int) this, (unsigned int) owner); \
42 #define IOTimeTypeStampE(t) \
44 IOTimeStampEnd(IODBG_INTES(t), \
45 (unsigned int) this, (unsigned int) owner); \
48 #define IOTimeStampLatency() \
50 IOTimeStampEnd(IODBG_INTES(IOINTES_LAT), \
51 (unsigned int) this, (unsigned int) owner); \
55 #define IOTimeTypeStampS(t)
56 #define IOTimeTypeStampE(t)
57 #define IOTimeStampLatency()
60 #define super IOInterruptEventSource
62 OSDefineMetaClassAndStructors
63 (IOFilterInterruptEventSource
, IOInterruptEventSource
)
64 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 0);
65 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 1);
66 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 2);
67 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 3);
68 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 4);
69 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 5);
70 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 6);
71 OSMetaClassDefineReservedUnused(IOFilterInterruptEventSource
, 7);
74 * Implement the call throughs for the private protection conversion
76 bool IOFilterInterruptEventSource::init(OSObject
*inOwner
,
78 IOService
*inProvider
,
84 IOInterruptEventSource
*
85 IOFilterInterruptEventSource::interruptEventSource(OSObject
*inOwner
,
87 IOService
*inProvider
,
94 IOFilterInterruptEventSource::init(OSObject
*inOwner
,
96 Filter inFilterAction
,
97 IOService
*inProvider
,
100 if ( !super::init(inOwner
, inAction
, inProvider
, inIntIndex
) )
106 filterAction
= inFilterAction
;
110 IOFilterInterruptEventSource
*IOFilterInterruptEventSource
111 ::filterInterruptEventSource(OSObject
*inOwner
,
113 Filter inFilterAction
,
114 IOService
*inProvider
,
117 IOFilterInterruptEventSource
*me
= new IOFilterInterruptEventSource
;
120 && !me
->init(inOwner
, inAction
, inFilterAction
, inProvider
, inIntIndex
)) {
128 void IOFilterInterruptEventSource::signalInterrupt()
130 IOTimeStampLatency();
134 IOTimeTypeStampS(IOINTES_SEMA
);
135 signalWorkAvailable();
136 IOTimeTypeStampE(IOINTES_SEMA
);
140 IOFilterInterruptEventSource::Filter
141 IOFilterInterruptEventSource::getFilterAction() const
149 void IOFilterInterruptEventSource::normalInterruptOccurred
150 (void */
*refcon*/
, IOService */
*prov*/
, int /*source*/)
154 IOTimeTypeStampS(IOINTES_INTCTXT
);
156 IOTimeTypeStampS(IOINTES_INTFLTR
);
157 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
158 (unsigned int) filterAction
, (unsigned int) owner
);
159 filterRes
= (*filterAction
)(owner
, this);
160 IOTimeTypeStampE(IOINTES_INTFLTR
);
165 IOTimeTypeStampE(IOINTES_INTCTXT
);
168 void IOFilterInterruptEventSource::disableInterruptOccurred
169 (void */
*refcon*/
, IOService
*prov
, int source
)
173 IOTimeTypeStampS(IOINTES_INTCTXT
);
175 IOTimeTypeStampS(IOINTES_INTFLTR
);
176 IOTimeStampConstant(IODBG_INTES(IOINTES_FILTER
),
177 (unsigned int) filterAction
, (unsigned int) owner
);
178 filterRes
= (*filterAction
)(owner
, this);
179 IOTimeTypeStampE(IOINTES_INTFLTR
);
182 prov
->disableInterrupt(source
); /* disable the interrupt */
186 IOTimeTypeStampE(IOINTES_INTCTXT
);