<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Embedded-Linux-Device-Driver%2FC3%2FInterrupt-Handling%2FEnglish</id>
		<title>Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Embedded-Linux-Device-Driver%2FC3%2FInterrupt-Handling%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;action=history"/>
		<updated>2026-04-30T04:12:04Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54840&amp;oldid=prev</id>
		<title>Nancyvarkey at 09:27, 12 February 2021</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54840&amp;oldid=prev"/>
				<updated>2021-02-12T09:27:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:27, 12 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Learning objectives:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Learning objectives:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In this tutorial, we will learn how to handle the software interrupt in the driver.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In this tutorial, we will learn how to handle the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;software interrupt&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;in the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;driver&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Slide 3:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Slide 3:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prerequisites:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prerequisites:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| To follow this tutorial, you should be familiar with:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| To follow this tutorial, you should be familiar with:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''C programming language &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''C programming language''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''Basics of Linux kernel'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''Basics of Linux kernel'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The '''function''' that runs in response to a specific '''interrupt''' is called an '''interrupt handler'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The '''function''' that &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;runs&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;in response to a specific '''interrupt''' is called an '''interrupt handler'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Different '''devices''' can be associated with different '''interrupts'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Different '''devices''' can be associated with different '''interrupts'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A '''driver''' needs to handle the '''interrupts''' properly for its '''device'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* A '''driver''' needs to handle the '''interrupts''' properly for its '''device'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Working - '''Interrupt Handling.'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Working - '''Interrupt Handling.'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| In this tutorial, a user program will '''open''' and '''close''' the '''device file'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;In this tutorial, a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;user program&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;will '''open''' and '''close''' the '''device file'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When the '''user program''' opens a '''device''', the '''software interrupt''' will be triggered by the '''driver'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;When the '''user program''' opens a '''device''', the '''software interrupt''' will be triggered by the '''driver'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When the '''kernel''' receives an '''interrupt''', the '''registered handler''' from the '''driver''' will be '''executed'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;When the '''kernel''' receives an '''interrupt''', the '''registered handler''' from the '''driver''' will be '''executed'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the folder and file in '''desktop'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Point to the folder and file in '''desktop'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 97:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''irqreturn_t irq_handler()'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Highlight '''irqreturn_t irq_handler()'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| We have defined the''' IRQ line number &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;as 2 &lt;/del&gt;'''which will be used in this '''driver'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| We have defined the''' IRQ line number''' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;as 2 &lt;/ins&gt;which will be used in this '''driver'''. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''devices''' can send '''interrupts''' to the '''processor''' using these '''IRQ''' lines.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The '''devices''' can send '''interrupts''' to the '''processor''' using these '''IRQ''' lines.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 147:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 148:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let us see some important '''flags''' that can be used by '''request_irq function'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| Let us see some important '''flags''' that can be used by '''request_irq function'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''IRQF_DISABLED''' - It disables all '''interrupts''' when executing this '''interrupt handler'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''IRQF_DISABLED''' - It disables all '''interrupts''' when executing this '''interrupt handler'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''IRQF_SAMPLE_RANDOM '''- It specifies that '''interrupts''' should contribute to the '''kernel entropy''' pool.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''IRQF_SAMPLE_RANDOM '''- It specifies that '''interrupts''' should contribute to the '''kernel entropy''' pool.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''IRQF_TIMER''' - It is used to mark this '''interrupt''' as '''timer interrupt'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''IRQF_TIMER''' - It is used to mark this '''interrupt''' as '''timer interrupt'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''IRQF_SHARED''' - It allows sharing the '''irq''' among several '''devices'''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&lt;/ins&gt;'''IRQF_SHARED''' - It allows sharing the '''irq''' among several '''devices'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|| &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54757&amp;oldid=prev</id>
		<title>Nancyvarkey at 17:43, 30 January 2021</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54757&amp;oldid=prev"/>
				<updated>2021-01-30T17:43:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;amp;diff=54757&amp;amp;oldid=54710&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54710&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot; {| border=&quot;1&quot; |- || '''VISUAL CUE''' || '''NARRATION''' |- || Slide 1:  Welcome slide: || Welcome to the spoken tutorial on '''Interrupt Handling.''' |-  || Slide 2:  Learnin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Embedded-Linux-Device-Driver/C3/Interrupt-Handling/English&amp;diff=54710&amp;oldid=prev"/>
				<updated>2021-01-14T12:50:12Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; {| border=&amp;quot;1&amp;quot; |- || &amp;#039;&amp;#039;&amp;#039;VISUAL CUE&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;NARRATION&amp;#039;&amp;#039;&amp;#039; |- || Slide 1:  Welcome slide: || Welcome to the spoken tutorial on &amp;#039;&amp;#039;&amp;#039;Interrupt Handling.&amp;#039;&amp;#039;&amp;#039; |-  || Slide 2:  Learnin...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|| '''VISUAL CUE'''&lt;br /&gt;
|| '''NARRATION'''&lt;br /&gt;
|-&lt;br /&gt;
|| Slide 1:&lt;br /&gt;
&lt;br /&gt;
Welcome slide:&lt;br /&gt;
|| Welcome to the spoken tutorial on '''Interrupt Handling.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 2:&lt;br /&gt;
&lt;br /&gt;
Learning objectives:&lt;br /&gt;
|| In this tutorial, we will learn how to&lt;br /&gt;
* Handle the software interrupt in the driver.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 3:&lt;br /&gt;
&lt;br /&gt;
System Requirements:&lt;br /&gt;
|| To record this tutorial, I am using,&lt;br /&gt;
* '''VirtualBox 5.2.'''&lt;br /&gt;
* '''Ubuntu Linux 18.04 LTS Operating System.'''&lt;br /&gt;
* '''Linux kernel version 5.0.0-31 generic.'''&lt;br /&gt;
* '''gedit text editor.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 4:&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
|| To follow this tutorial, you should be familiar with:&lt;br /&gt;
* '''C programming language and'''&lt;br /&gt;
* '''Basics of Linux kernel'''&lt;br /&gt;
&lt;br /&gt;
If not, then go through the '''C/C++''' and '''Linux''' spoken tutorials on this website&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 6 :&lt;br /&gt;
'''Interrupt handler'''&lt;br /&gt;
&lt;br /&gt;
|| * The '''function''' that runs in response to a specific '''interrupt''' is called an '''interrupt handler'''&lt;br /&gt;
* Different '''devices''' can be associated with different '''interrupts'''.&lt;br /&gt;
* A '''driver''' needs to handle the '''interrupts''' properly for its '''device'''. &lt;br /&gt;
|- &lt;br /&gt;
|| Slide :&lt;br /&gt;
&lt;br /&gt;
Working - '''Interrupt Handling.'''&lt;br /&gt;
|| In this tutorial, a user program will '''open''' and '''close''' the device file.&lt;br /&gt;
&lt;br /&gt;
When the user program opens a device, the software interrupt will be triggered by the driver.&lt;br /&gt;
&lt;br /&gt;
When the kernel receives an interrupt, the registered handler from the driver will be executed.&lt;br /&gt;
|- &lt;br /&gt;
|| Point to the folder and file in '''desktop'''&lt;br /&gt;
&lt;br /&gt;
Point to the '''files'''. &lt;br /&gt;
|| Go to the '''DeviceDriver '''folder in the desktop which we have created earlier.&lt;br /&gt;
&lt;br /&gt;
In this directory, I have created a directory named '''Interrupt'''.&lt;br /&gt;
&lt;br /&gt;
Here, I have saved an''' interrupt dot c , Makefile '''and''' user dot c files.'''&lt;br /&gt;
&lt;br /&gt;
I’ll use these files for demonstration.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide:5&lt;br /&gt;
&lt;br /&gt;
'''Code files:'''&lt;br /&gt;
|| &lt;br /&gt;
* The files used in this tutorial are available in the '''Code Files''' link on this tutorial page.&lt;br /&gt;
* Please download and extract them&lt;br /&gt;
* Make a copy and then use them while practising&lt;br /&gt;
|- &lt;br /&gt;
|| Open the''' terminal'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''cd Desktop/DeviceDriver/Interrupt'''&lt;br /&gt;
|| Open the '''terminal''' by pressing '''ALT+Ctrl+T keys '''simultaneously.&lt;br /&gt;
&lt;br /&gt;
Go to the directory where '''Interrupt '''is saved on your system.&lt;br /&gt;
&lt;br /&gt;
Press Enter key after every command.&lt;br /&gt;
|- &lt;br /&gt;
|| Type &amp;gt;&amp;gt;''' gedit interrupt.c'''&lt;br /&gt;
&lt;br /&gt;
|| Type '''gedit space interrupt dot c.'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''header files'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''&amp;lt;linux/interrupt.h&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
|| We have to include an '''interrupt dot h kernel header file''' to register an '''interrupt'''.&lt;br /&gt;
&lt;br /&gt;
The purpose of each file is mentioned as shown here.&lt;br /&gt;
&lt;br /&gt;
In this file, I have implemented only '''open''' and '''close''' file operations for a''' device.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight''' IRQ_NUM'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''irqreturn_t irq_handler()'''&lt;br /&gt;
|| We have defined the''' IRQ line number as 2 '''which will be used in this '''driver'''. &lt;br /&gt;
&lt;br /&gt;
The '''devices''' can send interrupts to the '''processor''' using these '''IRQ''' lines.&lt;br /&gt;
&lt;br /&gt;
We have implemented an '''interrupt handler''' as shown here.&lt;br /&gt;
&lt;br /&gt;
When the '''kernel''' receives the respective '''interrupt''', it will execute this '''handler'''.&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''int_function()'''&lt;br /&gt;
&lt;br /&gt;
Highlight''' request_irq()'''&lt;br /&gt;
&lt;br /&gt;
|| In the '''initialization '''function, we have to register the '''interrupt handler.'''&lt;br /&gt;
&lt;br /&gt;
'''Drivers''' can register an''' interrupt handler '''and enable a given '''interrupt line''' for handling.&lt;br /&gt;
&lt;br /&gt;
The '''request_irq '''function''' '''is used to register an '''interrupt handler.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''IRQ_NUM'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''irq_handler'''&lt;br /&gt;
|| The first parameter specifies the '''interrupt number''' to allocate.&lt;br /&gt;
&lt;br /&gt;
This value is typically hard-coded in the '''kernel'''.&lt;br /&gt;
The second parameter is a''' function pointer''' to the actual''' interrupt handler.'''&lt;br /&gt;
&lt;br /&gt;
This '''function''' is invoked whenever the '''kernel '''receives the '''interrupt'''.&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''flag'''&lt;br /&gt;
&lt;br /&gt;
|| The third parameter can be either zero or one or any of the '''flags''' defined in the''' interrupt dot h .'''&lt;br /&gt;
&lt;br /&gt;
The fourth parameter is used to identify the '''device''' '''interrupt''' name.&lt;br /&gt;
&lt;br /&gt;
The fifth parameter is used for shared '''interrupt lines.'''&lt;br /&gt;
&lt;br /&gt;
This parameter is used to identify the handlers on the same interrupt line.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| '''Slide - Important flags :'''&lt;br /&gt;
&lt;br /&gt;
'''IRQF_DISABLED''' - Disables all interrupts when executing this interrupt handler.&lt;br /&gt;
&lt;br /&gt;
'''IRQF_SAMPLE_RANDOM '''- Specifies that interrupts should contribute to the kernel entropy pool.&lt;br /&gt;
&lt;br /&gt;
'''IRQF_TIMER''' - Used to mark this interrupt as timer interrupt&lt;br /&gt;
&lt;br /&gt;
'''IRQF_SHARED''' - Allows sharing the irq among several devices&lt;br /&gt;
|| Let us see some important '''flags''' that can be used by '''request_irq '''function&lt;br /&gt;
&lt;br /&gt;
'''IRQF_DISABLED''' - It disables all interrupts when executing this interrupt handler.&lt;br /&gt;
&lt;br /&gt;
'''IRQF_SAMPLE_RANDOM '''- It specifies that interrupts should contribute to the kernel entropy pool.&lt;br /&gt;
&lt;br /&gt;
'''IRQF_TIMER''' - It is used to mark this interrupt as timer interrupt&lt;br /&gt;
&lt;br /&gt;
'''IRQF_SHARED''' - It allows sharing the irq among several devices.&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
| style=&amp;quot;color:#000000;&amp;quot; | Switch back to the '''code'''.&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight''' request_irq()'''&lt;br /&gt;
&lt;br /&gt;
'''Highlight printk'''&lt;br /&gt;
|| '''Request_irq function''' will register the '''irq_handler''' with the name '''my_interrupt.'''&lt;br /&gt;
&lt;br /&gt;
'''my_interrupt''' is used by '''slash proc slash interrupts''' for communication with the '''user'''.&lt;br /&gt;
&lt;br /&gt;
Here, we have used the''' IRQF_SHARED flag.'''&lt;br /&gt;
&lt;br /&gt;
On success,''' request_irq '''function''' '''returns zero.&lt;br /&gt;
&lt;br /&gt;
A nonzero value indicates an error.&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight''' open() function'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''asm(&amp;quot;int $50&amp;quot;)'''&lt;br /&gt;
|| In the '''open() '''function,''' asm(&amp;quot;int $50&amp;quot;)''' '''instruction''' will trigger the '''interrupt'''.&lt;br /&gt;
We are not going to use any '''hardware''' interrupt as they can come from anywhere at any time.&lt;br /&gt;
&lt;br /&gt;
Here, we are going to trigger a '''software interrupt''' using the '''int instruction.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''#define IRQ0_VECTOR()'''&lt;br /&gt;
&lt;br /&gt;
Highlight''' FIRST_EXTERNAL_VECTOR '''&lt;br /&gt;
&lt;br /&gt;
Highlight '''0x20 + 0x10 + 02 = 50'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''02'''&lt;br /&gt;
|| Let us see how to calculate the interrupt line number.&lt;br /&gt;
&lt;br /&gt;
In '''Linux''' '''IRQ''' to '''vector''', mapping is done using '''FIRST_EXTERNAL_VECTOR macro'''.&lt;br /&gt;
&lt;br /&gt;
To raise an''' interrupt IRQ 2''', we have to add 2 to a vector of '''IRQ 0''' as shown here.&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''asm(&amp;quot;int $50&amp;quot;)'''&lt;br /&gt;
|| The '''asm''' '''instruction''' will be executed while opening the '''device file''' of our '''driver'''.&lt;br /&gt;
&lt;br /&gt;
When this '''instruction''' executes, it will raise the''' interrupt IRQ 2.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight '''free_irq(IRQ_NUM,(void *)irq_handler)'''&lt;br /&gt;
&lt;br /&gt;
Highlight '''IRQ_NUM'''&lt;br /&gt;
|| When the '''driver''' unloads, we need to unregister the '''interrupt handler.'''&lt;br /&gt;
&lt;br /&gt;
The '''free_irq function''' is used to remove the '''handler''' and disable the line if not shared.&lt;br /&gt;
&lt;br /&gt;
If it is shared and no handlers remain on the '''line''', the given''' interrupt line''' will be disabled.&lt;br /&gt;
|- &lt;br /&gt;
|| Highlight''' free_irq().'''&lt;br /&gt;
&lt;br /&gt;
|| In the '''exit function''', we have used the '''free function''' to remove the '''handler''' from the '''kernel'''.&lt;br /&gt;
&lt;br /&gt;
It will unregister the''' interrupt handler''' from the '''kernel'''.&lt;br /&gt;
|- &lt;br /&gt;
|| Save and close the '''file'''&lt;br /&gt;
|| Now, save and close the''' file.'''&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''gedit user.c'''&lt;br /&gt;
&lt;br /&gt;
|| Let us now open the '''user program.'''&lt;br /&gt;
&lt;br /&gt;
Type''' gedit space user dot c.'''&lt;br /&gt;
&lt;br /&gt;
The '''program''' will '''open''' and '''close''' a '''device''' using respective''' system calls.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Save and close the file.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|| Now, save and close the file.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|- &lt;br /&gt;
|| Type &amp;gt;&amp;gt;''' sudo su.'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' system password '''&lt;br /&gt;
|| To be a '''superuser''', type '''sudo space su. '''&lt;br /&gt;
Now type the '''system password. '''&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
Type &amp;gt;&amp;gt; '''make all'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' insmod interrupt.ko'''&lt;br /&gt;
|| Let’s compile the '''driver'''.&lt;br /&gt;
&lt;br /&gt;
Type''' make space all'''&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
&lt;br /&gt;
Now let us load the '''driver''' into the '''kernel'''.&lt;br /&gt;
&lt;br /&gt;
Type''' insmod space interrupt dot ko.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Type '''cat /proc/interrupts | grep my_interrupt'''&lt;br /&gt;
&lt;br /&gt;
'''/proc/interrupts '''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''clear'''&lt;br /&gt;
|| Type '''cat space slash proc slash interrupts space pipe space grep space my_interrupt.'''&lt;br /&gt;
&lt;br /&gt;
'''Interrupt file''' in '''procfs''' contains the list of registered '''interrupts''' in the '''system'''.&lt;br /&gt;
&lt;br /&gt;
This '''command''' will show the '''registered interrupt''' '''my_interrupt '''and its '''IRQ line number'''.&lt;br /&gt;
&lt;br /&gt;
In the output, we can see our '''registered interrupt name''' and '''IRQ '''number.&lt;br /&gt;
&lt;br /&gt;
It indicates that our '''interrupt handler '''is''' '''registered successfully.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' gcc -c user.c.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' gcc -o user.out user.o'''&lt;br /&gt;
&lt;br /&gt;
|| Now compile the''' user program.'''&lt;br /&gt;
&lt;br /&gt;
Type '''gcc hyphen c user dot c'''&lt;br /&gt;
&lt;br /&gt;
Type '''gcc hyphen o user dot out user dot o.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Type &amp;gt;&amp;gt;''' ./user.out'''&lt;br /&gt;
&lt;br /&gt;
Highlight output&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''clear'''&lt;br /&gt;
|| Now let us execute the''' user program.'''&lt;br /&gt;
&lt;br /&gt;
Type''' dot slash user dot out'''&lt;br /&gt;
&lt;br /&gt;
Here, output shows that the '''device''' opened and closed successfully.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' dmesg | grep my_driver'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' clear'''&lt;br /&gt;
|| Type '''dmesg space pipe space grep space my_driver'''.&lt;br /&gt;
&lt;br /&gt;
This message shows that the device''' open function '''triggered the '''interrupt'''.&lt;br /&gt;
&lt;br /&gt;
It indicates that as soon as the '''interrupt''' triggered, its '''handler got''' executed. &lt;br /&gt;
&lt;br /&gt;
After the execution of the '''handler''', the remaining code''' '''from the '''open''' function is executed.&lt;br /&gt;
&lt;br /&gt;
It shows that the '''driver''' properly handled the '''interrupt'''.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|- &lt;br /&gt;
|| Type &amp;gt;&amp;gt; '''rmmod interrupt.ko'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt; '''dmesg | grep my_driver'''&lt;br /&gt;
&lt;br /&gt;
Type &amp;gt;&amp;gt;''' clear'''&lt;br /&gt;
|| Now lets unload the '''driver'''.&lt;br /&gt;
&lt;br /&gt;
Type '''rmmod space interrupt dot ko'''&lt;br /&gt;
&lt;br /&gt;
Let us see the unloaded '''printk''' messages.&lt;br /&gt;
&lt;br /&gt;
Type '''dmesg space pipe space grep space my_driver.'''&lt;br /&gt;
&lt;br /&gt;
Here, we can see our interrupt handler is unregistered from the '''kernel'''.&lt;br /&gt;
&lt;br /&gt;
Clear the screen.&lt;br /&gt;
|- &lt;br /&gt;
|| Type &amp;gt;&amp;gt;''' make clean.'''&lt;br /&gt;
&lt;br /&gt;
|| To remove the '''object files''', type '''make space clean.'''&lt;br /&gt;
&lt;br /&gt;
|- &lt;br /&gt;
|| &lt;br /&gt;
|| With this, we come to the end of this tutorial. Let us summarise.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 11:&lt;br /&gt;
&lt;br /&gt;
Summary:&lt;br /&gt;
|| In this tutorial, we learnt &lt;br /&gt;
* '''Interrupt Handling in the driver'''&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 12:&lt;br /&gt;
&lt;br /&gt;
Assignment : &lt;br /&gt;
|| As an assignment:&lt;br /&gt;
# Open the''' interrupt.c driver file.'''&lt;br /&gt;
# Write the''' interrupt instruction '''in the release '''function'''.&lt;br /&gt;
# Compile and load the '''driver'''.&lt;br /&gt;
# Compile and execute the '''user program.'''&lt;br /&gt;
# See the output using''' dmesg command.'''&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 13:&lt;br /&gt;
&lt;br /&gt;
About Spoken Tutorial Project:&lt;br /&gt;
|| &lt;br /&gt;
* The video at the following link summarizes the Spoken Tutorial project.&lt;br /&gt;
* Please download and watch it.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 14:&lt;br /&gt;
&lt;br /&gt;
Spoken Tutorial workshops :&lt;br /&gt;
|| The Spoken Tutorial Project Team:* conducts workshops and&lt;br /&gt;
* gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 15:&lt;br /&gt;
Forum questions :&lt;br /&gt;
|| * Please post your timed queries in this forum&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 16:&lt;br /&gt;
&lt;br /&gt;
Forum for specific questions :&lt;br /&gt;
|| * Do you have any general or technical questions on Embedded Linux Device Driver?&lt;br /&gt;
* Please visit the FOSSEE forum and post your question&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 17:&lt;br /&gt;
&lt;br /&gt;
Acknowledgment:&lt;br /&gt;
|| The Spoken Tutorial Project is funded by MHRD, Government of India.&lt;br /&gt;
|- &lt;br /&gt;
|| Slide 18:&lt;br /&gt;
&lt;br /&gt;
Thank you slide:&lt;br /&gt;
&lt;br /&gt;
|| This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay. &lt;br /&gt;
This is Usha signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for watching.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>