arm archtecture

arm archtecture

 

ARMv8 架构与指令集.学习笔记

https://www.cnblogs.com/lvdongjie/p/6644821.html

arm registers

https://developer.arm.com/documentation/ddi0500/e/debug/memory-mapped-register-summary

stage 1 and stage2 address translation

https://yomostatic.oss-cn-shenzhen.aliyuncs.com/courses/10_arm_virtualization/chapter_4_Deep_in_Arm_Virtualization.pdf

 

linux kernel读写arm64系统寄存器

read_sysreg(r)

write_sysreg(v, r)

 

Introducing Cortex-A35: ARM's Most Efficient Application Processor(ARM technology blog)

https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/introducing-cortex-a35-arm-s-most-efficient-application-processor

 

PSTATE.M[3:0]

PSTATE.M[3:0] is AArch64 Exception level and selected Stack Pointer.

  • M[3:2] is set to the value of PSTATE.EL on taking an exception to EL3 and copied to PSTATE.EL on executing an exception return operation in EL3.
  • M[1] is unused and is 0 for all non-reserved values.
  • M[0] is set to the value of PSTATE.SP on taking an exception to EL3 and copied to PSTATE.SP on executing an exception return operation in EL3.
复制代码
/*
 * PSR bits
 */
#define PSR_MODE_EL0t    0x00000000
#define PSR_MODE_EL1t    0x00000004
#define PSR_MODE_EL1h    0x00000005
#define PSR_MODE_EL2t    0x00000008
#define PSR_MODE_EL2h    0x00000009
#define PSR_MODE_EL3t    0x0000000c
#define PSR_MODE_EL3h    0x0000000d
#define PSR_MODE_MASK    0x0000000f
复制代码

 

    • The t suffix indicates that the SP_EL0 stack pointer is selected.
    • The h suffix indicates that the SP_ELn stack pointer is selected.
      在这里插入图片描述

所以在用user_mode()判断当前是否是在user space exception level时,如果pstate[3:0]的值是PSR_MODE_EL0t时,表示是user space exception level:

#define user_mode(regs)    \
    (((regs)->pstate & PSR_MODE_MASK) == PSR_MODE_EL0t)

 

posted @   aspirs  阅读(195)  评论(0编辑  收藏  举报
编辑推荐:
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
阅读排行:
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
历史上的今天:
2018-09-30 集合竞价的基本过程
点击右上角即可分享
微信分享提示