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. CoreCLR源码探索(七) JIT的工作原理(入门篇)

    很多C#的初学者都会有这么一个疑问, .Net程序代码是如何被机器加载执行的? 最简单的解答是, C#会通过编译器(CodeDom, Roslyn)编译成IL代码, 然后CLR(.Net Framew ...

  2. Table样式设置

    <table class="listTable"> <tr><th width="40px">序号</th>&l ...

  3. Latex 去掉行号

    本文主要讲如何去掉Latex的行号 删除\modulolinenumbers删除所有\linenumbers 删除\usepackage{lineno,hyperref} modulolinenumb ...

  4. 基于HTML5的WebGL实现的2D3D迷宫小游戏

    为了实现一个基于HTML5的场景小游戏,我采用了HT for Web来实现,短短200行代码,我就能实现用"第一人称"来操作前进后退上下左右,并且实现了碰撞检测. 先来看下实现的效 ...

  5. 23种设计模式JAVA 实现目录总结

    曾看了不少的有关设计模式的文章,有的提供的实现在现在看来是有些问题,所以现在对以前看过的有关设计模式的文章在这里总结一下,随笔中有引用其他资料,并根据自己的理解重新实现了一次,23种设计模式中,并没有 ...

  6. IOC杂谈(一)初识IOC

    初衷 发现学习东西不单只是看,用,还有很重要一点就是记录,不然过个几个月再用到相同的知识时,你会发现你已经丢得差不多了,故此开始在博客园记录的同时也与各位同行分享知识. 正题 关于IOC,在刚工作时就 ...

  7. C++数组做参数

    首先,看一下下面这段代码: void changearr(int a[],int n){    cout<<sizeof(a)<<endl;         // 输出4}in ...

  8. 2_ROS学习

    2_VNC远程连接树莓派 在上一次,我们成功的给树莓派安装了Ubuntu mate的操作系统. 树莓派是嵌入式计算机,一般是没有显示屏来显示的,我们通过远程连接来访问树莓派.网上推荐了ssh连接,xr ...

  9. hibernate的session详解

  10. 前端性能优化jQuery性能优化

    一.使用合适的选择器 $("#id"); 1.使用id来定位DOM元素无疑是最佳提高性能的方式,因为jQuery底层将直接调用本地方法document.getElementById ...