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. Linux-Nand Flash驱动(分析MTD层并制作NAND驱动)

    1.本节使用的nand flash型号为K9F2G08U0M,它的命令如下: 1.1我们以上图的read id(读ID)为例,它的时序图如下: 首先需要使能CE片选 1)使能CLE 2)发送0X90命 ...

  2. 如何让vim像IDE一样一键放大缩小字号?

    原创,转载请注明出处 在其他IDE中,比如codeblocks,按住ctrl,然后滑动鼠标滚轮就可以实现字体的放大缩小. 在强大的vim中code怎么能缺少这种功能?! 在vim插件库中查询一番,发现 ...

  3. java将map拼接成“参数=值&参数=值”

    Java将Map拼接成"参数=值&参数=值" 把一个map的键值对拼接成"参数=值&参数=值"即"username=angusbao& ...

  4. Bootstrap的核心——栅格系统的使用

        前  言 絮叨絮叨 Bootstrap 是基于 HTML.CSS.JAVASCRIPT 的,它简洁灵活,使得 Web 开发更加快捷. 而栅格系统是Bootstrap中的核心,正是因为栅格系统的 ...

  5. [Bayesian] “我是bayesian我怕谁”系列 - Naive Bayes+prior

    先明确一些潜规则: 机器学习是个collection or set of models,一切实践性强的模型都会被归纳到这个领域,没有严格的定义,’有用‘可能就是唯一的共性. 机器学习大概分为三个领域: ...

  6. python学习笔记(十一)之函数

    牛刀小试: 定义一个无参函数 >>> def myFirstFunc(): ... print("Hello python") ... print("h ...

  7. mac上使用crontab周期性执行python脚本

    这个月买了本书<Linux系统命令及Shell脚本实践指南>, 看到了一个周期性执行任务cron.顿时产生一个想法: mac上有这种机制么? 加上自己也在15年下半年也学了点python脚 ...

  8. 使用localstorage来存储页面信息

    今天小颖在跟着慕课网学习vue,不学不知道,一学吓一跳,学了才发现,我之前知道的只是vue的冰山一角,嘻嘻,今天把小颖跟着慕课网学习的demo,给大家分享下,希望对大家有所帮助嘻嘻. 环境搭建: 参考 ...

  9. CentOS、Ubuntu配置网卡子接口

    CentOS # ip addr add dev eth0 lable eth0: 以上为临时配置,重启失效.若需永久保存,增加网络配置文件 # vim /etc/sysconfig/network- ...

  10. Problem B: 时间和日期类(III)

    Problem B: 时间和日期类(III) Time Limit: 4 Sec  Memory Limit: 128 MBSubmit: 2889  Solved: 1732[Submit][Sta ...