哪种模式不SVC处理程序的开始? [英] Which mode does the SVC handler start in?

查看:129
本文介绍了哪种模式不SVC处理程序的开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种模式请问ARM SVC处理程序吗?基本上,我想知道ARM内核是当一个SVC引发异常,其中模式启动?

Which mode does the ARM SVC handler start in? Basically, I want to know which mode the ARM core is in when an SVC exception is raised?

似乎无法找到它在ARM公司,但我的猜测是,它开始于监事

Can't seem to find it in the ARM ARM, but my guess would be that it starts in Supervisor.

推荐答案

您谈论的SWI处理程序?是的,我看到他们把它称为SWI指令,但有时SVC指令一些地方。

Are you talking about the SWI handler? Yes, I see some places they refer to it as the SWI instruction but sometimes the SVC instruction.

注:在旧版本的ARM架构,SVC被称为SWI,软件中断

Note: In older versions of the ARM architecture, SVC was called SWI, Software Interrupt.

从ARM公司

Exception type           Mode       Address
----------------------------------------------
Reset                    Supervisor 0x00000000
Undefined Instruction    Undefined  0x00000004
Software Interrupt (SWI) Supervisor 0x00000008
Prefetch Abort           Abort      0x0000000C
Data Abort               Abort      0x00000010
IRQ                      IRQ        0x00000018
FIQ                      FIQ        0x0000001C

...

软件中断异常

软件中断指令(SWI)进入超级用户模式来请求特定的监督员(操作系统)的功能。当执行SWI,以下动作:

The Software Interrupt instruction (SWI) enters Supervisor mode to request a particular supervisor (operating system) function. When a SWI is executed, the following actions are performed:

R14_svc = address of next instruction after the SWI instruction
SPSR_svc = CPSR
CPSR[4:0] = 0b10011  /* Enter Supervisor mode */
CPSR[5] = 0          /* Execute in ARM state */
                     /* CPSR[6] is unchanged */
CPSR[7]= 1           /* Disable normal interrupts */
                     /* CPSR[8] is unchanged */
CPSR[9] = CP15_reg1_EEbit /* Endianness on exception entry */
PC = 0x00000008

要执行SWI手术后返回,可使用下列指令恢复PC(从R14_SVC)和CPSR(从到SPSR_svc)并返回后的SWI指令:
MOVS PC,R14

To return after performing the SWI operation, use the following instruction to restore the PC (from R14_svc) and CPSR (from SPSR_svc) and return to the instruction following the SWI: MOVS PC,R14

这篇关于哪种模式不SVC处理程序的开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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