|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-AF2E227B-C5BD-5F05-98D4-7D15530161C8" xml:lang="en"><title>Interrupt::Clear()</title><shortdesc>Describes the implementation of the clear function.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
13 <p>The function <xref href="GUID-E7A7083C-97B9-39B9-A147-4A6E314EE3A3.dita#GUID-E7A7083C-97B9-39B9-A147-4A6E314EE3A3/GUID-DB641A23-82B2-373E-A514-E11118CB6E69"><apiname>Interrupt::Clear()</apiname></xref> is used by device drivers |
|
14 to acknowledge that they have serviced the interrupt and cleared the pending |
|
15 flag in the interrupt controller hardware. </p> |
|
16 <p>This is useful in situations where an interrupt must be cleared explicitly |
|
17 rather than as a side effect of an I/O register access, especially where the |
|
18 clearing is done from generic code such as in the PC card and MMC controllers. </p> |
|
19 <p>The implementation of this function is completely dependent on the interrupt |
|
20 hardware. </p> |
|
21 <p>In the template port, <codeph>Interrupt::Clear()</codeph> is implemented |
|
22 in <filepath>...\template_assp\interrupts.cpp</filepath>. </p> |
|
23 <codeblock id="GUID-7612CEB2-7ADA-552D-9BB9-B0B1B2D8E4BC" xml:space="preserve">EXPORT_C TInt Interrupt::Clear(TInt anId) |
|
24 { |
|
25 __KTRACE_OPT(KEXTENSION,Kern::Printf("Interrupt::Clear id=%d",anId)); |
|
26 TInt r=KErrNone; |
|
27 // if ID indicates a chained interrupt, call variant... |
|
28 if (anId<0 && ((((TUint)anId)>>16)&0x7fff)<(TUint)KNumTemplateInts) |
|
29 r=TemplateAssp::Variant->InterruptClear(anId); |
|
30 else if ((TUint)anId>=(TUint)KNumTemplateInts) |
|
31 r=KErrArgument; |
|
32 else |
|
33 { |
|
34 // |
|
35 // TO DO: (mandatory) |
|
36 // |
|
37 // Clear the corresponding Hardware Interrupt source |
|
38 // |
|
39 } |
|
40 return r; |
|
41 }</codeblock> |
|
42 </conbody></concept> |