如何内核堆栈在ARM架构不同的处理器模式的情况下使用? [英] How Kernel stack is used in case of different processor mode in ARM architecture?

查看:193
本文介绍了如何内核堆栈在ARM架构不同的处理器模式的情况下使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解每个进程有一个用户栈和内核栈。除了有对ARM achitecture每模式的堆叠。所以我想知道怎样不同的堆栈,并在ARM模式堆栈指针的作品?此外,当与进程关联该内核堆栈将被使用?


解决方案

  

    

...当与进程相关为此内核栈将被使用?


  

当你做出一个系统调用。像你想获得一个接口的IP地址,内核就像任何其他应用程序需要一定的堆栈prepare你想要什么。所以它有一个相应的堆栈,当你切换到内核的系统调用的一面。


  

    

如何不同的堆栈,并在ARM模式堆栈指针的作品?


  

ARM定义几个硬件模式来处理不同输入到系统中。例如从哪儿冒出来,你可以执行一个非法指令(或未定义)。在CPU的这种情况下,执行进入一个不同模式并需要被告知如何进行。因为大多数的你需要一些堆栈空间的时间,以便能够处理这种正常需要为这种模式的单独的堆栈。 ARM为您提供不同的堆栈寄存器,所以,当你切换到不同的硬件模式,不要覆盖previous模式堆栈指针。

As I understand every process have a user stack and kernel stack. Apart from that there is a stack for every mode in ARM achitecture. So I want to know How different stack and stack pointer works in ARM modes? Also when this kernel stack associated with the process will be used ?

解决方案

... when this kernel stack associated with the process will be used ?

When you make a system call. Like you want to get IP address of an interface, kernel just like any other application needs some stack to prepare what you want. So it has a corresponding stack when you switch to kernel side of a system call.

How different stack and stack pointer works in ARM modes?

ARM defines a few hardware modes to handle different inputs to the system. For example out of nowhere you can execute an illegal instruction (or undefined). In this case execution in CPU goes into a different mode and needs to be told how to proceed. Since most of the time you require some stack space to be able to handle this gracefully you need a separate stack for this mode. ARM provides you different stack register so when you switch to a different HW mode you don't overwrite previous modes stack pointer.

这篇关于如何内核堆栈在ARM架构不同的处理器模式的情况下使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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