sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.doc.user/html/reference/methods/swi_interrupt.htm
author Matti Laitinen <matti.t.laitinen@nokia.com>
Thu, 11 Feb 2010 15:32:31 +0200
changeset 2 b9ab3b238396
child 5 844b047e260d
permissions -rw-r--r--
Initial version of Performance Investigator under EPL

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<title>Software Interrupts (SWI)</title>
    <link href="../../../book.css" rel="stylesheet" type="text/css">
</head>

<body>
<h3>Software Interrupts (SWI)</h3>
<p>Software Interrupts (SWIs) are commonly used for implementing operating system calls. In ARM architecture, SWIs can be performed with a specific SWI instruction. As the name already suggests, a software interrupt is a software-generated interrupt. When a SWI takes place, resulting actions are somewhat similar to those caused by hardware-generated interrupts. Execution of user-level software is halted and an interrupt service routine (ISR) is entered. SWIs cannot however halt interrupt requests (IRQs) or fast interrupt requests (FIQs), which are commonly hardware-generated and require uninterrupted processing.</p>
<P LANG="en-GB" ALIGN=JUSTIFY>When processing a SWI, the operating mode of the ARM is switched rapidly to the supervisor mode, thus allowing a controlled means for accessing system and kernel resources with privileged rights. This makes SWIs a valuable tool for performance measurements. Custom SWIs can be used to collect important system-level information during the execution of normal user-level software.</P>
<P LANG="en-GB" ALIGN=JUSTIFY>A drawback is that the instruction that causes the SWI to take place has to be added to the specific part of interest within the software. Recompilation of that part of source code is consequently needed. In practice this restricts the use of SWIs in performance measurements to those specific parts of software that have already been identified as interesting through other means of performance analysis.</P>
<P LANG="en-GB" ALIGN=JUSTIFY>It may also be necessary to follow certain precautions before inserting a SWI into a custom part of software code &ndash; some generic functions can be entered in both user and privileged modes. Since SWIs are allowed in general only in user mode software, it may be necessary to take a look at the CPSR (current program status register) in order to resolve the current processor mode before invoking the SWI.</P>
<div id="footer">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
</body>
</html>