如何理解ARM异常、中断和向量表

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

如何理解ARM异常、中断和向量表

以前,我一直很疑惑这个ARM异常、中断以及他们的向量表是怎么回事,他们到底是怎么实现的,没有想到今天偶然看到(ARM System Developers Guide: Designing and OpTImizing System Software的ARM异常、中断以及他们的向量表的章节,豁然开朗。ARM嵌入式系统开发:软件设计与优化的英文原版我个人感觉这是国内翻译ARM书籍最好的一本之一,比杜XX的ARM体系结构与编程好千倍。本书虽然说软件设计与优化,但是讲的硬件也很多,比如MMU和cache等,讲的精彩纷呈:我刚才想写关于MMU和cache的博客,发现太庞大,看来这段时间要重新看看这本书才能写。下载地址:)

下面来看看

2.4 ExcepTIons, Interrupts, and the Vector Table

When an excepTIon or interrupt occurs, the processor sets the pc to a specific memoryaddress. The address is within a special address range called the vector table. The entriesin the vector table are instrucTIons that branch to specific routines designed to handle aparticular exception or interrupt.

当异常或者中断发生的时候,处理器设置PC为一个特殊的内存地址。这个地址叫做中断向量表。中断向量表入口是中断、异常的分支入ffff0000). Operating systems such as Linux andMicrosofts embedded products can take advantage of this feature.

内存映射地址0x00000000 是为中断向量表保留的。在某些处理器中断向量表地址为0xffff0000。某些操作系统如linux可以利用这个特征(其实wince就是采用0xffff0000作为中断向量表的地址,但是令人奇怪的是优龙的ADS bootloader的中断向量表地址是0x00000000 ,估计这是编译器决定了)。

When an exception or interrupt occurs, the processor suspends normal execution andstarts loading instructions fromthe exception vector table (see Table 2.6). Each vector tableentry contains a form of branch instruction pointing to the start of a specific routine:

当异常或者中断发生的时候,处理器挂起正常执行的程序并开始加载中断向量表,每个中断入口包含一个指向specific routine(这个不知道怎么翻译)的分支指令。

相关文档
最新文档