如何ARM系统模式是嵌套中断有用吗? [英] How ARM system mode is useful in nested interrupt?

查看:367
本文介绍了如何ARM系统模式是嵌套中断有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能解释我,究竟我们有嵌套中断系统模式下工作?

Can someone explain me, how exactly system mode works when we have nested interrupt ?

根据ARM网站

在ARMv4及更高版本的体系结构包含一个称为系统模式的特权模式,来克服这个问题。系统模式共享相同的寄存器,用户模式,它可以运行那些需要特权访问的任务,并且异常不再覆盖链接寄存器。

ARMv4 and later architectures include a privileged mode called System mode, to overcome this problem. System mode shares the same registers as User mode, it can run tasks that require privileged access, and exceptions no longer overwrite the link register.

那么,如何系统模式下使用用户模式寄存器的?

So how system mode make use of registers of User mode ?

和高达什么层级嵌套中断,可处理?

And upto what hierarchy level nested interrupts can be handled?

推荐答案

试图处理IRQ模式中断嵌套:

Trying to handle nested interrupts in IRQ mode:


  • (USER)你是在用户模式下,您的PC寄存器告诉你在哪里。

  • (USER) You are in user mode, your PC register tells where you are.

(USER)你得到一个中断。

(USER) You get an interrupt.

(IRQ)核心交换机中断模式,禁用通过中断(面具
cpsr.i)从保存用户模式LR在IRQ模式PC。

(IRQ) Core switches to interrupt mode, disables interrupts (mask via cpsr.i) saves PC from user mode to LR in IRQ mode.

(IRQ),这时你不能得到更多的中断,因为中断
禁用。

(IRQ) At this moment you can't get more interrupts because interrupts are disabled.

(IRQ)你在IRQ模式,你这样做允许中断。

(IRQ) You are in IRQ mode and you do enable interrupts.

(IRQ)可以调用一个函数来处理相关的中断。经过函数调用LR包含,返回地址复制到顶层IRQ处理程序。

(IRQ) You call a function to handle related interrupt. After function call LR contains, return address into top level IRQ handler.

(IRQ)另一个中断发生,LR获取与处理功能中断覆盖。在这一刻,你不能有一个稳定的状态,仅仅是因为您不能使用LR自己的目的在IRQ模式并启用中断支持嵌套中断。你以为你可以节省LR栈,但是这将是开放竞争状态,这将导致inifinitive循环。

(IRQ) Another interrupt happens, LR gets overwritten with function handling interrupt. At this moment you can't have a stable state, simply because you can't use LR for your own purposes in IRQ mode and have interrupts enabled to support nested interrupts. You think you may save LR to stack, but that would be open to a race condition which would lead to inifinitive loops.

通过系统模式处理中断嵌套:

Handling nested interrupts via System mode:


  • (USER)你是在用户模式下,您的PC寄存器告诉你在哪里。

  • (USER) You are in user mode, your PC register tells where you are.

(USER)你得到一个中断。

(USER) You get an interrupt.

(IRQ)核心交换机中断模式,禁用通过中断(面具
cpsr.i)从保存用户模式LR在IRQ模式PC。

(IRQ) Core switches to interrupt mode, disables interrupts (mask via cpsr.i) saves PC from user mode to LR in IRQ mode.

(IRQ),这时你不能得到更多的中断,因为中断
禁用。

(IRQ) At this moment you can't get more interrupts because interrupts are disabled.

(IRQ)切换到系统模式,使能的IRQ。

(IRQ) You switch to system mode, enable IRQs.

(SYSTEM)另一个中断发生,但事情的工作只是因为你没有硬件赛跑,让您的LR理智。

(SYSTEM) Another interrupt happens but things work just because you don't race with hardware to keep your LR sane.

看看下面来看看哪些寄存器中的状态被存入银行。

Look below to see which registers gets banked in which states.

这篇关于如何ARM系统模式是嵌套中断有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆