<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > arm架構(gòu)的linux內(nèi)核中,clrex指令的作用是什么

          arm架構(gòu)的linux內(nèi)核中,clrex指令的作用是什么

          作者: 時(shí)間:2016-11-10 來源:網(wǎng)絡(luò) 收藏
          1. clrex指令的作用:

          arm architecture reference manual》B2-1292以下簡稱arm arm手冊(cè)

          本文引用地址:http://www.ex-cimer.com/article/201611/317220.htm

          The ClearExclusiveLocal() procedure takes as arguments the processor identifier processorid . The procedure clearsthe local record of processor processorid for which an address has had a request for an exclusive access. It isIMPLEMENTATION DEFINED whether this operation also clears the global record of processor processorid that anaddress has had a request for an exclusive access
          該指令的作用就是在獨(dú)占訪問結(jié)束時(shí),清除cpu中本地處理器針對(duì)某塊內(nèi)存區(qū)域的獨(dú)占訪問標(biāo)志(核中的某個(gè)狀態(tài)寄存器),以防在未清除時(shí)的其他操作,對(duì)系統(tǒng)產(chǎn)生影響。對(duì)于是否同時(shí)清除全局的獨(dú)占訪問標(biāo)志,需要在設(shè)計(jì)cpu時(shí)的架構(gòu)師決定。

          2. clrex指令的作用很獨(dú)特,在linux內(nèi)核中用在什么地方呢?

          用在如下地方:
          (1)數(shù)據(jù)中止異常、指令預(yù)取中止異常的處理時(shí)調(diào)用

          (調(diào)用linaro-aarch64/arch/arm/mm/abort-ev7.s v7_early_abort==》clrex)
          (2)從svc模式下的irq異常、未定義指令異常、數(shù)據(jù)中止異常、指令預(yù)取中止異常,處理結(jié)束返回時(shí)調(diào)用

          (調(diào)用宏:linaro-aarch64/arch/arm/kernel/entry-header.s svc_exit)
          (3) 返回到用戶層的快速系統(tǒng)調(diào)用/慢速系統(tǒng)調(diào)用(ret_slow_syscall,ret_fast_syscall==》

          調(diào)用宏:linaro-aarch64/arch/arm/kernel/entry-header.s restore_user_regs==》clrex)
          (4) run_all_tests 函數(shù)調(diào)用(==》kprobe_arm_test_cases==》TEST_UNSUPPORTED("clrex") ==》clrex)

          該函數(shù)是一個(gè)驅(qū)動(dòng)模塊,可以動(dòng)態(tài)加載。

          如上所示:基本所有的異常都要用到該指令,系統(tǒng)調(diào)用的返回也能用到。

          雖然異常和系統(tǒng)調(diào)用的代碼在內(nèi)核中不多,但是當(dāng)內(nèi)核運(yùn)行起來時(shí),異常和系統(tǒng)調(diào)用的執(zhí)行頻率特別高!

          所以該指令還是非常有用的。



          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();