MCR and MRC does not exist on AARCH64?

…衆ロ難τιáo~ 提交于 2019-12-08 09:29:07

问题


I am trying to compile "mrc" and "mcr" instruction on AARCH64 based on Board but I am seeing below error message

   tmp/ccqOHmrK.s: Assembler messages:
  /tmp/ccqOHmrK.s:43: Error: unknown mnemonic `mrc' -- `mrc p15,0,x0,c14,c3,1'
  /tmp/ccqOHmrK.s:53: Error: unknown mnemonic `mrc' -- `mrc p15,0,x2,c14,c3,0'

I tried looking into the kernel source /arch/arm64 but no where mcr&&mrc has been used without emulation.

Is it some syntax issue?


回答1:


You should replace these with the appropriate msr instructions. For example, arch/arm/include/asm/arch_timer.h has:

case ARCH_TIMER_REG_CTRL:
    asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val));

The counterpart in arch/arm64/include/asm/arch_timer.h has:

case ARCH_TIMER_REG_CTRL:
    asm volatile("msr cntv_ctl_el0,  %0" : : "r" (val));


来源:https://stackoverflow.com/questions/32374599/mcr-and-mrc-does-not-exist-on-aarch64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!