美文网首页ARMv8-A
9. The System Control Register

9. The System Control Register

作者: Loyen | 来源:发表于2019-02-05 21:28 被阅读0次

ARMv8-A相关历史文章:

系统寄存器(SCTLR)是用于控制标准内存、system facilities的寄存器,并提供状态信息。



比特位代表的含义如下:



要访问SCTLR_ELn寄存器,使用如下方式:

MRS  <Xt>, SCTLR_ELn        // Read SCTLR_ELn into Xt
MSR  SCTLR_ELn,  <Xt>       // Write Xt to SCTLR_ELn

比如:

MRS  X0,  SCTLR_EL1        // Read System Control Register configuration data
ORR  X0,  X0,  #(1 << 2)      // Set [C] bit (bit [2]) to enable data caching
ORR  X0,  X0,  #(1 << 12)    // Set [I] bit (bit [12]) to enable instruction caching
MSR  SCTLR_EL1,  X0        // Write System Control Register configuration data

注意:在任何一个Exception Level下,处理器中的Cache在数据cache和指令cache使能之前需要保持invalidated。

相关文章

网友评论

    本文标题:9. The System Control Register

    本文链接:https://www.haomeiwen.com/subject/smnvsqtx.html