Linux的进程背景和ARM SVC调用 [英] Linux Process Context and SVC call in ARM

查看:460
本文介绍了Linux的进程背景和ARM SVC调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据一些Linux的书籍

As per some Linux books

内核code,它的服务的系统调用用户应用程序发出的
  运行在代表相应的应用程​​序的,并以所述
  在进程上下文执行。中断处理程序在中断运行
  上下文。

kernel code that services system calls issued by user applications runs on behalf of the corresponding application process and is said to be executing in process context. Interrupt Handlers run in interrupt context.

现在SVC和IRQ是两个例外。

Now svc and irq are two exceptions.

所以,当Linux处理SVC是在工艺方面,虽然它正在处理IRQ是在中断上下文。是如何映射?

So when linux is handling svc it is in process context and while it is handling irq it is in interrupt context. Is that how it is mapped ?

只是一个编辑这个

这也是在微进程在中断上下文中运行的软中断/工作队列时过程中的环境中运行的书籍提及。因此,这是否意味着任务蕾将在CPSR.mode = IRQ运行?

It is also mentioned in books that tasklets / softirqs run in interrupt context while workqueues run in Process context. So does it mean that tasklet would run in CPSR.mode = IRQ ?

推荐答案

如果我理解正确的方式你的困惑:

If I understand your confusion in the right way:

由于Linux是一个有能力,preemptive,复杂的操作系统它的概念,如处理中断,或相对于裸机硬件服务软件陷阱。更精细的处理

Since Linux is a capable, preemptive, complex operating system it has much finer handling of concepts such as handling of interrupts or serving software traps compared to bare metal hardware.

例如,当一个管理程序调用(SVC)发生硬件切换到SVC模式那么Linux处理此为$ P $简单pparing一些数据结构来处理更多然后从SVC模式退出让核心可以继续在用户模式下,供应因而从而能够阻止他们碰上更多的异常模式来代替。

For example when a supervisor call (svc) happens hardware switches to SVC mode then Linux handles this as simple as preparing some data structures for handling it further then quits from SVC mode so core can continue serving in user mode thus making it possible to run into many more exception modes instead of blocking them.

有同样的IRQ模式,Linux的处理在IRQ模式最低限度。它prepares数据结构作为IRQ发生了,哪个处理程序被调用等等,然后从IRQ状态退出立即让更多的是核心的发生。后来一些其他的内部内核线程可以处理进一步中断。由于硬件而被相对简单的运行非常快因而在并行处理中断运行的许多流程。

It is same for IRQ mode, Linux handles bare minimum in IRQ mode. It prepares data structures as which IRQ happened, which handler should be invoked etc then exits from IRQ mode immediately to allow more to happen on that core. Later on some other internal kernel thread may process that interrupt further. Since hardware while being relatively simple runs really fast thus handling of interrupt runs in parallel with many processes.

这种先进的方法的缺点是它给人的响应时间要求任何保证或它的头顶上像MCU的速度慢的硬件变得可见。

Downside of this advanced approach is it gives no guarantees on response time requirements or overhead of it becomes visible on slower hardware like MCUs.

所以,ARM的异常模式提供了两件事情:对于Linux:消息类型和优先级的硬件支持为后盾

So ARM's exception modes provides two things for Linux: message type and priority backed with hardware support.


  • 信息类型是什么异常模式左右,如果它是一个SVC,IRQ,FIQ,数据异常,未定义指令等,所以,当硬件运行到一个异常模式,Linux的隐含知道它是什么处理。

  • 重点是关于提供一个有能力和反应灵敏的硬件,例如系统应该能够承认中断,同时处理一些不太重要的管理程序调用。

  • 硬件支持是处理上述两个更容易和更快。例如,某些寄存器被存入银行,或者有额外的系统模式来处理折返IRQ容易。

这篇关于Linux的进程背景和ARM SVC调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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