Recently I realized my English is still far from good. So in order to improve my English, I must not only read in English, but also think and write in English. I know I'm gonna make a lot of mistake in using English, but everything has a process so I just need to keep practiing my English.

  I use 2.6.34 instead of 2.6.32 as the book describes.

  There're two similar concepts:

Exceptions: synchronous interrupts generated by the processor.

Interrupts: asynchronous interrupts generated by hardware.

  In this chapter, we focus on the interrupts.

  Interrupt handlers are running in interrupt context, which cannot block.

  The processing of interrupts is split into two parts, or halves:

Top Half(interrupt handler): time-critical

Bottom Half: deferred work.

Resgitering an Interrupt Handler(P116):  

/*     <linux/interrupt.h>     */
int request_irq ( unsigned int irq,      /* interrupt number */
irq_handler_t handler,   /* function pointer to the actual interrupt handler */
           unsigned long flags,    /* can be either zero or a bit mask */
           const char *name,      /* an ASCII text representation of the device */
           void *dev)          /* used for shared interrupt lines */

  The third parameter, flags: IRQF_DISABLED, IRQF_SAMPLE_RANDOM, IRQF_TIMER, IRQF_SHARED.

Freeing an Interrupt Handler:

void free_irq (unsigned int irq, void *dev)

  A call to free_irq() must be made from process context.

Writing an Interrupt Handler:

  The following is a declaration of an interrupt handler:

static irqreturn_t intr_handler ( int irq, void *dev)

  An interrupt handler return two special value:

IRQ_NONE: when the interrupt handler detects an interrupt for which its device was not the originator.

IRQ_HANDLED: the interrupt handler was correctly invoked, and its device did indeed cause the interrupt.

LKD: Chapter 7 Interrupts and Interrupt Handlers的更多相关文章

  1. LKD: Chapter 8 Bottom Halves and Deferring Work

    In 2.6.x, there are 3 mechanisms for implementing a bottom half: softirqs, tasklets and work queues. ...

  2. LKD: Chapter 9 An Introduction to Kernel Synchronization

    This chapter introduces some conception about kernel synchronization generally. Critical Regions: Co ...

  3. LKD: Chapter 5 System Call

    在Linux中,处理器所作的事可以归纳为3种情况: 1.In user-space, executing user code in a process; 2.In kernel-space, in p ...

  4. LKD: Chapter 6 Kernel Data Structures

    这一章我们研究四种主要的数据结构: linked lists, queues, maps, binary trees. Linked Lists:(<linux/list.h>) 在lin ...

  5. Linux 网络性能tuning向导

    本文的目的不完全在于提供调优信息,而是在于告诉读者了解Linux kernel如何处理数据包,从而能够在 自己的实践中发挥Linux 内核协议栈最大的性能 The NIC ring buffer 接收 ...

  6. 《CS:APP》 chapter 8 Exceptional Control Flow 注意事项

    Exceptional Control Flow The program counter assumes a sequence of values                            ...

  7. STM32F4 External interrupts

    STM32F4 External interrupts Each STM32F4 device has 23 external interrupt or event sources. They are ...

  8. Linux Context , Interrupts 和 Context Switching 说明

    一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中的值.进程的状态以及堆栈中的内容,比如各个变量和数据,包括所有的寄存器变量.进程打开的文件.内存信息等.这些信息被称为该进程的 ...

  9. Linux Context , Interrupts 和 Context Switching 说明【转】

    转自:http://blog.csdn.net/tianlesoftware/article/details/6461207 一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中 ...

随机推荐

  1. ASP.NET Core 认证与授权[3]:OAuth & OpenID Connect认证

    在上一章中,我们了解到,Cookie认证是一种本地认证方式,通常认证与授权都在同一个服务中,也可以使用Cookie共享的方式分开部署,但局限性较大,而如今随着微服务的流行,更加偏向于将以前的单体应用拆 ...

  2. win10 uwp 通知列表

    经常看到小伙伴问,问已经绑定列表,在进行修改时,不会通知界面添加或删除.这时问题就在,一般使用的列表不会在添加时通知界面,因为他们没有通知. 本文:知道什么是通知的列表,如何去写一个通知列表 在 C# ...

  3. 张高兴的 UWP 开发笔记:应用内启动应用 (UWP Launch UWP)

    需求:在 A 应用内启动 B 应用,如果 B 应用未安装则跳转应用商店搜索. 启动方式使用 Uri 启动,本文使用尽可能简单,并且能拿来直接用的代码.不涉及启动后的应用数据交互,如需深入了解,请戳 M ...

  4. .NET接入接口/请求服务器

    之前只调用过自己写的接口,这个是调用外部接口 一.创建方法链接接口 , string method = "Get", string token = null) { if (stri ...

  5. (转)关于Tomcat的点点滴滴(体系架构、处理http请求的过程、安装和配置、目录结构、设置压缩和对中文文件名的支持、以及Catalina这个名字的由来……等)

    转自:http://itfish.net/article/41668.html   总结Tomcat的体系架构.处理http请求的过程.安装和配置.目录结构.设置压缩和对中文文件名的支持.以及Cata ...

  6. MySql技术内幕之MySQL入门(2)

    MySql技术内幕之MySQL入门(2) 接上一篇. mysql> source create_member.sql; # 创建member表 Query OK, 0 rows affected ...

  7. Django Web框架入门

    一.Django介绍 Django是一个开放源代码的Web应用框架,由Python写成,采用了MVC的框架模式.Django的主要目的是简便.快速的开发数据库驱动的网站.它强调代码复用,多个组件可以很 ...

  8. 超文本传送协议HTTP

    1. HTTP的操作过程: HTTP是面向事务的应用层协议.HTTP协议本身是无连接的,为了保证数据的可靠传输,HTTP使用了面向连接的TCP作为运输层协议.所以,在发送HTTP报文之前都需要先建立T ...

  9. Android Studio常见问题解决

    1.Error:Execution failed for task ':XXXX:processDebugManifest'. > Manifest merger failed with mul ...

  10. SQL2005清空删除日志

    代码如下: Backup Log DNName with no_log  '这里的DNName是你要收缩的数据库名,自己注意修改下面的数据库名,我就不再注释了.godump transaction D ...